From 4e511a6e3a3d05c74e90d2510b62d47cdc99bb4c Mon Sep 17 00:00:00 2001 From: Will Sheldon <114631109+wssheldon@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:22:22 -0800 Subject: [PATCH] Add conditional import --- src/dispatch/static/dispatch/src/main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dispatch/static/dispatch/src/main.js b/src/dispatch/static/dispatch/src/main.js index c108ad77b37c..eb035a0fb10e 100644 --- a/src/dispatch/static/dispatch/src/main.js +++ b/src/dispatch/static/dispatch/src/main.js @@ -17,6 +17,13 @@ const app = createApp(App) // Configure sentry let SENTRY_ENABLED = import.meta.env.VITE_DISPATCH_SENTRY_ENABLED let SENTRY_DSN = import.meta.env.VITE_DISPATCH_SENTRY_DSN +let FORMKIT_ENTERPRISE_TOKEN = import.meta.env.FORMKIT_ENTERPRISE_TOKEN + +if (FORMKIT_ENTERPRISE_TOKEN) { + import("@formkit-enterprise/pro").then((module) => { + // Use the module here + }) +} if (SENTRY_ENABLED) { const APP_HOSTNAME = document.location.host