From 66e657dc518a24d154b89aaeaa7f73e82808c307 Mon Sep 17 00:00:00 2001 From: Kevin Chappell Date: Sun, 29 Dec 2024 22:37:38 -0800 Subject: [PATCH] fix: dynamic import breaking build --- src/lib/js/components/controls/index.js | 10 +++++----- vite.config.lib.mjs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/js/components/controls/index.js b/src/lib/js/components/controls/index.js index d22833a4..e0bac6b6 100644 --- a/src/lib/js/components/controls/index.js +++ b/src/lib/js/components/controls/index.js @@ -11,8 +11,6 @@ import Control from './control.js' import { CONTROL_GROUP_CLASSNAME } from '../../constants.js' import Components, { Stages, Rows } from '../index.js' -// control configs - import defaultOptions from './options.js' import { get, set } from '../../common/utils/object.mjs' @@ -376,9 +374,11 @@ export class Controls { this.groupOrder = unique(groupOrder.concat(['common', 'html', 'layout'])) this.options = options - const layoutControls = await import('./layout/index.js') - const formControls = await import('./form/index.js') - const htmlControls = await import('./html/index.js') + const [layoutControls, formControls, htmlControls] = await Promise.all([ + import('./layout/index.js'), + import('./form/index.js'), + import('./html/index.js'), + ]) const allControls = [layoutControls.default, formControls.default, htmlControls.default].flat() diff --git a/vite.config.lib.mjs b/vite.config.lib.mjs index f0ca6d32..05bdfd02 100644 --- a/vite.config.lib.mjs +++ b/vite.config.lib.mjs @@ -36,6 +36,7 @@ export default defineConfig({ }, output: { assetFileNames: 'formeo.min.[ext]', + inlineDynamicImports: true, }, }, },