From ab685b3e4522b2da292d1e01faa936495f762e4a Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Wed, 20 Dec 2023 12:02:33 -0800 Subject: [PATCH] Conditionally load pro module --- src/dispatch/static/dispatch/src/main.js | 10 ++-------- src/dispatch/static/dispatch/vite.config.js | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/dispatch/static/dispatch/src/main.js b/src/dispatch/static/dispatch/src/main.js index 479de5a402a3..150816861128 100644 --- a/src/dispatch/static/dispatch/src/main.js +++ b/src/dispatch/static/dispatch/src/main.js @@ -6,10 +6,7 @@ import store from "./store" import "@formkit/themes/genesis" import.meta.env.VITE_FORMKIT_PRO_PROJECT_KEY - ? await import( - /* @vite-ignore */ - "@formkit/pro/genesis" - ) + ? await import(/* @vite-ignore */ "@formkit/pro/genesis") : null import { plugin, defaultConfig } from "@formkit/vue" @@ -50,10 +47,7 @@ app.use(store) app.component("VResizeDrawer", VResizeDrawer) if (FORMKIT_PRO_PROJECT_KEY) { const proModule = import.meta.env.VITE_FORMKIT_PRO_PROJECT_KEY - ? await import( - /* @vite-ignore */ - "@formkit/pro" - ) + ? await import(/* @vite-ignore */ "@formkit/pro") : null const pro = proModule.createProPlugin(FORMKIT_PRO_PROJECT_KEY, proModule.inputs) app.use(plugin, defaultConfig({ plugins: [pro] })) diff --git a/src/dispatch/static/dispatch/vite.config.js b/src/dispatch/static/dispatch/vite.config.js index c3429a76b1d4..cec4a9c31111 100644 --- a/src/dispatch/static/dispatch/vite.config.js +++ b/src/dispatch/static/dispatch/vite.config.js @@ -46,7 +46,6 @@ export default defineConfig({ find: "@", replacement: path.resolve(__dirname, "./src"), }, - { genesis: import.meta.env.VITE_FORMKIT_PRO_PROJECT_KEY ? "@formkit/pro/genesis" : "" }, ], }, build: {