@servicetitan/startup 34.2.1 → 34.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/build.d.ts +16 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +15 -2
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts +66 -0
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/bundle-vite.js +184 -0
- package/dist/cli/commands/bundle-vite.js.map +1 -0
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +2 -0
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +2 -2
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +2 -2
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/start.d.ts +8 -0
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +8 -2
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js +127 -0
- package/dist/cli/tasks/swc-compile-package.js.map +1 -0
- package/dist/cli/tasks/tsc-compile-package.js +46 -0
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -0
- package/dist/cli/tasks/tsc-compile.js +68 -0
- package/dist/cli/tasks/tsc-compile.js.map +1 -0
- package/dist/cli/utils/bundle.d.ts +2 -5
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +18 -98
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/core/check-resource/check-resource.d.ts +3 -0
- package/dist/core/check-resource/check-resource.d.ts.map +1 -0
- package/dist/core/check-resource/check-resource.js +40 -0
- package/dist/core/check-resource/check-resource.js.map +1 -0
- package/dist/core/check-resource/get-package-json.d.ts.map +1 -0
- package/dist/core/check-resource/get-package-json.js +37 -0
- package/dist/core/check-resource/get-package-json.js.map +1 -0
- package/dist/core/check-resource/index.d.ts +2 -0
- package/dist/core/check-resource/index.d.ts.map +1 -0
- package/dist/core/check-resource/index.js +13 -0
- package/dist/core/check-resource/index.js.map +1 -0
- package/dist/core/check-resource/is-optional-peer-dependency.d.ts.map +1 -0
- package/dist/core/check-resource/is-optional-peer-dependency.js +27 -0
- package/dist/core/check-resource/is-optional-peer-dependency.js.map +1 -0
- package/dist/core/check-resource/is-optional-react-dom-peer-dependency.d.ts.map +1 -0
- package/dist/core/check-resource/is-optional-react-dom-peer-dependency.js +15 -0
- package/dist/core/check-resource/is-optional-react-dom-peer-dependency.js.map +1 -0
- package/dist/core/context.d.ts +14 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +62 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/defines/exposed-dependencies.d.ts +5 -0
- package/dist/core/defines/exposed-dependencies.d.ts.map +1 -0
- package/dist/core/defines/exposed-dependencies.js +26 -0
- package/dist/core/defines/exposed-dependencies.js.map +1 -0
- package/dist/core/defines/exposed-instance-dependencies.d.ts +5 -0
- package/dist/core/defines/exposed-instance-dependencies.d.ts.map +1 -0
- package/dist/core/defines/exposed-instance-dependencies.js +29 -0
- package/dist/core/defines/exposed-instance-dependencies.js.map +1 -0
- package/dist/core/defines/index.d.ts +4 -0
- package/dist/core/defines/index.d.ts.map +1 -0
- package/dist/core/defines/index.js +26 -0
- package/dist/core/defines/index.js.map +1 -0
- package/dist/core/defines/web-component-name.d.ts +5 -0
- package/dist/core/defines/web-component-name.d.ts.map +1 -0
- package/dist/core/defines/web-component-name.js +23 -0
- package/dist/core/defines/web-component-name.js.map +1 -0
- package/dist/core/externals.d.ts +3 -0
- package/dist/core/externals.d.ts.map +1 -0
- package/dist/core/externals.js +29 -0
- package/dist/core/externals.js.map +1 -0
- package/dist/core/get-exposed-dependencies-entry-points.d.ts +11 -0
- package/dist/core/get-exposed-dependencies-entry-points.d.ts.map +1 -0
- package/dist/core/get-exposed-dependencies-entry-points.js +82 -0
- package/dist/core/get-exposed-dependencies-entry-points.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +26 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/types.d.ts +55 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +6 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils/build-metadata.d.ts.map +1 -0
- package/dist/core/utils/build-metadata.js +50 -0
- package/dist/core/utils/build-metadata.js.map +1 -0
- package/dist/core/utils/generate-metadata.d.ts +3 -0
- package/dist/core/utils/generate-metadata.d.ts.map +1 -0
- package/dist/core/utils/generate-metadata.js +40 -0
- package/dist/core/utils/generate-metadata.js.map +1 -0
- package/dist/core/utils/get-bundle-type.d.ts +3 -0
- package/dist/core/utils/get-bundle-type.d.ts.map +1 -0
- package/dist/core/utils/get-bundle-type.js +27 -0
- package/dist/core/utils/get-bundle-type.js.map +1 -0
- package/dist/core/utils/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/utils/get-exposed-dependencies.js +21 -0
- package/dist/core/utils/get-exposed-dependencies.js.map +1 -0
- package/dist/core/utils/get-launchdarkly-sdk-version.d.ts.map +1 -0
- package/dist/core/utils/get-launchdarkly-sdk-version.js +26 -0
- package/dist/core/utils/get-launchdarkly-sdk-version.js.map +1 -0
- package/dist/core/utils/get-output-path.d.ts +3 -0
- package/dist/core/utils/get-output-path.d.ts.map +1 -0
- package/dist/core/utils/get-output-path.js +32 -0
- package/dist/core/utils/get-output-path.js.map +1 -0
- package/dist/core/utils/get-web-components-version.d.ts.map +1 -0
- package/dist/core/utils/get-web-components-version.js +22 -0
- package/dist/core/utils/get-web-components-version.js.map +1 -0
- package/dist/core/utils/index.d.ts +9 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/index.js +27 -0
- package/dist/core/utils/index.js.map +1 -0
- package/dist/core/utils/stringify-config.d.ts +2 -0
- package/dist/core/utils/stringify-config.d.ts.map +1 -0
- package/dist/core/utils/stringify-config.js +35 -0
- package/dist/core/utils/stringify-config.js.map +1 -0
- package/dist/core/virtual-modules.d.ts +9 -0
- package/dist/core/virtual-modules.d.ts.map +1 -0
- package/dist/core/virtual-modules.js +84 -0
- package/dist/core/virtual-modules.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/storybook-config/webpack-final.d.ts +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +18 -6
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +28 -0
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +42 -1
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-package-data.d.ts.map +1 -1
- package/dist/utils/get-package-data.js +3 -2
- package/dist/utils/get-package-data.js.map +1 -1
- package/dist/vite/base-config.d.ts +4 -0
- package/dist/vite/base-config.d.ts.map +1 -0
- package/dist/vite/base-config.js +65 -0
- package/dist/vite/base-config.js.map +1 -0
- package/dist/vite/build-shared-deps.d.ts +3 -0
- package/dist/vite/build-shared-deps.d.ts.map +1 -0
- package/dist/vite/build-shared-deps.js +310 -0
- package/dist/vite/build-shared-deps.js.map +1 -0
- package/dist/vite/create-vite-config.d.ts +3 -0
- package/dist/vite/create-vite-config.d.ts.map +1 -0
- package/dist/vite/create-vite-config.js +52 -0
- package/dist/vite/create-vite-config.js.map +1 -0
- package/dist/vite/define-config.d.ts +12 -0
- package/dist/vite/define-config.d.ts.map +1 -0
- package/dist/vite/define-config.js +15 -0
- package/dist/vite/define-config.js.map +1 -0
- package/dist/vite/load-config-file.d.ts +6 -0
- package/dist/vite/load-config-file.d.ts.map +1 -0
- package/dist/vite/load-config-file.js +107 -0
- package/dist/vite/load-config-file.js.map +1 -0
- package/dist/vite/merge-config.d.ts +6 -0
- package/dist/vite/merge-config.d.ts.map +1 -0
- package/dist/vite/merge-config.js +106 -0
- package/dist/vite/merge-config.js.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts +15 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.js +76 -0
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.d.ts +7 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.js +48 -0
- package/dist/vite/plugins/dev-bundle-routing-plugin.js.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts +12 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.js +85 -0
- package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -0
- package/dist/vite/plugins/externals-plugin.d.ts +4 -0
- package/dist/vite/plugins/externals-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/externals-plugin.js +39 -0
- package/dist/vite/plugins/externals-plugin.js.map +1 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.d.ts +14 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.js +48 -0
- package/dist/vite/plugins/full-bundle-proxy-plugin.js.map +1 -0
- package/dist/vite/plugins/html-plugin.d.ts +5 -0
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/html-plugin.js +74 -0
- package/dist/vite/plugins/html-plugin.js.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +4 -0
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/ignore-modules-plugin.js +30 -0
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -0
- package/dist/vite/plugins/index.d.ts +10 -0
- package/dist/vite/plugins/index.d.ts.map +1 -0
- package/dist/vite/plugins/index.js +28 -0
- package/dist/vite/plugins/index.js.map +1 -0
- package/dist/vite/plugins/metadata-plugin.d.ts +4 -0
- package/dist/vite/plugins/metadata-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/metadata-plugin.js +86 -0
- package/dist/vite/plugins/metadata-plugin.js.map +1 -0
- package/dist/vite/plugins/outdir-rewrite-plugin.d.ts +9 -0
- package/dist/vite/plugins/outdir-rewrite-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/preview-static-files-plugin.d.ts +9 -0
- package/dist/vite/plugins/preview-static-files-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/preview-static-files-plugin.js +50 -0
- package/dist/vite/plugins/preview-static-files-plugin.js.map +1 -0
- package/dist/vite/plugins/shared-deps-dev-server-plugin.d.ts +11 -0
- package/dist/vite/plugins/shared-deps-dev-server-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.d.ts +10 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.js +51 -0
- package/dist/vite/plugins/shared-deps-rewrite-plugin.js.map +1 -0
- package/dist/vite/plugins/style-urls-plugin.d.ts +4 -0
- package/dist/vite/plugins/style-urls-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/style-urls-plugin.js +29 -0
- package/dist/vite/plugins/style-urls-plugin.js.map +1 -0
- package/dist/vite/plugins/svgr-plugin.d.ts +4 -0
- package/dist/vite/plugins/svgr-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/svgr-plugin.js +31 -0
- package/dist/vite/plugins/svgr-plugin.js.map +1 -0
- package/dist/vite/plugins/virtual-modules-plugin.d.ts +4 -0
- package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/virtual-modules-plugin.js +71 -0
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -0
- package/dist/webpack/configs/amd-config.d.ts +3 -2
- package/dist/webpack/configs/amd-config.d.ts.map +1 -1
- package/dist/webpack/configs/amd-config.js.map +1 -1
- package/dist/webpack/configs/cache-config.d.ts +3 -2
- package/dist/webpack/configs/cache-config.d.ts.map +1 -1
- package/dist/webpack/configs/cache-config.js +1 -1
- package/dist/webpack/configs/cache-config.js.map +1 -1
- package/dist/webpack/configs/dev-server-config.d.ts +3 -2
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +1 -1
- package/dist/webpack/configs/dev-server-config.js.map +1 -1
- package/dist/webpack/configs/devtool-config.d.ts +3 -2
- package/dist/webpack/configs/devtool-config.d.ts.map +1 -1
- package/dist/webpack/configs/devtool-config.js +1 -1
- package/dist/webpack/configs/devtool-config.js.map +1 -1
- package/dist/webpack/configs/entry.config.d.ts +3 -2
- package/dist/webpack/configs/entry.config.d.ts.map +1 -1
- package/dist/webpack/configs/entry.config.js +6 -5
- package/dist/webpack/configs/entry.config.js.map +1 -1
- package/dist/webpack/configs/externals-config.d.ts +3 -2
- package/dist/webpack/configs/externals-config.d.ts.map +1 -1
- package/dist/webpack/configs/externals-config.js +4 -14
- package/dist/webpack/configs/externals-config.js.map +1 -1
- package/dist/webpack/configs/index.d.ts +0 -1
- package/dist/webpack/configs/index.d.ts.map +1 -1
- package/dist/webpack/configs/index.js.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.d.ts +2 -2
- package/dist/webpack/configs/loaders/css-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/css-loader.js +2 -1
- package/dist/webpack/configs/loaders/css-loader.js.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.d.ts +2 -2
- package/dist/webpack/configs/loaders/style-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.js +4 -1
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/module-config.d.ts +3 -2
- package/dist/webpack/configs/module-config.d.ts.map +1 -1
- package/dist/webpack/configs/module-config.js.map +1 -1
- package/dist/webpack/configs/optimization-config.d.ts +3 -2
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +10 -7
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts +3 -2
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +15 -24
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts +3 -8
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +10 -47
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +6 -6
- package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +4 -13
- package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js +4 -12
- package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js +4 -6
- package/dist/webpack/configs/plugins/define-web-component-name-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/filter-warnings-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js +2 -2
- package/dist/webpack/configs/plugins/filter-warnings-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/html-plugin.js +5 -2
- package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/html-tags-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/html-tags-plugin.js +8 -19
- package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts +17 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +45 -6
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +4 -2
- package/dist/webpack/configs/plugins/mini-css-extract-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js +1 -1
- package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts +3 -3
- package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js +13 -56
- package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts +3 -2
- package/dist/webpack/configs/plugins/watch-run-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/watch-run-plugin.js.map +1 -1
- package/dist/webpack/configs/plugins-config.d.ts +3 -2
- package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
- package/dist/webpack/configs/plugins-config.js.map +1 -1
- package/dist/webpack/configs/resolve-config.d.ts +3 -2
- package/dist/webpack/configs/resolve-config.d.ts.map +1 -1
- package/dist/webpack/configs/resolve-config.js.map +1 -1
- package/dist/webpack/configs/rules/css-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/css-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/css-rules.js +2 -1
- package/dist/webpack/configs/rules/css-rules.js.map +1 -1
- package/dist/webpack/configs/rules/font-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/font-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/font-rules.js.map +1 -1
- package/dist/webpack/configs/rules/image-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/image-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/image-rules.js.map +1 -1
- package/dist/webpack/configs/rules/js-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/js-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/js-rules.js +3 -1
- package/dist/webpack/configs/rules/js-rules.js.map +1 -1
- package/dist/webpack/configs/rules/less-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/less-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/less-rules.js.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/scss-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/scss-rules.js.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.d.ts +2 -2
- package/dist/webpack/configs/rules/svg-rules.d.ts.map +1 -1
- package/dist/webpack/configs/rules/svg-rules.js.map +1 -1
- package/dist/webpack/configs/rules-config.d.ts +3 -2
- package/dist/webpack/configs/rules-config.d.ts.map +1 -1
- package/dist/webpack/configs/rules-config.js +2 -2
- package/dist/webpack/configs/rules-config.js.map +1 -1
- package/dist/webpack/configs/stats-config.d.ts +3 -2
- package/dist/webpack/configs/stats-config.d.ts.map +1 -1
- package/dist/webpack/configs/stats-config.js.map +1 -1
- package/dist/webpack/configs/watch-options-config.d.ts +2 -2
- package/dist/webpack/configs/watch-options-config.d.ts.map +1 -1
- package/dist/webpack/configs/watch-options-config.js +2 -2
- package/dist/webpack/configs/watch-options-config.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts +10 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +109 -41
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/types.d.ts +4 -11
- package/dist/webpack/types.d.ts.map +1 -1
- package/dist/webpack/utils/index.d.ts +0 -1
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +0 -1
- package/dist/webpack/utils/index.js.map +1 -1
- package/package.json +13 -10
- package/patches/vite-plugin-css-injected-by-js+3.5.2.patch +63 -0
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +3 -4
- package/src/cli/commands/build.ts +7 -2
- package/src/cli/commands/bundle-vite.ts +112 -0
- package/src/cli/commands/get-command.ts +2 -0
- package/src/cli/commands/mfe-check.ts +1 -2
- package/src/cli/commands/mfe-generate-metadata.ts +1 -1
- package/src/cli/commands/mfe-package-publish.ts +1 -1
- package/src/cli/commands/start.ts +5 -2
- package/src/cli/utils/__tests__/bundle.test.ts +19 -10
- package/src/cli/utils/bundle.ts +20 -101
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/check-resource.test.ts +18 -5
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/check-resource.ts +4 -4
- package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.ts +2 -2
- package/src/core/check-resource/index.ts +1 -0
- package/src/core/context.ts +65 -0
- package/src/core/defines/exposed-dependencies.ts +21 -0
- package/src/core/defines/exposed-instance-dependencies.ts +19 -0
- package/src/core/defines/index.ts +3 -0
- package/src/core/defines/web-component-name.ts +15 -0
- package/src/core/externals.ts +23 -0
- package/src/core/get-exposed-dependencies-entry-points.ts +59 -0
- package/src/core/index.ts +8 -0
- package/src/core/types.ts +59 -0
- package/src/{webpack/configs → core}/utils/__tests__/build-metadata.test.ts +2 -2
- package/src/{webpack/configs → core}/utils/__tests__/generate-metadata.test.ts +27 -13
- package/src/{webpack/configs → core}/utils/build-metadata.ts +1 -1
- package/src/{webpack/configs → core}/utils/generate-metadata.ts +7 -6
- package/src/core/utils/get-bundle-type.ts +20 -0
- package/src/{webpack/configs → core}/utils/get-launchdarkly-sdk-version.ts +1 -1
- package/src/core/utils/get-output-path.ts +18 -0
- package/src/{webpack/configs → core}/utils/get-web-components-version.ts +1 -1
- package/src/core/utils/index.ts +8 -0
- package/src/core/virtual-modules.ts +76 -0
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -2
- package/src/storybook-config/webpack-final.ts +24 -10
- package/src/utils/__tests__/get-configuration.test.ts +99 -1
- package/src/utils/__tests__/get-package-data.test.ts +35 -1
- package/src/utils/get-configuration.ts +92 -1
- package/src/utils/get-package-data.ts +3 -1
- package/src/vite/__tests__/define-config.test.ts +13 -0
- package/src/vite/__tests__/load-config-file.test.ts +115 -0
- package/src/vite/__tests__/merge-config.test.ts +173 -0
- package/src/vite/base-config.ts +70 -0
- package/src/vite/build-shared-deps.ts +320 -0
- package/src/vite/create-vite-config.ts +50 -0
- package/src/vite/define-config.ts +20 -0
- package/src/vite/index.html +29 -0
- package/src/vite/load-config-file.ts +54 -0
- package/src/vite/merge-config.ts +93 -0
- package/src/vite/plugins/css-injector-plugin.ts +85 -0
- package/src/vite/plugins/dev-server-routing-plugin.ts +89 -0
- package/src/vite/plugins/externals-plugin.ts +27 -0
- package/src/vite/plugins/html-plugin.ts +65 -0
- package/src/vite/plugins/ignore-modules-plugin.ts +22 -0
- package/src/vite/plugins/index.ts +9 -0
- package/src/vite/plugins/metadata-plugin.ts +78 -0
- package/src/vite/plugins/style-urls-plugin.ts +34 -0
- package/src/vite/plugins/svgr-plugin.ts +11 -0
- package/src/vite/plugins/virtual-modules-plugin.ts +74 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +2 -2
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +11 -11
- package/src/webpack/__tests__/create-webpack-config.test.ts +3 -2
- package/src/webpack/configs/amd-config.ts +3 -2
- package/src/webpack/configs/cache-config.ts +4 -3
- package/src/webpack/configs/dev-server-config.ts +8 -3
- package/src/webpack/configs/devtool-config.ts +4 -3
- package/src/webpack/configs/entry.config.ts +8 -7
- package/src/webpack/configs/externals-config.ts +5 -21
- package/src/webpack/configs/index.ts +0 -1
- package/src/webpack/configs/loaders/css-loader.ts +3 -2
- package/src/webpack/configs/loaders/style-loader.ts +5 -5
- package/src/webpack/configs/module-config.ts +3 -2
- package/src/webpack/configs/optimization-config.ts +16 -11
- package/src/webpack/configs/output-config.ts +16 -22
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +9 -36
- package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +8 -8
- package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +7 -15
- package/src/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.ts +7 -13
- package/src/webpack/configs/plugins/define-web-component-name-plugin.ts +7 -8
- package/src/webpack/configs/plugins/filter-warnings-plugin.ts +4 -3
- package/src/webpack/configs/plugins/html-plugin.ts +7 -6
- package/src/webpack/configs/plugins/html-tags-plugin.ts +7 -16
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.js +1 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +48 -6
- package/src/webpack/configs/plugins/mini-css-extract-plugin.ts +10 -5
- package/src/webpack/configs/plugins/moment-locales-plugin.ts +3 -2
- package/src/webpack/configs/plugins/remove-empty-scripts-plugin.ts +4 -3
- package/src/webpack/configs/plugins/virtual-modules-plugin.ts +13 -65
- package/src/webpack/configs/plugins/watch-run-plugin.ts +3 -2
- package/src/webpack/configs/plugins-config.ts +3 -2
- package/src/webpack/configs/resolve-config.ts +3 -2
- package/src/webpack/configs/rules/css-rules.ts +4 -3
- package/src/webpack/configs/rules/font-rules.ts +2 -2
- package/src/webpack/configs/rules/image-rules.ts +2 -2
- package/src/webpack/configs/rules/js-rules.ts +4 -2
- package/src/webpack/configs/rules/less-rules.ts +2 -2
- package/src/webpack/configs/rules/scss-rules.ts +2 -2
- package/src/webpack/configs/rules/svg-rules.ts +2 -2
- package/src/webpack/configs/rules-config.ts +9 -5
- package/src/webpack/configs/stats-config.ts +3 -2
- package/src/webpack/configs/watch-options-config.ts +3 -3
- package/src/webpack/create-webpack-config.ts +88 -43
- package/src/webpack/types.ts +7 -11
- package/src/webpack/utils/index.ts +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +0 -3
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.d.ts.map +0 -1
- package/dist/webpack/configs/types.d.ts +0 -35
- package/dist/webpack/configs/types.d.ts.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/generate-metadata.d.ts +0 -3
- package/dist/webpack/configs/utils/generate-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-bundle-type.d.ts +0 -3
- package/dist/webpack/configs/utils/get-bundle-type.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/index.d.ts +0 -4
- package/dist/webpack/configs/utils/index.d.ts.map +0 -1
- package/src/webpack/configs/types.ts +0 -38
- package/src/webpack/configs/utils/get-bundle-type.ts +0 -22
- package/src/webpack/configs/utils/index.ts +0 -3
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.d.ts +0 -0
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-peer-dependency.d.ts +0 -0
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-react-dom-peer-dependency.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/build-metadata.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/get-exposed-dependencies.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/get-launchdarkly-sdk-version.d.ts +0 -0
- /package/dist/{webpack/configs → core}/utils/get-web-components-version.d.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/get-package-json.test.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/is-optional-peer-dependency.test.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/__tests__/is-optional-react-dom-peer-dependency.test.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-peer-dependency.ts +0 -0
- /package/src/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-react-dom-peer-dependency.ts +0 -0
- /package/src/{webpack/configs → core}/utils/__tests__/get-exposed-dependencies.test.ts +0 -0
- /package/src/{webpack/configs → core}/utils/__tests__/get-launchdarkly-sdk-version.test.ts +0 -0
- /package/src/{webpack/configs → core}/utils/__tests__/get-web-components-version.test.ts +0 -0
- /package/src/{webpack/configs → core}/utils/get-exposed-dependencies.ts +0 -0
- /package/src/{webpack → core}/utils/stringify-config.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "34.
|
|
3
|
+
"version": "34.3.0-beta.0",
|
|
4
4
|
"description": "CLI to create multi-package Lerna projects with TypeScript and React",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/uikit/startup",
|
|
6
6
|
"repository": {
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"@jest/core": "~30.2.0",
|
|
57
57
|
"@jest/types": "~30.2.0",
|
|
58
58
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
59
|
-
"@servicetitan/eslint-config": "34.
|
|
60
|
-
"@servicetitan/install": "34.
|
|
61
|
-
"@servicetitan/startup-utils": "34.
|
|
62
|
-
"@servicetitan/stylelint-config": "34.
|
|
59
|
+
"@servicetitan/eslint-config": "34.3.0-beta.0",
|
|
60
|
+
"@servicetitan/install": "34.3.0-beta.0",
|
|
61
|
+
"@servicetitan/startup-utils": "34.3.0-beta.0",
|
|
62
|
+
"@servicetitan/stylelint-config": "34.3.0-beta.0",
|
|
63
63
|
"@svgr/webpack": "^8.1.0",
|
|
64
64
|
"@swc/cli": "^0.5.0",
|
|
65
|
-
"@swc/core": "1.15.
|
|
65
|
+
"@swc/core": "1.15.18",
|
|
66
66
|
"@types/debug": "^4.1.12",
|
|
67
67
|
"@types/jest": "~30.0.0",
|
|
68
68
|
"@vitest/coverage-v8": "^4.0.18",
|
|
@@ -85,10 +85,11 @@
|
|
|
85
85
|
"jest-environment-jsdom": "^30.2.0",
|
|
86
86
|
"jest-fetch-mock": "~3.0.3",
|
|
87
87
|
"json5": "^2.2.3",
|
|
88
|
-
"lerna": "~9.0.
|
|
88
|
+
"lerna": "~9.0.5",
|
|
89
89
|
"less": "~4.5.1",
|
|
90
90
|
"less-loader": "~12.3.1",
|
|
91
91
|
"less-plugin-npm-import": "~2.1.0",
|
|
92
|
+
"eta": "^3.5.0",
|
|
92
93
|
"lodash.kebabcase": "^4.1.1",
|
|
93
94
|
"lodash.memoize": "^4.1.2",
|
|
94
95
|
"memfs": "~4.56.10",
|
|
@@ -111,7 +112,10 @@
|
|
|
111
112
|
"ts-node": "~10.9.2",
|
|
112
113
|
"typed-css-modules": "~0.9.1",
|
|
113
114
|
"typescript": "5.9.3",
|
|
114
|
-
"
|
|
115
|
+
"vite": "^8.0.0",
|
|
116
|
+
"vite-plugin-css-injected-by-js": "^4.0.1",
|
|
117
|
+
"vite-plugin-svgr": "^4.5.0",
|
|
118
|
+
"vitest": "^4.1.0",
|
|
115
119
|
"webpack": "~5.105.2",
|
|
116
120
|
"webpack-assets-manifest": "~6.5.0",
|
|
117
121
|
"webpack-bundle-analyzer": "^5.2.0",
|
|
@@ -143,6 +147,5 @@
|
|
|
143
147
|
},
|
|
144
148
|
"cli": {
|
|
145
149
|
"webpack": false
|
|
146
|
-
}
|
|
147
|
-
"gitHead": "6de619a1f399b1cba23012e60155830b0e7f4777"
|
|
150
|
+
}
|
|
148
151
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
diff --git a/node_modules/vite-plugin-css-injected-by-js/dist/cjs/index.js b/node_modules/vite-plugin-css-injected-by-js/dist/cjs/index.js
|
|
2
|
+
index 64d0da7..8367087 100644
|
|
3
|
+
--- a/node_modules/vite-plugin-css-injected-by-js/dist/cjs/index.js
|
|
4
|
+
+++ b/node_modules/vite-plugin-css-injected-by-js/dist/cjs/index.js
|
|
5
|
+
@@ -113,16 +113,16 @@ function cssInjectedByJsPlugin({ cssAssetsFilterFunction, dev: { enableDev, remo
|
|
6
|
+
}`;
|
|
7
|
+
let removeStyleFunction = removeStyleCode || defaultRemoveStyleCode;
|
|
8
|
+
if (removeStyleCodeFunction) {
|
|
9
|
+
- removeStyleFunction = (id) => `(${removeStyleCodeFunction})("${id}")`;
|
|
10
|
+
+ removeStyleFunction = (id, styleId) => `(${removeStyleCodeFunction})("${id}", "${styleId}")`;
|
|
11
|
+
}
|
|
12
|
+
// removeStyleFunction is called before since the function that inject the CSS doesn't handle the update case required in dev mode.
|
|
13
|
+
let injectionCode = src.replace('__vite__updateStyle(__vite__id, __vite__css)', ';\n' +
|
|
14
|
+
- removeStyleFunction(id) +
|
|
15
|
+
+ removeStyleFunction(id, styleId) +
|
|
16
|
+
';\n' +
|
|
17
|
+
(0, utils_js_1.resolveInjectionCode)('__vite__css', injectCode, injectCodeFunction, {
|
|
18
|
+
- attributes: { type: 'text/css', ['data-vite-dev-id']: id },
|
|
19
|
+
+ attributes: { type: 'text/css', ['data-vite-dev-id']: id }, styleId: styleId,
|
|
20
|
+
}));
|
|
21
|
+
- injectionCode = injectionCode.replace('__vite__removeStyle(__vite__id)', removeStyleFunction(id));
|
|
22
|
+
+ injectionCode = injectionCode.replace('__vite__removeStyle(__vite__id)', removeStyleFunction(id, styleId));
|
|
23
|
+
return {
|
|
24
|
+
code: injectionCode,
|
|
25
|
+
map: null,
|
|
26
|
+
diff --git a/node_modules/vite-plugin-css-injected-by-js/dist/esm/declarations/interface.d.ts b/node_modules/vite-plugin-css-injected-by-js/dist/esm/declarations/interface.d.ts
|
|
27
|
+
index 572ff1e..6a7a99e 100644
|
|
28
|
+
--- a/node_modules/vite-plugin-css-injected-by-js/dist/esm/declarations/interface.d.ts
|
|
29
|
+
+++ b/node_modules/vite-plugin-css-injected-by-js/dist/esm/declarations/interface.d.ts
|
|
30
|
+
@@ -5,7 +5,7 @@ import type { ModuleFormat } from 'rollup';
|
|
31
|
+
export interface DevOptions {
|
|
32
|
+
enableDev?: boolean;
|
|
33
|
+
removeStyleCode?: (id: string) => string;
|
|
34
|
+
- removeStyleCodeFunction?: (id: string) => void;
|
|
35
|
+
+ removeStyleCodeFunction?: (id: string, styleId: string) => void;
|
|
36
|
+
}
|
|
37
|
+
export interface BaseOptions {
|
|
38
|
+
dev?: DevOptions;
|
|
39
|
+
diff --git a/node_modules/vite-plugin-css-injected-by-js/dist/esm/index.js b/node_modules/vite-plugin-css-injected-by-js/dist/esm/index.js
|
|
40
|
+
index 0f21901..27a1692 100644
|
|
41
|
+
--- a/node_modules/vite-plugin-css-injected-by-js/dist/esm/index.js
|
|
42
|
+
+++ b/node_modules/vite-plugin-css-injected-by-js/dist/esm/index.js
|
|
43
|
+
@@ -100,16 +100,16 @@ export default function cssInjectedByJsPlugin({ cssAssetsFilterFunction, dev: {
|
|
44
|
+
}`;
|
|
45
|
+
let removeStyleFunction = removeStyleCode || defaultRemoveStyleCode;
|
|
46
|
+
if (removeStyleCodeFunction) {
|
|
47
|
+
- removeStyleFunction = (id) => `(${removeStyleCodeFunction})("${id}")`;
|
|
48
|
+
+ removeStyleFunction = (id, styleId) => `(${removeStyleCodeFunction})("${id}", "${styleId}")`;
|
|
49
|
+
}
|
|
50
|
+
// removeStyleFunction is called before since the function that inject the CSS doesn't handle the update case required in dev mode.
|
|
51
|
+
let injectionCode = src.replace('__vite__updateStyle(__vite__id, __vite__css)', ';\n' +
|
|
52
|
+
- removeStyleFunction(id) +
|
|
53
|
+
+ removeStyleFunction(id, styleId) +
|
|
54
|
+
';\n' +
|
|
55
|
+
resolveInjectionCode('__vite__css', injectCode, injectCodeFunction, {
|
|
56
|
+
- attributes: { type: 'text/css', ['data-vite-dev-id']: id },
|
|
57
|
+
+ attributes: { type: 'text/css', ['data-vite-dev-id']: id, styleId: styleId },
|
|
58
|
+
}));
|
|
59
|
+
- injectionCode = injectionCode.replace('__vite__removeStyle(__vite__id)', removeStyleFunction(id));
|
|
60
|
+
+ injectionCode = injectionCode.replace('__vite__removeStyle(__vite__id)', removeStyleFunction(id, styleId));
|
|
61
|
+
return {
|
|
62
|
+
code: injectionCode,
|
|
63
|
+
map: null,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { fs, vol } from 'memfs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { getLaunchDarklySdkVersion, getWebComponentsVersion } from '../../../core';
|
|
3
4
|
import { getPackageData, getStartupVersion, loadSharedDependencies, log } from '../../../utils';
|
|
4
|
-
import { getLaunchDarklySdkVersion } from '../../../webpack/configs/utils/get-launchdarkly-sdk-version';
|
|
5
|
-
import { getWebComponentsVersion } from '../../../webpack/configs/utils/get-web-components-version';
|
|
6
5
|
import { MfeGenerateMetadata } from '../mfe-generate-metadata';
|
|
7
6
|
|
|
8
7
|
jest.mock('fs', () => fs);
|
|
@@ -10,13 +9,13 @@ jest.mock('../../../utils', () => ({
|
|
|
10
9
|
...jest.requireActual('../../../utils'),
|
|
11
10
|
log: { info: jest.fn() },
|
|
12
11
|
}));
|
|
13
|
-
jest.mock('../../../
|
|
12
|
+
jest.mock('../../../core/utils/get-web-components-version', () => ({
|
|
14
13
|
getWebComponentsVersion: jest.fn(() => '1.0.0'),
|
|
15
14
|
}));
|
|
16
15
|
jest.mock('../../../utils/get-startup-version', () => ({
|
|
17
16
|
getStartupVersion: jest.fn(() => '33.0.0'),
|
|
18
17
|
}));
|
|
19
|
-
jest.mock('../../../
|
|
18
|
+
jest.mock('../../../core/utils/get-launchdarkly-sdk-version', () => ({
|
|
20
19
|
getLaunchDarklySdkVersion: jest.fn(() => '3.4.5'),
|
|
21
20
|
}));
|
|
22
21
|
|
|
@@ -8,9 +8,11 @@ const options = {
|
|
|
8
8
|
codeCoverage: { boolean: true, description: 'Instrument code for coverage analysis?' },
|
|
9
9
|
config: { string: true, hidden: true, description: 'Use specified configuration' },
|
|
10
10
|
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
11
|
+
preview: { boolean: true, description: 'Start preview server after build?' },
|
|
11
12
|
scope: { array: true, string: true, description: 'Packages to build' },
|
|
12
13
|
stat: { boolean: true, description: 'Generate bundle report?' },
|
|
13
14
|
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
15
|
+
useVite: { boolean: true, description: 'Use Vite to bundle packages?' },
|
|
14
16
|
} satisfies CommandOptions;
|
|
15
17
|
|
|
16
18
|
enum BuildProcesses {
|
|
@@ -33,6 +35,8 @@ export class Build extends Command<typeof options> {
|
|
|
33
35
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
34
36
|
|
|
35
37
|
const useTsc = this.args.useTsc;
|
|
38
|
+
const useVite = this.args.useVite;
|
|
39
|
+
const cmd = useVite ? 'startup bundle-vite' : 'startup bundle-package';
|
|
36
40
|
|
|
37
41
|
const packages = getPackages({
|
|
38
42
|
scope: this.args.scope,
|
|
@@ -89,7 +93,7 @@ export class Build extends Command<typeof options> {
|
|
|
89
93
|
return Promise.resolve();
|
|
90
94
|
}
|
|
91
95
|
return lernaExec({
|
|
92
|
-
|
|
96
|
+
cmd,
|
|
93
97
|
'scope': webpackScope,
|
|
94
98
|
'parallel': true,
|
|
95
99
|
'stream': true,
|
|
@@ -112,13 +116,14 @@ export class Build extends Command<typeof options> {
|
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
return lernaExec({
|
|
115
|
-
|
|
119
|
+
cmd,
|
|
116
120
|
'scope': webpackScope,
|
|
117
121
|
'stream': true,
|
|
118
122
|
'--': [
|
|
119
123
|
...[this.args.config ? `--config "${this.args.config}"` : undefined],
|
|
120
124
|
...[this.args.codeCoverage ? '--code-coverage' : undefined],
|
|
121
125
|
...[this.args.stat ? '--stat' : undefined],
|
|
126
|
+
...[useVite && this.args.preview ? '--preview' : undefined],
|
|
122
127
|
].filter(item => !!item) as string[],
|
|
123
128
|
});
|
|
124
129
|
},
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { build, createServer, preview as previewServer } from 'vite';
|
|
2
|
+
import { CreateBuildContextInput, getName, stringifyConfig } from '../../core';
|
|
3
|
+
import {
|
|
4
|
+
hasHeadlessBundle,
|
|
5
|
+
isExposeSharedDependencies,
|
|
6
|
+
isWebComponent,
|
|
7
|
+
log,
|
|
8
|
+
logErrors,
|
|
9
|
+
validateSharedDependenciesConsistency,
|
|
10
|
+
validateSharedDependenciesMigration,
|
|
11
|
+
} from '../../utils';
|
|
12
|
+
import { buildSharedDeps } from '../../vite/build-shared-deps';
|
|
13
|
+
import { createViteConfig } from '../../vite/create-vite-config';
|
|
14
|
+
import { Command, CommandOptions } from './types';
|
|
15
|
+
|
|
16
|
+
const options = {
|
|
17
|
+
codeCoverage: { boolean: true, hidden: true },
|
|
18
|
+
exposedDependencies: { boolean: true, hidden: true },
|
|
19
|
+
preview: { boolean: true, hidden: true },
|
|
20
|
+
printConfig: { boolean: true, hidden: true },
|
|
21
|
+
stat: { boolean: true, hidden: true },
|
|
22
|
+
useWatchConfig: { boolean: true, hidden: true },
|
|
23
|
+
watch: { boolean: true, hidden: true },
|
|
24
|
+
} satisfies CommandOptions;
|
|
25
|
+
|
|
26
|
+
export class BundleVite extends Command<typeof options> {
|
|
27
|
+
static readonly options = options;
|
|
28
|
+
@logErrors
|
|
29
|
+
async execute() {
|
|
30
|
+
validateSharedDependenciesConsistency();
|
|
31
|
+
validateSharedDependenciesMigration();
|
|
32
|
+
|
|
33
|
+
const { preview = false, useWatchConfig = false, watch = false } = this.args;
|
|
34
|
+
const isProduction = !(watch || useWatchConfig);
|
|
35
|
+
|
|
36
|
+
const baseInput: CreateBuildContextInput = {
|
|
37
|
+
name: getName(),
|
|
38
|
+
isProduction,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
if (this.args.printConfig) {
|
|
42
|
+
const config = await createViteConfig(baseInput);
|
|
43
|
+
log.text(stringifyConfig(config));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (this.args.exposedDependencies) {
|
|
48
|
+
if (watch) {
|
|
49
|
+
throw new Error('cannot bundle exposed dependencies in watch mode');
|
|
50
|
+
}
|
|
51
|
+
if (!isExposeSharedDependencies()) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await buildSharedDeps(baseInput);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (isWebComponent()) {
|
|
59
|
+
if (watch) {
|
|
60
|
+
/*
|
|
61
|
+
* Start dev servers sequentially to avoid I/O contention during startup.
|
|
62
|
+
* Full first — it serves metadata.json and the standalone MFE dev page.
|
|
63
|
+
*/
|
|
64
|
+
await buildAndServe(baseInput, { watch, preview });
|
|
65
|
+
await buildAndServe({ ...baseInput, light: true }, { watch });
|
|
66
|
+
if (hasHeadlessBundle()) {
|
|
67
|
+
await buildAndServe({ ...baseInput, headless: true }, { watch });
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
// TODO: test if sequential is faster
|
|
71
|
+
await Promise.all([
|
|
72
|
+
buildAndServe(baseInput, { watch, preview }),
|
|
73
|
+
buildAndServe({ ...baseInput, light: true }, { watch }),
|
|
74
|
+
hasHeadlessBundle() &&
|
|
75
|
+
buildAndServe({ ...baseInput, headless: true }, { watch }),
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
await buildAndServe(baseInput, { watch, preview });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function buildAndServe(
|
|
87
|
+
input: CreateBuildContextInput,
|
|
88
|
+
{ watch, preview = false }: { watch: boolean; preview?: boolean }
|
|
89
|
+
): Promise<void> {
|
|
90
|
+
const config = await createViteConfig(input);
|
|
91
|
+
|
|
92
|
+
// TODO: look into isDevServerDisabled webpack's counterpart
|
|
93
|
+
if (watch) {
|
|
94
|
+
await serve(config);
|
|
95
|
+
} else {
|
|
96
|
+
await build(config);
|
|
97
|
+
|
|
98
|
+
if (preview) {
|
|
99
|
+
await serve({ ...config, preview: { port: config.server?.port, open: true } }, true);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function serve(config: import('vite').InlineConfig, preview = false) {
|
|
105
|
+
const server = preview ? await previewServer(config) : await createServer(config);
|
|
106
|
+
if ('listen' in server) {
|
|
107
|
+
await server.listen();
|
|
108
|
+
}
|
|
109
|
+
server.printUrls();
|
|
110
|
+
server.bindCLIShortcuts({ print: true });
|
|
111
|
+
return server;
|
|
112
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommandName } from '../../utils';
|
|
2
2
|
import { Build } from './build';
|
|
3
3
|
import { BundlePackage } from './bundle-package';
|
|
4
|
+
import { BundleVite } from './bundle-vite';
|
|
4
5
|
import { Clean } from './clean';
|
|
5
6
|
import { ConvertEslintConfig } from './convert-eslint-config';
|
|
6
7
|
import { ESLintCommand } from './eslint';
|
|
@@ -28,6 +29,7 @@ import { UploadSourcemaps } from './upload-sourcemaps';
|
|
|
28
29
|
const commands: Record<CommandName, Newable<Command>> = {
|
|
29
30
|
[CommandName.build]: Build,
|
|
30
31
|
[CommandName['bundle-package']]: BundlePackage,
|
|
32
|
+
[CommandName['bundle-vite']]: BundleVite,
|
|
31
33
|
[CommandName['convert-eslint-config']]: ConvertEslintConfig,
|
|
32
34
|
[CommandName.clean]: Clean,
|
|
33
35
|
[CommandName.eslint]: ESLintCommand,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getVersionMismatches } from '@servicetitan/startup-utils';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { getExposedDependencies, Metadata } from '../../core';
|
|
3
4
|
import {
|
|
4
5
|
isWebComponent,
|
|
5
6
|
loadSharedDependencies,
|
|
@@ -8,8 +9,6 @@ import {
|
|
|
8
9
|
readJson,
|
|
9
10
|
toArray,
|
|
10
11
|
} from '../../utils';
|
|
11
|
-
import { Metadata } from '../../webpack/configs/types';
|
|
12
|
-
import { getExposedDependencies } from '../../webpack/configs/utils';
|
|
13
12
|
import { Command, CommandOptions } from './types';
|
|
14
13
|
|
|
15
14
|
interface HostPackageJSON {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { buildMetadata } from '../../core';
|
|
3
4
|
import {
|
|
4
5
|
getFolders,
|
|
5
6
|
getPackageData,
|
|
@@ -9,7 +10,6 @@ import {
|
|
|
9
10
|
log,
|
|
10
11
|
logErrors,
|
|
11
12
|
} from '../../utils';
|
|
12
|
-
import { buildMetadata } from '../../webpack/configs/utils/build-metadata';
|
|
13
13
|
import { Command, CommandOptions } from './types';
|
|
14
14
|
|
|
15
15
|
const options = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { EntryPoint, EntryPoints, Metadata } from '../../core';
|
|
3
4
|
import {
|
|
4
5
|
getBranchesConfigs,
|
|
5
6
|
getFolders,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
logErrors,
|
|
9
10
|
readJson,
|
|
10
11
|
} from '../../utils';
|
|
11
|
-
import { EntryPoint, EntryPoints, Metadata } from '../../webpack/configs';
|
|
12
12
|
import {
|
|
13
13
|
DRY_RUN_PREFIX,
|
|
14
14
|
getDefaultBuildVersion,
|
|
@@ -16,6 +16,7 @@ const options = {
|
|
|
16
16
|
ignore: { array: true, string: true, description: 'Packages to skip' },
|
|
17
17
|
scope: { array: true, string: true, description: 'Packages to run and watch' },
|
|
18
18
|
useTsc: { boolean: true, description: 'Use tsc to compile packages?' },
|
|
19
|
+
useVite: { boolean: true, description: 'Use Vite to bundle packages?' },
|
|
19
20
|
} satisfies CommandOptions;
|
|
20
21
|
|
|
21
22
|
enum StartProcesses {
|
|
@@ -39,6 +40,8 @@ export class Start extends Command<typeof options> {
|
|
|
39
40
|
checkArgs(this.args, { obsolete: ['--esbuild', '--experimental-bundlers'] });
|
|
40
41
|
|
|
41
42
|
const useTsc = this.args.useTsc;
|
|
43
|
+
const useVite = this.args.useVite;
|
|
44
|
+
const cmd = useVite ? 'startup bundle-vite' : 'startup bundle-package';
|
|
42
45
|
|
|
43
46
|
const packages = getPackages({
|
|
44
47
|
scope: this.args.scope,
|
|
@@ -151,7 +154,7 @@ export class Start extends Command<typeof options> {
|
|
|
151
154
|
return Promise.resolve();
|
|
152
155
|
}
|
|
153
156
|
return lernaExec({
|
|
154
|
-
|
|
157
|
+
cmd,
|
|
155
158
|
'scope': webpackScope,
|
|
156
159
|
'parallel': true,
|
|
157
160
|
'stream': true,
|
|
@@ -167,7 +170,7 @@ export class Start extends Command<typeof options> {
|
|
|
167
170
|
return Promise.resolve();
|
|
168
171
|
}
|
|
169
172
|
return lernaExec({
|
|
170
|
-
|
|
173
|
+
cmd,
|
|
171
174
|
'scope': webpackScope,
|
|
172
175
|
'parallel': true,
|
|
173
176
|
'stream': true,
|
|
@@ -12,8 +12,12 @@ import {
|
|
|
12
12
|
isExposeSharedDependencies,
|
|
13
13
|
loadSharedDependencies,
|
|
14
14
|
} from '../../../utils';
|
|
15
|
-
import { createWebpackConfig } from '../../../webpack';
|
|
16
|
-
import {
|
|
15
|
+
import { createWebpackConfig, createWebpackConfigs } from '../../../webpack';
|
|
16
|
+
import {
|
|
17
|
+
webpackDevConfigFileName,
|
|
18
|
+
webpackProdConfigFileName,
|
|
19
|
+
} from '../../../webpack/create-webpack-config';
|
|
20
|
+
import { bundle } from '../bundle';
|
|
17
21
|
|
|
18
22
|
jest.mock('fs', () => fs);
|
|
19
23
|
jest.mock('portfinder');
|
|
@@ -24,11 +28,16 @@ jest.mock('../../../utils', () => ({
|
|
|
24
28
|
getFolders: jest.fn(),
|
|
25
29
|
getPackageData: jest.fn(),
|
|
26
30
|
hasHeadlessBundle: jest.fn(),
|
|
31
|
+
isDevServerDisabled: jest.fn(),
|
|
27
32
|
isExposeSharedDependencies: jest.fn(),
|
|
33
|
+
isWebComponent: jest.fn(),
|
|
28
34
|
loadSharedDependencies: jest.fn(),
|
|
29
35
|
log: { info: jest.fn(), debug: jest.fn() }, // suppress test output
|
|
30
36
|
}));
|
|
31
|
-
jest.mock('../../../webpack', () => ({
|
|
37
|
+
jest.mock('../../../webpack', () => ({
|
|
38
|
+
createWebpackConfig: jest.fn(),
|
|
39
|
+
createWebpackConfigs: jest.fn(),
|
|
40
|
+
}));
|
|
32
41
|
|
|
33
42
|
describe('[startup] Cli Utils', () => {
|
|
34
43
|
const pkg = createPackage({});
|
|
@@ -37,7 +46,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
37
46
|
|
|
38
47
|
beforeEach(() => {
|
|
39
48
|
jest.resetAllMocks();
|
|
40
|
-
jest.mocked(
|
|
49
|
+
jest.mocked(createWebpackConfigs).mockReturnValue([createWebpackResult]);
|
|
41
50
|
jest.mocked(webpack).mockImplementation((): any => compiler);
|
|
42
51
|
jest.mocked(getPortPromise).mockImplementation(options =>
|
|
43
52
|
Promise.resolve(options?.port ?? 0)
|
|
@@ -293,7 +302,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
293
302
|
};
|
|
294
303
|
});
|
|
295
304
|
|
|
296
|
-
test('builds full and
|
|
305
|
+
test('builds full and light packages', async () => {
|
|
297
306
|
await subject();
|
|
298
307
|
|
|
299
308
|
expect(createWebpackConfig).toHaveBeenCalledWith(
|
|
@@ -302,7 +311,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
302
311
|
);
|
|
303
312
|
expect(createWebpackConfig).toHaveBeenCalledWith(defaultCreateOverrides, {
|
|
304
313
|
...defaultCreateOptions,
|
|
305
|
-
|
|
314
|
+
light: true,
|
|
306
315
|
});
|
|
307
316
|
expect(compiler.run).toHaveBeenCalledTimes(2);
|
|
308
317
|
});
|
|
@@ -339,7 +348,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
339
348
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, createOptions);
|
|
340
349
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, {
|
|
341
350
|
...createOptions,
|
|
342
|
-
|
|
351
|
+
light: true,
|
|
343
352
|
});
|
|
344
353
|
});
|
|
345
354
|
}
|
|
@@ -526,7 +535,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
526
535
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, options);
|
|
527
536
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, {
|
|
528
537
|
...options,
|
|
529
|
-
|
|
538
|
+
light: true,
|
|
530
539
|
});
|
|
531
540
|
expect(webpack).toHaveBeenNthCalledWith(1, createWebpackResult);
|
|
532
541
|
expect(webpack).toHaveBeenNthCalledWith(2, createWebpackResult);
|
|
@@ -568,7 +577,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
568
577
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, options);
|
|
569
578
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, {
|
|
570
579
|
...options,
|
|
571
|
-
|
|
580
|
+
light: true,
|
|
572
581
|
});
|
|
573
582
|
expect(WebpackDevServer).not.toHaveBeenCalled();
|
|
574
583
|
});
|
|
@@ -588,7 +597,7 @@ describe('[startup] Cli Utils', () => {
|
|
|
588
597
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, options);
|
|
589
598
|
expect(createWebpackConfig).toHaveBeenCalledWith(overrides, {
|
|
590
599
|
...options,
|
|
591
|
-
|
|
600
|
+
light: true,
|
|
592
601
|
});
|
|
593
602
|
});
|
|
594
603
|
}
|
package/src/cli/utils/bundle.ts
CHANGED
|
@@ -1,44 +1,21 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
1
|
import { getPortPromise } from 'portfinder';
|
|
5
2
|
import webpack, { Configuration } from 'webpack';
|
|
6
3
|
import WebpackDevServer from 'webpack-dev-server';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
hasHeadlessBundle,
|
|
10
|
-
isDevServerDisabled,
|
|
11
|
-
isExposeSharedDependencies,
|
|
12
|
-
isWebComponent,
|
|
13
|
-
log,
|
|
14
|
-
pick,
|
|
15
|
-
} from '../../utils';
|
|
16
|
-
import { Overrides, createWebpackConfig } from '../../webpack';
|
|
17
|
-
import { stringifyConfig } from '../../webpack/utils';
|
|
4
|
+
import { isDevServerDisabled, isExposeSharedDependencies, isWebComponent, log } from '../../utils';
|
|
5
|
+
import { createWebpackConfigs } from '../../webpack';
|
|
18
6
|
|
|
19
7
|
interface Options {
|
|
20
8
|
buildStat?: boolean;
|
|
21
9
|
codeCoverage?: boolean;
|
|
22
10
|
config?: string;
|
|
23
|
-
emitExposedDependencies?: boolean
|
|
11
|
+
emitExposedDependencies?: boolean;
|
|
24
12
|
useWatchConfig?: boolean;
|
|
25
13
|
watch?: boolean;
|
|
26
14
|
}
|
|
27
15
|
|
|
28
|
-
function getName() {
|
|
29
|
-
const packageName = getPackageName()
|
|
30
|
-
.replace(/\//g, '-')
|
|
31
|
-
.replace(/[^\w-]/g, '');
|
|
32
|
-
const hash = crypto.randomBytes(4).toString('hex');
|
|
33
|
-
|
|
34
|
-
return `${packageName}-${hash}`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const webpackDevConfigFileName = 'webpack.dev.config.js';
|
|
38
|
-
export const webpackProdConfigFileName = 'webpack.prod.config.js';
|
|
39
|
-
|
|
40
16
|
export async function bundle(options: Options = {}) {
|
|
41
|
-
const { emitExposedDependencies,
|
|
17
|
+
const { emitExposedDependencies, watch } = options;
|
|
18
|
+
|
|
42
19
|
if (emitExposedDependencies) {
|
|
43
20
|
if (watch) {
|
|
44
21
|
throw new Error('cannot bundle exposed dependencies in watch mode');
|
|
@@ -50,89 +27,31 @@ export async function bundle(options: Options = {}) {
|
|
|
50
27
|
|
|
51
28
|
log.info(`Bundling ${emitExposedDependencies ? 'exposed dependencies' : 'package'}...`);
|
|
52
29
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const customConfig = readWebpackConfig({ ...options, fallback });
|
|
56
|
-
const webpackOptions = getWebpackOptions(options, customConfig);
|
|
30
|
+
if (isWebComponent()) {
|
|
31
|
+
const [fullConfig, lightConfig, headlessConfig] = createWebpackConfigs(options);
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
|
|
33
|
+
if (watch) {
|
|
34
|
+
return Promise.all([
|
|
35
|
+
isDevServerDisabled() ? runWatch(fullConfig) : runServe(fullConfig),
|
|
36
|
+
runWatch(lightConfig),
|
|
37
|
+
headlessConfig && runWatch(headlessConfig),
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
60
40
|
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
return Promise.all([
|
|
42
|
+
run(fullConfig),
|
|
43
|
+
run(lightConfig),
|
|
44
|
+
headlessConfig && run(headlessConfig),
|
|
45
|
+
]);
|
|
63
46
|
}
|
|
64
47
|
|
|
65
|
-
const config =
|
|
66
|
-
customConfig && !emitExposedDependencies
|
|
67
|
-
? customConfig
|
|
68
|
-
: createWebpackConfig({ configuration: { mode } }, webpackOptions);
|
|
69
|
-
|
|
48
|
+
const [config] = createWebpackConfigs(options);
|
|
70
49
|
if (watch) {
|
|
71
50
|
return isDevServerDisabled() ? runWatch(config) : runServe(config);
|
|
72
51
|
}
|
|
73
|
-
|
|
74
52
|
return run(config);
|
|
75
53
|
}
|
|
76
54
|
|
|
77
|
-
function bundleWebComponent({
|
|
78
|
-
customConfig,
|
|
79
|
-
mode,
|
|
80
|
-
watch,
|
|
81
|
-
webpackOptions,
|
|
82
|
-
}: {
|
|
83
|
-
customConfig: ReturnType<typeof readWebpackConfig>;
|
|
84
|
-
mode: 'development' | 'production';
|
|
85
|
-
watch?: boolean;
|
|
86
|
-
webpackOptions: ReturnType<typeof getWebpackOptions>;
|
|
87
|
-
}) {
|
|
88
|
-
const overrides: Overrides = {
|
|
89
|
-
configuration: { ...customConfig?.configuration, mode },
|
|
90
|
-
plugins: customConfig?.plugins,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const fullConfig = createWebpackConfig(overrides, webpackOptions);
|
|
94
|
-
const lightConfig = createWebpackConfig(overrides, { ...webpackOptions, embed: true });
|
|
95
|
-
const headlessConfig = hasHeadlessBundle()
|
|
96
|
-
? createWebpackConfig(overrides, {
|
|
97
|
-
...webpackOptions,
|
|
98
|
-
headless: true,
|
|
99
|
-
})
|
|
100
|
-
: undefined;
|
|
101
|
-
|
|
102
|
-
const promises = watch
|
|
103
|
-
? [
|
|
104
|
-
runWatch(lightConfig),
|
|
105
|
-
isDevServerDisabled() ? runWatch(fullConfig) : runServe(fullConfig),
|
|
106
|
-
headlessConfig && runWatch(headlessConfig),
|
|
107
|
-
]
|
|
108
|
-
: [run(lightConfig), run(fullConfig), headlessConfig && run(headlessConfig)];
|
|
109
|
-
|
|
110
|
-
return Promise.all(promises.filter(promise => !!promise));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function getWebpackOptions(options: Options, customConfig?: Record<string, any>) {
|
|
114
|
-
const result = {
|
|
115
|
-
name: getName(),
|
|
116
|
-
...pick(options, ['buildStat', 'codeCoverage', 'emitExposedDependencies']),
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
if (result.emitExposedDependencies && customConfig) {
|
|
120
|
-
result.emitExposedDependencies = { output: customConfig.output };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return result;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function readWebpackConfig({ config, fallback }: Options & { fallback: string }) {
|
|
127
|
-
return readConfig(config) ?? readConfig(fallback);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function readConfig(relativePath?: string): Record<string, any> | undefined {
|
|
131
|
-
if (relativePath && fs.existsSync(relativePath)) {
|
|
132
|
-
return require(path.resolve(relativePath));
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
55
|
async function run(config: Configuration) {
|
|
137
56
|
const compiler = createWebpackCompiler(config);
|
|
138
57
|
|