@servicetitan/startup 36.0.0 → 36.1.1-beta.1
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.map +1 -1
- package/dist/cli/commands/build.js +14 -9
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-vite.d.ts +6 -0
- package/dist/cli/commands/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/bundle-vite.js +110 -0
- package/dist/cli/commands/bundle-vite.js.map +1 -0
- package/dist/cli/commands/bundle-webpack.d.ts +6 -0
- package/dist/cli/commands/bundle-webpack.d.ts.map +1 -0
- package/dist/cli/commands/{bundle-package.js → bundle-webpack.js} +8 -6
- package/dist/cli/commands/bundle-webpack.js.map +1 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +2 -1
- package/dist/cli/commands/install.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-list.js +1 -1
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.js +1 -1
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +8 -0
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +8 -0
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/bundle-vite.d.ts +33 -0
- package/dist/cli/commands/registry/bundle-vite.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-vite.js +45 -0
- package/dist/cli/commands/registry/bundle-vite.js.map +1 -0
- package/dist/cli/commands/registry/{bundle-package.d.ts → bundle-webpack.d.ts} +1 -1
- package/dist/cli/commands/registry/bundle-webpack.d.ts.map +1 -0
- package/dist/cli/commands/registry/{bundle-package.js → bundle-webpack.js} +1 -1
- package/dist/cli/commands/registry/{bundle-package.js.map → bundle-webpack.js.map} +1 -1
- package/dist/cli/commands/registry/command-registry.d.ts +72 -0
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +7 -2
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +4 -0
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +4 -0
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +11 -9
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
- package/dist/cli/utils/copy-files.js +1 -0
- package/dist/cli/utils/copy-files.js.map +1 -1
- package/dist/cli/utils/index.d.ts +0 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +0 -1
- package/dist/cli/utils/index.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/{webpack/configs/plugins/ignore-plugin → core/check-resource}/check-resource.js +2 -2
- package/dist/core/check-resource/check-resource.js.map +1 -0
- package/dist/core/check-resource/get-package-json.d.ts +7 -0
- package/dist/core/check-resource/get-package-json.d.ts.map +1 -0
- package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/get-package-json.js +1 -1
- 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.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.map +1 -0
- package/dist/core/constants.d.ts +17 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +28 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/create-build-context.d.ts +13 -0
- package/dist/core/create-build-context.d.ts.map +1 -0
- package/dist/core/create-build-context.js +51 -0
- package/dist/core/create-build-context.js.map +1 -0
- package/dist/core/defines/define-exposed-dependencies.d.ts +5 -0
- package/dist/core/defines/define-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/defines/define-exposed-dependencies.js +26 -0
- package/dist/core/defines/define-exposed-dependencies.js.map +1 -0
- package/dist/core/defines/define-exposed-instance-dependencies.d.ts +5 -0
- package/dist/core/defines/define-exposed-instance-dependencies.d.ts.map +1 -0
- package/dist/core/defines/define-exposed-instance-dependencies.js +29 -0
- package/dist/core/defines/define-exposed-instance-dependencies.js.map +1 -0
- package/dist/core/defines/define-web-component-name.d.ts +5 -0
- package/dist/core/defines/define-web-component-name.d.ts.map +1 -0
- package/dist/core/defines/define-web-component-name.js +23 -0
- package/dist/core/defines/define-web-component-name.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/externals.d.ts +3 -0
- package/dist/core/externals.d.ts.map +1 -0
- package/dist/core/externals.js +28 -0
- package/dist/core/externals.js.map +1 -0
- package/dist/core/get-build-name.d.ts +2 -0
- package/dist/core/get-build-name.d.ts.map +1 -0
- package/dist/core/get-build-name.js +24 -0
- package/dist/core/get-build-name.js.map +1 -0
- package/dist/core/get-bundle-type.d.ts +3 -0
- package/dist/core/get-bundle-type.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core}/get-bundle-type.js +4 -2
- package/dist/core/get-bundle-type.js.map +1 -0
- package/dist/core/get-exposed-dependencies.d.ts.map +1 -0
- package/dist/core/get-exposed-dependencies.js.map +1 -0
- package/dist/core/get-output-path.d.ts +3 -0
- package/dist/core/get-output-path.d.ts.map +1 -0
- package/dist/core/get-output-path.js +32 -0
- package/dist/core/get-output-path.js.map +1 -0
- package/dist/core/get-shared-entry-points.d.ts +11 -0
- package/dist/core/get-shared-entry-points.d.ts.map +1 -0
- package/dist/core/get-shared-entry-points.js +43 -0
- package/dist/core/get-shared-entry-points.js.map +1 -0
- package/dist/core/get-version/get-launchdarkly-sdk-version.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.js +1 -1
- package/dist/core/get-version/get-launchdarkly-sdk-version.js.map +1 -0
- package/dist/core/get-version/get-startup-version.d.ts.map +1 -0
- package/dist/{utils → core/get-version}/get-startup-version.js +2 -2
- package/dist/core/get-version/get-startup-version.js.map +1 -0
- package/dist/core/get-version/get-web-components-version.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/get-version}/get-web-components-version.js +1 -1
- package/dist/core/get-version/get-web-components-version.js.map +1 -0
- package/dist/core/get-version/index.d.ts +4 -0
- package/dist/core/get-version/index.d.ts.map +1 -0
- package/dist/core/get-version/index.js +22 -0
- package/dist/core/get-version/index.js.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +33 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/metadata/build-metadata.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/build-metadata.js +5 -6
- package/dist/core/metadata/build-metadata.js.map +1 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.d.ts +3 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.d.ts.map +1 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.js +42 -0
- package/dist/core/metadata/generate-exposed-dependencies-metadata.js.map +1 -0
- package/dist/core/metadata/generate-metadata.d.ts +3 -0
- package/dist/core/metadata/generate-metadata.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/generate-metadata.js +5 -4
- package/dist/core/metadata/generate-metadata.js.map +1 -0
- package/dist/core/metadata/index.d.ts +4 -0
- package/dist/core/metadata/index.d.ts.map +1 -0
- package/dist/{webpack/configs/utils → core/metadata}/index.js +2 -2
- package/dist/core/metadata/index.js.map +1 -0
- package/dist/core/stringify-config.d.ts.map +1 -0
- package/dist/core/stringify-config.js.map +1 -0
- package/dist/core/types.d.ts +51 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/virtual-modules.d.ts +8 -0
- package/dist/core/virtual-modules.d.ts.map +1 -0
- package/dist/core/virtual-modules.js +83 -0
- package/dist/core/virtual-modules.js.map +1 -0
- package/dist/cypress/config/webpack-config.d.ts +1 -1
- package/dist/cypress/config/webpack-config.d.ts.map +1 -1
- package/dist/cypress/config/webpack-config.js +19 -6
- package/dist/cypress/config/webpack-config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- 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 +17 -6
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +31 -1
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +12 -8
- 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/utils/get-packages.d.ts +1 -1
- package/dist/utils/get-packages.d.ts.map +1 -1
- package/dist/utils/get-packages.js +1 -1
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/validate-shared-dependencies.d.ts +2 -0
- package/dist/utils/validate-shared-dependencies.d.ts.map +1 -0
- package/dist/utils/validate-shared-dependencies.js +26 -0
- package/dist/utils/validate-shared-dependencies.js.map +1 -0
- package/dist/vite/build-shared-dependencies.d.ts +3 -0
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -0
- package/dist/vite/build-shared-dependencies.js +59 -0
- package/dist/vite/build-shared-dependencies.js.map +1 -0
- package/dist/vite/config/base-config.d.ts +4 -0
- package/dist/vite/config/base-config.d.ts.map +1 -0
- package/dist/vite/config/base-config.js +139 -0
- package/dist/vite/config/base-config.js.map +1 -0
- package/dist/vite/config/create-vite-build-context.d.ts +5 -0
- package/dist/vite/config/create-vite-build-context.d.ts.map +1 -0
- package/dist/vite/config/create-vite-build-context.js +43 -0
- package/dist/vite/config/create-vite-build-context.js.map +1 -0
- package/dist/vite/config/create-vite-config.d.ts +3 -0
- package/dist/vite/config/create-vite-config.d.ts.map +1 -0
- package/dist/vite/config/create-vite-config.js +43 -0
- package/dist/vite/config/create-vite-config.js.map +1 -0
- package/dist/vite/config/define-config.d.ts +13 -0
- package/dist/vite/config/define-config.d.ts.map +1 -0
- package/dist/vite/config/define-config.js +15 -0
- package/dist/vite/config/define-config.js.map +1 -0
- package/dist/vite/config/index.d.ts +6 -0
- package/dist/vite/config/index.d.ts.map +1 -0
- package/dist/vite/config/index.js +24 -0
- package/dist/vite/config/index.js.map +1 -0
- package/dist/vite/config/load-config-file.d.ts +4 -0
- package/dist/vite/config/load-config-file.d.ts.map +1 -0
- package/dist/vite/config/load-config-file.js +103 -0
- package/dist/vite/config/load-config-file.js.map +1 -0
- package/dist/vite/config/merge-vite-configs.d.ts +5 -0
- package/dist/vite/config/merge-vite-configs.d.ts.map +1 -0
- package/dist/vite/config/merge-vite-configs.js +17 -0
- package/dist/vite/config/merge-vite-configs.js.map +1 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.html +36 -0
- package/dist/vite/index.js +20 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts +4 -0
- package/dist/vite/plugins/css-injector-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/css-injector-plugin.js +57 -0
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -0
- package/dist/vite/plugins/dev-server-routing-plugin.d.ts +24 -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 +60 -0
- package/dist/vite/plugins/externals-plugin.js.map +1 -0
- package/dist/vite/plugins/html-plugin.d.ts +4 -0
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/html-plugin.js +102 -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 +78 -0
- package/dist/vite/plugins/metadata-plugin.js.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts +8 -0
- package/dist/vite/plugins/shared-dependencies-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/shared-dependencies-plugin.js +252 -0
- package/dist/vite/plugins/shared-dependencies-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 +31 -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 +33 -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 +63 -0
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -0
- package/dist/vite/types.d.ts +4 -0
- package/dist/vite/types.d.ts.map +1 -0
- package/dist/vite/types.js +6 -0
- package/dist/vite/types.js.map +1 -0
- package/dist/vite/validate-shared-dependencies.d.ts +2 -0
- package/dist/vite/validate-shared-dependencies.d.ts.map +1 -0
- package/dist/vite/validate-shared-dependencies.js +27 -0
- package/dist/vite/validate-shared-dependencies.js.map +1 -0
- package/dist/webpack/bundle-webpack.d.ts +11 -0
- package/dist/webpack/bundle-webpack.d.ts.map +1 -0
- package/dist/webpack/bundle-webpack.js +107 -0
- package/dist/webpack/bundle-webpack.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 +2 -2
- package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
- package/dist/webpack/configs/dev-server-config.js +8 -8
- 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 +3 -1
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/module-config.d.ts +2 -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 +2 -2
- package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
- package/dist/webpack/configs/optimization-config.js +9 -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 +10 -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 +4 -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/ignore-plugin.d.ts +15 -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 +41 -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 +2 -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 +2 -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 +2 -0
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +36 -46
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/dist/webpack/create-webpack-configs.d.ts +16 -0
- package/dist/webpack/create-webpack-configs.d.ts.map +1 -0
- package/dist/webpack/create-webpack-configs.js +82 -0
- package/dist/webpack/create-webpack-configs.js.map +1 -0
- package/dist/webpack/index.d.ts +2 -0
- package/dist/webpack/index.d.ts.map +1 -1
- package/dist/webpack/index.js +2 -0
- package/dist/webpack/index.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/create-webpack-build-context.d.ts +4 -0
- package/dist/webpack/utils/create-webpack-build-context.d.ts.map +1 -0
- package/dist/webpack/utils/create-webpack-build-context.js +21 -0
- package/dist/webpack/utils/create-webpack-build-context.js.map +1 -0
- package/dist/webpack/utils/index.d.ts +1 -1
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +1 -1
- package/dist/webpack/utils/index.js.map +1 -1
- package/jest/babel-plugin-import-meta-env.js +18 -0
- package/jest/jest-preset.js +4 -1
- package/package.json +24 -17
- package/patches/vite-plugin-css-injected-by-js+3.5.2.patch +63 -0
- package/src/cli/commands/__tests__/build.test.ts +2 -2
- package/src/cli/commands/__tests__/bundle-vite.test.ts +228 -0
- package/src/cli/commands/__tests__/{bundle-package.test.ts → bundle-webpack.test.ts} +26 -17
- package/src/cli/commands/__tests__/install.test.ts +6 -2
- package/src/cli/commands/__tests__/mfe-generate-metadata.test.ts +13 -10
- package/src/cli/commands/__tests__/mfe-publish.test.ts +4 -4
- package/src/cli/commands/__tests__/start.test.ts +1 -1
- package/src/cli/commands/build.ts +14 -11
- package/src/cli/commands/bundle-vite.ts +82 -0
- package/src/cli/commands/{bundle-package.ts → bundle-webpack.ts} +9 -6
- package/src/cli/commands/install.ts +2 -1
- package/src/cli/commands/mfe-check.ts +1 -2
- package/src/cli/commands/mfe-generate-metadata.ts +1 -1
- package/src/cli/commands/mfe-list.ts +1 -1
- package/src/cli/commands/mfe-package-publish.ts +1 -1
- package/src/cli/commands/mfe-publish.ts +1 -1
- package/src/cli/commands/registry/__tests__/command-registry.test.ts +1 -0
- package/src/cli/commands/registry/build.ts +2 -0
- package/src/cli/commands/registry/bundle-vite.ts +14 -0
- package/src/cli/commands/registry/command-registry.ts +5 -2
- package/src/cli/commands/registry/start.ts +1 -0
- package/src/cli/commands/start.ts +13 -11
- package/src/cli/index.ts +2 -1
- package/src/cli/tasks/tsc-compile/tsc-compile.ts +1 -1
- package/src/cli/utils/copy-files.ts +1 -1
- package/src/cli/utils/index.ts +0 -1
- 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}/__tests__/get-package-json.test.ts +1 -1
- 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 +6 -1
- package/src/core/check-resource/index.ts +1 -0
- package/src/core/constants.ts +16 -0
- package/src/core/create-build-context.ts +57 -0
- package/src/core/defines/define-exposed-dependencies.ts +21 -0
- package/src/core/defines/define-exposed-instance-dependencies.ts +19 -0
- package/src/core/defines/define-web-component-name.ts +15 -0
- package/src/core/defines/index.ts +3 -0
- package/src/core/externals.ts +22 -0
- package/src/core/get-build-name.ts +11 -0
- package/src/core/get-bundle-type.ts +19 -0
- package/src/core/get-output-path.ts +18 -0
- package/src/core/get-shared-entry-points.ts +37 -0
- package/src/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.ts +1 -1
- package/src/core/get-version/get-startup-version.ts +6 -0
- package/src/{webpack/configs/utils → core/get-version}/get-web-components-version.ts +1 -1
- package/src/core/get-version/index.ts +3 -0
- package/src/core/index.ts +15 -0
- package/src/{webpack/configs/utils → core/metadata}/__tests__/build-metadata.test.ts +10 -6
- package/src/{webpack/configs/utils → core/metadata}/__tests__/generate-metadata.test.ts +27 -13
- package/src/{webpack/configs/utils → core/metadata}/build-metadata.ts +6 -3
- package/src/core/metadata/generate-exposed-dependencies-metadata.ts +20 -0
- package/src/{webpack/configs/utils → core/metadata}/generate-metadata.ts +7 -6
- package/src/core/metadata/index.ts +3 -0
- package/src/core/types.ts +50 -0
- package/src/core/virtual-modules.ts +74 -0
- package/src/cypress/config/__tests__/webpack-config.test.ts +12 -2
- package/src/cypress/config/webpack-config.ts +23 -9
- package/src/index.ts +1 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +5 -2
- package/src/storybook-config/webpack-final.ts +22 -10
- package/src/utils/__tests__/get-configuration.test.ts +28 -7
- package/src/utils/__tests__/get-package-data.test.ts +35 -1
- package/src/utils/__tests__/get-packages.test.ts +3 -3
- package/src/utils/__tests__/validate-shared-dependencies.test.ts +55 -0
- package/src/utils/get-configuration.ts +48 -6
- package/src/utils/get-package-data.ts +3 -1
- package/src/utils/get-packages.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/validate-shared-dependencies.ts +32 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +165 -0
- package/src/vite/__tests__/validate-shared-dependencies.test.ts +34 -0
- package/src/vite/build-shared-dependencies.ts +47 -0
- package/src/vite/config/__tests__/base-config.test.ts +291 -0
- package/src/vite/config/__tests__/create-vite-build-context.test.ts +86 -0
- package/src/vite/config/__tests__/create-vite-config.test.ts +141 -0
- package/src/vite/config/__tests__/define-config.test.ts +23 -0
- package/src/vite/config/__tests__/load-config-file.test.ts +191 -0
- package/src/vite/config/__tests__/merge-vite-configs.test.ts +84 -0
- package/src/vite/config/base-config.ts +127 -0
- package/src/vite/config/create-vite-build-context.ts +45 -0
- package/src/vite/config/create-vite-config.ts +33 -0
- package/src/vite/config/define-config.ts +18 -0
- package/src/vite/config/index.ts +5 -0
- package/src/vite/config/load-config-file.ts +52 -0
- package/src/vite/config/merge-vite-configs.ts +15 -0
- package/src/vite/index.html +36 -0
- package/src/vite/index.ts +1 -0
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +61 -0
- package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +255 -0
- package/src/vite/plugins/__tests__/externals-plugin.test.ts +138 -0
- package/src/vite/plugins/__tests__/html-plugin.test.ts +308 -0
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +80 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +163 -0
- package/src/vite/plugins/__tests__/shared-dependencies-plugin.test.ts +427 -0
- package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +76 -0
- package/src/vite/plugins/__tests__/svgr-plugin.test.ts +67 -0
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +120 -0
- package/src/vite/plugins/css-injector-plugin.ts +60 -0
- package/src/vite/plugins/dev-server-routing-plugin.ts +96 -0
- package/src/vite/plugins/externals-plugin.ts +81 -0
- package/src/vite/plugins/html-plugin.ts +94 -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 +66 -0
- package/src/vite/plugins/shared-dependencies-plugin.ts +273 -0
- package/src/vite/plugins/style-urls-plugin.ts +28 -0
- package/src/vite/plugins/svgr-plugin.ts +17 -0
- package/src/vite/plugins/virtual-modules-plugin.ts +59 -0
- package/src/vite/types.ts +6 -0
- package/src/vite/validate-shared-dependencies.ts +27 -0
- package/src/{cli/utils/__tests__/bundle.test.ts → webpack/__tests__/bundle-webpack.test.ts} +26 -19
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +23 -9
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -16
- package/src/webpack/__tests__/create-webpack-config.test.ts +10 -8
- package/src/webpack/bundle-webpack.ts +107 -0
- 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 +16 -17
- 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 +4 -5
- package/src/webpack/configs/module-config.ts +2 -2
- package/src/webpack/configs/optimization-config.ts +17 -11
- package/src/webpack/configs/output-config.ts +11 -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 +6 -6
- package/src/webpack/configs/plugins/html-tags-plugin.ts +7 -16
- package/src/webpack/configs/plugins/ignore-plugin/__tests__/ignore-plugin.test.ts +92 -0
- package/src/webpack/configs/plugins/ignore-plugin/empty-module.js +6 -0
- package/src/webpack/configs/plugins/ignore-plugin/ignore-plugin.ts +44 -6
- package/src/webpack/configs/plugins/mini-css-extract-plugin.ts +9 -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 +11 -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 +6 -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 +18 -49
- package/src/webpack/create-webpack-configs.ts +77 -0
- package/src/webpack/index.ts +2 -0
- package/src/webpack/types.ts +8 -11
- package/src/webpack/utils/__tests__/split-by-entry.test.ts +33 -0
- package/src/webpack/utils/create-webpack-build-context.ts +12 -0
- package/src/webpack/utils/index.ts +1 -1
- package/dist/cli/commands/bundle-package.d.ts +0 -6
- package/dist/cli/commands/bundle-package.d.ts.map +0 -1
- package/dist/cli/commands/bundle-package.js.map +0 -1
- package/dist/cli/commands/registry/bundle-package.d.ts.map +0 -1
- package/dist/cli/utils/bundle.d.ts +0 -14
- package/dist/cli/utils/bundle.d.ts.map +0 -1
- package/dist/cli/utils/bundle.js +0 -187
- package/dist/cli/utils/bundle.js.map +0 -1
- package/dist/utils/get-startup-version.d.ts.map +0 -1
- package/dist/utils/get-startup-version.js.map +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/check-resource.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts +0 -2
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.d.ts.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.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-peer-dependency.js.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/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.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/types.js.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.d.ts.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.js.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/generate-metadata.js.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-bundle-type.js.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.js.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/dist/webpack/configs/utils/index.js.map +0 -1
- package/dist/webpack/utils/stringify-config.d.ts.map +0 -1
- package/dist/webpack/utils/stringify-config.js.map +0 -1
- package/src/cli/utils/bundle.ts +0 -191
- package/src/utils/get-startup-version.ts +0 -6
- 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}/is-optional-peer-dependency.d.ts +0 -0
- /package/dist/{webpack/configs/plugins/ignore-plugin → core/check-resource}/is-optional-peer-dependency.js +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/plugins/ignore-plugin → core/check-resource}/is-optional-react-dom-peer-dependency.js +0 -0
- /package/dist/{webpack/configs/utils → core}/get-exposed-dependencies.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core}/get-exposed-dependencies.js +0 -0
- /package/dist/{webpack/configs/utils → core/get-version}/get-launchdarkly-sdk-version.d.ts +0 -0
- /package/dist/{utils → core/get-version}/get-startup-version.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core/get-version}/get-web-components-version.d.ts +0 -0
- /package/dist/{webpack/configs/utils → core/metadata}/build-metadata.d.ts +0 -0
- /package/dist/{webpack/utils → core}/stringify-config.d.ts +0 -0
- /package/dist/{webpack/utils → core}/stringify-config.js +0 -0
- /package/dist/{webpack/configs → core}/types.js +0 -0
- /package/src/cli/commands/registry/{bundle-package.ts → bundle-webpack.ts} +0 -0
- /package/src/{webpack/configs/utils → core}/__tests__/get-exposed-dependencies.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/utils → core}/get-exposed-dependencies.ts +0 -0
- /package/src/{webpack/configs/utils → core/get-version}/__tests__/get-launchdarkly-sdk-version.test.ts +0 -0
- /package/src/{utils → core/get-version}/__tests__/get-startup-version.test.ts +0 -0
- /package/src/{webpack/configs/utils → core/get-version}/__tests__/get-web-components-version.test.ts +0 -0
- /package/src/{webpack/utils → core}/stringify-config.ts +0 -0
|
@@ -10,20 +10,19 @@ import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
|
10
10
|
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
11
11
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
12
12
|
import yargs from 'yargs';
|
|
13
|
+
import { getLaunchDarklySdkVersion } from '../../core';
|
|
13
14
|
import {
|
|
14
15
|
getFolders,
|
|
15
16
|
getPackageData,
|
|
16
17
|
getPackageDependencyVersion,
|
|
17
18
|
getPackages,
|
|
18
19
|
getTsConfig,
|
|
19
|
-
isCustomStyleRules,
|
|
20
20
|
isExposeSharedDependencies,
|
|
21
21
|
loadSharedDependencies,
|
|
22
22
|
log,
|
|
23
23
|
pick,
|
|
24
24
|
} from '../../utils';
|
|
25
25
|
import { miniCssPluginStyleRules } from '../__mocks__';
|
|
26
|
-
import { getLaunchDarklySdkVersion } from '../configs/utils/get-launchdarkly-sdk-version';
|
|
27
26
|
import { createWebpackConfig } from '../index';
|
|
28
27
|
import { getModuleEntryPath } from '../utils';
|
|
29
28
|
|
|
@@ -49,11 +48,17 @@ jest.mock('../../utils', () => ({
|
|
|
49
48
|
getPackageDependencyVersion: jest.fn(),
|
|
50
49
|
getPackages: jest.fn(),
|
|
51
50
|
getTsConfig: jest.fn(),
|
|
52
|
-
isCustomStyleRules: jest.fn(),
|
|
53
51
|
isExposeSharedDependencies: jest.fn(),
|
|
54
52
|
loadSharedDependencies: jest.fn(),
|
|
55
53
|
}));
|
|
56
|
-
|
|
54
|
+
/*
|
|
55
|
+
* Mock get-version (not core) because internal modules import from get-version
|
|
56
|
+
* directly. Mocking the core barrel doesn't intercept those internal imports.
|
|
57
|
+
*/
|
|
58
|
+
jest.mock('../../core/get-version', () => ({
|
|
59
|
+
...jest.requireActual('../../core/get-version'),
|
|
60
|
+
getLaunchDarklySdkVersion: jest.fn(),
|
|
61
|
+
}));
|
|
57
62
|
jest.mock('../utils', () => ({
|
|
58
63
|
...jest.requireActual('../utils'),
|
|
59
64
|
getCallerFile: jest.fn(),
|
|
@@ -90,7 +95,10 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
beforeEach(() => {
|
|
93
|
-
overrides = {
|
|
98
|
+
overrides = {
|
|
99
|
+
configuration: { mode: 'development' },
|
|
100
|
+
plugins: { MiniCssExtractPlugin: { attributes: { foo: 'bar' } } },
|
|
101
|
+
};
|
|
94
102
|
options = { name: 'app' };
|
|
95
103
|
|
|
96
104
|
jest.resetAllMocks();
|
|
@@ -203,7 +211,13 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
203
211
|
});
|
|
204
212
|
|
|
205
213
|
describe('when package has custom style rules', () => {
|
|
206
|
-
beforeEach(() =>
|
|
214
|
+
beforeEach(() => {
|
|
215
|
+
vol.fromJSON({
|
|
216
|
+
'package.json': JSON.stringify({
|
|
217
|
+
cli: { webpack: { 'custom-style-rules': true } },
|
|
218
|
+
}),
|
|
219
|
+
});
|
|
220
|
+
});
|
|
207
221
|
|
|
208
222
|
test('does not configure MiniCssExtractPlugin plugin', () => {
|
|
209
223
|
expect(subject().plugins).not.toContainEqual(
|
|
@@ -285,9 +299,9 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
285
299
|
expect(plugins).toContainEqual(
|
|
286
300
|
new VirtualModulesPlugin({
|
|
287
301
|
[(entry as EntryObject)?.['design-system'] as string]: [
|
|
288
|
-
`@import '
|
|
289
|
-
`@import '
|
|
290
|
-
`@import '
|
|
302
|
+
`@import '@servicetitan/tokens/core/tokens.css';`,
|
|
303
|
+
`@import '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
|
|
304
|
+
`@import '@servicetitan/design-system/dist/system.min.css';`,
|
|
291
305
|
].join('\n'),
|
|
292
306
|
})
|
|
293
307
|
);
|
|
@@ -6,7 +6,7 @@ import { DefinePlugin } from 'webpack';
|
|
|
6
6
|
import { WebpackAssetsManifest } from 'webpack-assets-manifest';
|
|
7
7
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
8
8
|
import yargs from 'yargs';
|
|
9
|
-
import {
|
|
9
|
+
import { generateMetadata } from '../../core';
|
|
10
10
|
import {
|
|
11
11
|
getFolders,
|
|
12
12
|
getPackageData,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isWebComponent,
|
|
17
17
|
} from '../../utils';
|
|
18
18
|
import { miniCssPluginStyleRules } from '../__mocks__';
|
|
19
|
-
import {
|
|
19
|
+
import { webpackDevConfigFileName, webpackProdConfigFileName } from '../create-webpack-config';
|
|
20
20
|
import { createWebpackConfig } from '../index';
|
|
21
21
|
import { getCallerFile, splitByEntry } from '../utils';
|
|
22
22
|
|
|
@@ -42,7 +42,7 @@ jest.mock('../../utils', () => ({
|
|
|
42
42
|
isLegacyRoot: jest.fn(),
|
|
43
43
|
isWebComponent: jest.fn(),
|
|
44
44
|
}));
|
|
45
|
-
jest.mock('
|
|
45
|
+
jest.mock('../../core/metadata/generate-metadata');
|
|
46
46
|
jest.mock('../utils', () => ({
|
|
47
47
|
...jest.requireActual('../utils'),
|
|
48
48
|
getCallerFile: jest.fn(),
|
|
@@ -57,22 +57,22 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
57
57
|
const tsConfig = 'tsconfig.build.json';
|
|
58
58
|
const designSystemPath = () => path.join(process.cwd(), `${destination}/design-system.css`);
|
|
59
59
|
const designSystemCode = [
|
|
60
|
-
`@import '
|
|
61
|
-
`@import '
|
|
62
|
-
`@import '
|
|
60
|
+
`@import '@servicetitan/tokens/core/tokens.css';`,
|
|
61
|
+
`@import '@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
|
|
62
|
+
`@import '@servicetitan/design-system/dist/system.min.css';`,
|
|
63
63
|
].join('\n');
|
|
64
64
|
|
|
65
65
|
const indexPath = () => path.join(process.cwd(), `${destination}/index`);
|
|
66
66
|
const indexCode = ({
|
|
67
|
-
|
|
67
|
+
light = false,
|
|
68
68
|
legacyRoot = false,
|
|
69
69
|
designSystem,
|
|
70
|
-
}: {
|
|
70
|
+
}: { light?: boolean; legacyRoot?: boolean; designSystem?: boolean } = {}) =>
|
|
71
71
|
[
|
|
72
|
-
...(designSystem ? [`
|
|
72
|
+
...(designSystem ? [`import './design-system.css';`] : []),
|
|
73
73
|
`import { register } from '@servicetitan/web-components';`,
|
|
74
74
|
`import { App } from './app';`,
|
|
75
|
-
`register(App, ${
|
|
75
|
+
`register(App, ${light}, { legacyRoot: ${legacyRoot}, sharedDependenciesNames: ${JSON.stringify(Object.keys(sharedDependencies))} });`,
|
|
76
76
|
].join('\n');
|
|
77
77
|
|
|
78
78
|
let overrides: Parameters<typeof createWebpackConfig>[0];
|
|
@@ -86,6 +86,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
86
86
|
|
|
87
87
|
beforeEach(() => {
|
|
88
88
|
overrides = {
|
|
89
|
+
configuration: { mode: 'development' },
|
|
89
90
|
plugins: {
|
|
90
91
|
HtmlWebpackPlugin: { favicon: 'foo' },
|
|
91
92
|
MiniCssExtractPlugin: { attributes: { foo: 'bar' } },
|
|
@@ -331,13 +332,13 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
331
332
|
});
|
|
332
333
|
});
|
|
333
334
|
|
|
334
|
-
describe('when
|
|
335
|
-
beforeEach(() => (options.
|
|
335
|
+
describe('when light option is set to true', () => {
|
|
336
|
+
beforeEach(() => (options.light = true));
|
|
336
337
|
|
|
337
|
-
test(`omits design system and registers App with
|
|
338
|
+
test(`omits design system and registers App with light set to true`, () => {
|
|
338
339
|
expect(subject().plugins).toContainEqual(
|
|
339
340
|
new VirtualModulesPlugin({
|
|
340
|
-
[indexPath()]: indexCode({ designSystem: false,
|
|
341
|
+
[indexPath()]: indexCode({ designSystem: false, light: true }),
|
|
341
342
|
})
|
|
342
343
|
);
|
|
343
344
|
});
|
|
@@ -366,7 +367,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
366
367
|
expect(subject().plugins).toContainEqual(
|
|
367
368
|
new VirtualModulesPlugin({
|
|
368
369
|
[designSystemPath()]: designSystemCode,
|
|
369
|
-
[indexPath()]: indexCode({ designSystem: true,
|
|
370
|
+
[indexPath()]: indexCode({ designSystem: true, light: true }),
|
|
370
371
|
})
|
|
371
372
|
);
|
|
372
373
|
});
|
|
@@ -380,7 +381,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
380
381
|
expect(subject().plugins).toContainEqual(
|
|
381
382
|
new VirtualModulesPlugin({
|
|
382
383
|
[indexPath()]: [
|
|
383
|
-
"import { registerHeadless } from '@servicetitan/web-components';",
|
|
384
|
+
"import { registerHeadless } from '@servicetitan/web-components/register-headless';",
|
|
384
385
|
"import { connectedCallback, disconnectedCallback } from './headless';",
|
|
385
386
|
'registerHeadless(connectedCallback, disconnectedCallback);',
|
|
386
387
|
].join('\n'),
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
getPackages,
|
|
23
23
|
getTsConfig,
|
|
24
24
|
getWebpackConfiguration,
|
|
25
|
-
isCustomStyleRules,
|
|
26
25
|
isDevServerDisabled,
|
|
27
26
|
isWebComponent,
|
|
28
27
|
loadSharedDependencies,
|
|
@@ -60,7 +59,6 @@ jest.mock('../../utils', () => ({
|
|
|
60
59
|
getPackages: jest.fn(),
|
|
61
60
|
getTsConfig: jest.fn(),
|
|
62
61
|
getWebpackConfiguration: jest.fn(),
|
|
63
|
-
isCustomStyleRules: jest.fn(),
|
|
64
62
|
isDevServerDisabled: jest.fn(),
|
|
65
63
|
isExposeSharedDependencies: jest.fn(),
|
|
66
64
|
isWebComponent: jest.fn(),
|
|
@@ -108,6 +106,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
108
106
|
argv = {};
|
|
109
107
|
packages = [];
|
|
110
108
|
overrides = {
|
|
109
|
+
configuration: { mode: 'development' },
|
|
111
110
|
plugins: {
|
|
112
111
|
HtmlWebpackPlugin: { favicon: 'foo' },
|
|
113
112
|
MiniCssExtractPlugin: { attributes: { foo: 'bar' } },
|
|
@@ -405,7 +404,9 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
405
404
|
});
|
|
406
405
|
|
|
407
406
|
describe('when package has custom style rules', () => {
|
|
408
|
-
beforeEach(() =>
|
|
407
|
+
beforeEach(() => {
|
|
408
|
+
configuration.webpack = { 'custom-style-rules': true };
|
|
409
|
+
});
|
|
409
410
|
|
|
410
411
|
Object.entries(styleRules).forEach(([extension, rule]) => {
|
|
411
412
|
test(`omits "${extension}" rules`, () => {
|
|
@@ -472,10 +473,11 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
472
473
|
);
|
|
473
474
|
});
|
|
474
475
|
|
|
475
|
-
test('configures
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
test('configures ReplaceOptionalDependenciesPlugin', () => {
|
|
477
|
+
const plugin = subject().plugins?.find(
|
|
478
|
+
p => p?.constructor.name === 'ReplaceOptionalDependenciesPlugin'
|
|
478
479
|
);
|
|
480
|
+
expect(plugin).toBeDefined();
|
|
479
481
|
});
|
|
480
482
|
|
|
481
483
|
describe('when buildStat option is set to true', () => {
|
|
@@ -526,8 +528,8 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
526
528
|
);
|
|
527
529
|
});
|
|
528
530
|
|
|
529
|
-
describe('when
|
|
530
|
-
beforeEach(() => setOptions({
|
|
531
|
+
describe('when light option is set to true', () => {
|
|
532
|
+
beforeEach(() => setOptions({ light: true }));
|
|
531
533
|
|
|
532
534
|
test('adds "light" to reportFilename and reportTitle', () => {
|
|
533
535
|
expect(subject().plugins).toContainEqual(
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { getPortPromise } from 'portfinder';
|
|
2
|
+
import webpack, { Configuration } from 'webpack';
|
|
3
|
+
import WebpackDevServer from 'webpack-dev-server';
|
|
4
|
+
import { isDevServerDisabled, isExposeSharedDependencies, isWebComponent, log } from '../utils';
|
|
5
|
+
import { createWebpackConfigs } from './create-webpack-configs';
|
|
6
|
+
|
|
7
|
+
interface Options {
|
|
8
|
+
buildStat?: boolean;
|
|
9
|
+
codeCoverage?: boolean;
|
|
10
|
+
config?: string;
|
|
11
|
+
emitExposedDependencies?: boolean;
|
|
12
|
+
useWatchConfig?: boolean;
|
|
13
|
+
watch?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function bundleWebpack(options: Options = {}) {
|
|
17
|
+
const { emitExposedDependencies, watch } = options;
|
|
18
|
+
|
|
19
|
+
if (emitExposedDependencies) {
|
|
20
|
+
if (watch) {
|
|
21
|
+
throw new Error('cannot bundle exposed dependencies in watch mode');
|
|
22
|
+
}
|
|
23
|
+
if (!isExposeSharedDependencies()) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
log.info(`Bundling ${emitExposedDependencies ? 'exposed dependencies' : 'package'}...`);
|
|
29
|
+
|
|
30
|
+
const { full, light, headless } = createWebpackConfigs(options);
|
|
31
|
+
|
|
32
|
+
// Standalone app — only the full config is needed
|
|
33
|
+
if (!isWebComponent()) {
|
|
34
|
+
return watch ? runDevServer(full) : run(full);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (watch) {
|
|
38
|
+
return Promise.all([
|
|
39
|
+
runDevServer(full),
|
|
40
|
+
light && runWatch(light),
|
|
41
|
+
headless && runWatch(headless),
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return Promise.all([run(full), light && run(light), headless && run(headless)]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function runDevServer(config: Configuration) {
|
|
49
|
+
return isDevServerDisabled() ? runWatch(config) : runServe(config);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function run(config: Configuration) {
|
|
53
|
+
const compiler = createWebpackCompiler(config);
|
|
54
|
+
|
|
55
|
+
const stats = await new Promise<webpack.Stats>((resolve, reject) => {
|
|
56
|
+
compiler.run((error, stats) => {
|
|
57
|
+
if (!stats || error) {
|
|
58
|
+
return reject(error ?? new Error('Something went wrong.'));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (stats.hasErrors()) {
|
|
62
|
+
return reject(new Error(stats.toString('errors-only')));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
compiler.close(() => resolve(stats));
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
process.stdout.write(stats.toString(config.stats) + '\n');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function runServe({ devServer = {}, ...config }: Configuration) {
|
|
73
|
+
const compiler = createWebpackCompiler(config);
|
|
74
|
+
const host = devServer.host ?? 'localhost';
|
|
75
|
+
const port = await getPortPromise({
|
|
76
|
+
port: Number(process.env.PORT) || Number(devServer.port) || 8080,
|
|
77
|
+
host,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return new Promise<void>((_0, reject) => {
|
|
81
|
+
const server = new WebpackDevServer({ ...devServer, host, port }, compiler);
|
|
82
|
+
server.startCallback(e => {
|
|
83
|
+
if (e) {
|
|
84
|
+
server.stopCallback(() => {
|
|
85
|
+
reject(e);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function runWatch(config: Configuration) {
|
|
93
|
+
const compiler = createWebpackCompiler(config);
|
|
94
|
+
return new Promise<void>((_0, reject) => {
|
|
95
|
+
const watching = compiler.watch({}, e => {
|
|
96
|
+
if (e) {
|
|
97
|
+
watching?.close(() => {
|
|
98
|
+
reject(e);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function createWebpackCompiler(config: Configuration) {
|
|
106
|
+
return webpack(config);
|
|
107
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
3
4
|
|
|
4
5
|
type Result = Pick<Configuration, 'amd'>;
|
|
5
6
|
|
|
6
|
-
export function amdConfig(_context:
|
|
7
|
+
export function amdConfig(_context: BuildContext, _: Overrides): Result {
|
|
7
8
|
return { amd: false };
|
|
8
9
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
+
import { BuildContext } from '../../core';
|
|
4
5
|
import { findUp } from '../../utils';
|
|
5
|
-
import {
|
|
6
|
+
import { Overrides } from '../types';
|
|
6
7
|
|
|
7
8
|
type Config = Configuration['cache'];
|
|
8
9
|
type Result = Pick<Configuration, 'cache' | 'infrastructureLogging'> | undefined;
|
|
9
10
|
|
|
10
11
|
const CACHE_VERSION = '1';
|
|
11
12
|
|
|
12
|
-
export function cacheConfig(context:
|
|
13
|
-
const { emitExposedDependencies } = context;
|
|
13
|
+
export function cacheConfig(context: BuildContext, _overrides: Overrides): Result {
|
|
14
|
+
const { emitExposedDependencies } = context.build;
|
|
14
15
|
if (!emitExposedDependencies) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
getWebpackConfiguration,
|
|
7
|
-
isDevServerDisabled,
|
|
8
|
-
log,
|
|
9
|
-
pick,
|
|
10
|
-
} from '../../utils';
|
|
4
|
+
import { allowedWebpackDevServerOptions, isDevServerDisabled, log, pick } from '../../utils';
|
|
5
|
+
import { Overrides, WebpackBuildContext } from '../types';
|
|
11
6
|
import { statsConfig } from './stats-config';
|
|
12
|
-
import { Context, Overrides } from './types';
|
|
13
7
|
|
|
14
8
|
type DevServerConfig = NonNullable<Configuration['devServer']>;
|
|
15
9
|
type Result = Pick<Configuration, 'devServer'> | undefined;
|
|
16
10
|
|
|
17
|
-
export function devServerConfig(context:
|
|
18
|
-
if (
|
|
11
|
+
export function devServerConfig(context: WebpackBuildContext, overrides: Overrides): Result {
|
|
12
|
+
if (
|
|
13
|
+
context.build.isProduction ||
|
|
14
|
+
context.build.emitExposedDependencies ||
|
|
15
|
+
isDevServerDisabled()
|
|
16
|
+
) {
|
|
19
17
|
return;
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -40,7 +38,7 @@ export function devServerConfig(context: Context, overrides: Overrides): Result
|
|
|
40
38
|
|
|
41
39
|
return middlewares;
|
|
42
40
|
},
|
|
43
|
-
...getDevServerConfig(),
|
|
41
|
+
...getDevServerConfig(context),
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
/* istanbul ignore next: debug only */
|
|
@@ -48,12 +46,13 @@ export function devServerConfig(context: Context, overrides: Overrides): Result
|
|
|
48
46
|
return { devServer };
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
function getDevServerConfig() {
|
|
52
|
-
const
|
|
49
|
+
function getDevServerConfig(context: WebpackBuildContext) {
|
|
50
|
+
const { bundlerConfig } = context;
|
|
51
|
+
|
|
53
52
|
/* istanbul ignore next: debug only */
|
|
54
|
-
log.debug('dev-server-config', () => JSON.stringify({ webpack }, null, 2));
|
|
53
|
+
log.debug('dev-server-config', () => JSON.stringify({ webpack: bundlerConfig }, null, 2));
|
|
55
54
|
|
|
56
|
-
const result = pick(
|
|
55
|
+
const result = pick(bundlerConfig, allowedWebpackDevServerOptions);
|
|
57
56
|
if (typeof result.proxy === 'string') {
|
|
58
57
|
if (fs.existsSync(result.proxy)) {
|
|
59
58
|
result.proxy = require(path.resolve(result.proxy));
|
|
@@ -63,7 +62,7 @@ function getDevServerConfig() {
|
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
if (result.static === undefined) {
|
|
66
|
-
const contentBase =
|
|
65
|
+
const contentBase = bundlerConfig.contentBase;
|
|
67
66
|
if (contentBase !== undefined) {
|
|
68
67
|
log.warning(CONTENT_BASE_DEPRECATION_WARNING);
|
|
69
68
|
if (typeof contentBase !== 'number') {
|
|
@@ -74,7 +73,7 @@ function getDevServerConfig() {
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
return { ...result, ...
|
|
76
|
+
return { ...result, ...bundlerConfig.devServer } as Partial<DevServerConfig>;
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
const CONTENT_BASE_DEPRECATION_WARNING = `
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
3
4
|
|
|
4
5
|
type Config = Configuration['devtool'];
|
|
5
6
|
type Result = Pick<Configuration, 'devtool'>;
|
|
6
7
|
|
|
7
|
-
export function devtoolConfig(context:
|
|
8
|
-
const { isProduction } = context;
|
|
8
|
+
export function devtoolConfig(context: BuildContext, _: Overrides): Result {
|
|
9
|
+
const { isProduction } = context.build;
|
|
9
10
|
let devtool: Config;
|
|
10
11
|
|
|
11
12
|
if (isProduction) {
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { Configuration } from 'webpack';
|
|
3
|
+
import { BuildContext, getDesignSystemPath } from '../../core';
|
|
4
|
+
import { Overrides } from '../types';
|
|
3
5
|
import { getModuleEntryPath } from '../utils';
|
|
4
|
-
import { getDesignSystemPath } from './plugins';
|
|
5
|
-
import { Context, Overrides } from './types';
|
|
6
6
|
|
|
7
7
|
type Config = Configuration['entry'];
|
|
8
8
|
type Result = Pick<Configuration, 'entry'>;
|
|
9
9
|
|
|
10
|
-
export function entryConfig(context:
|
|
11
|
-
const entry: Config = context.emitExposedDependencies
|
|
10
|
+
export function entryConfig(context: BuildContext, _: Overrides): Result {
|
|
11
|
+
const entry: Config = context.build.emitExposedDependencies
|
|
12
12
|
? getSharedEntryPoints(context)
|
|
13
13
|
: getIndexEntryPoint(context);
|
|
14
14
|
|
|
15
15
|
return { entry };
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function getIndexEntryPoint(
|
|
18
|
+
function getIndexEntryPoint(context: BuildContext): Config {
|
|
19
|
+
const { source, destination } = context.package;
|
|
19
20
|
const index = fs.existsSync(`./${source}/index.js`)
|
|
20
21
|
? `./${source}/index`
|
|
21
22
|
: `./${destination}/index`;
|
|
22
23
|
return { main: [index] };
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
function getSharedEntryPoints(context:
|
|
26
|
-
const { sharedDependencies } = context;
|
|
26
|
+
function getSharedEntryPoints(context: BuildContext): Config {
|
|
27
|
+
const { sharedDependencies } = context.package;
|
|
27
28
|
return {
|
|
28
29
|
shared: Object.keys(sharedDependencies).map(getModuleEntryPath),
|
|
29
30
|
...(sharedDependencies['@servicetitan/design-system']
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext, getExternals } from '../../core';
|
|
3
|
+
import { Overrides } from '../types';
|
|
3
4
|
|
|
4
|
-
type Config = Configuration['externals'];
|
|
5
5
|
type Result = Pick<Configuration, 'externals'> | undefined;
|
|
6
6
|
|
|
7
|
-
export function externalsConfig(context:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const { sharedDependencies } = context;
|
|
13
|
-
const name = context.name || context.packageData.name;
|
|
14
|
-
const externals: Config = Object.fromEntries(
|
|
15
|
-
Object.entries(sharedDependencies).map(([dependency, variable]) => [
|
|
16
|
-
dependency,
|
|
17
|
-
`${variable}['${name}']`,
|
|
18
|
-
])
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return { externals };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function needsExternals({ embed, emitExposedDependencies, isExposeSharedDependencies }: Context) {
|
|
25
|
-
return !!embed || (isExposeSharedDependencies && !emitExposedDependencies);
|
|
7
|
+
export function externalsConfig(context: BuildContext, _: Overrides): Result {
|
|
8
|
+
const externals = getExternals(context);
|
|
9
|
+
return externals ? { externals } : undefined;
|
|
26
10
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuildContext } from '../../../core';
|
|
2
2
|
import { LoaderOptions } from './types';
|
|
3
3
|
|
|
4
|
-
export function cssLoader(
|
|
4
|
+
export function cssLoader(context: BuildContext, { esModule }: LoaderOptions = {}) {
|
|
5
|
+
const { isProduction } = context.build;
|
|
5
6
|
const loader = 'css-loader';
|
|
6
7
|
return esModule
|
|
7
8
|
? {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
|
-
import {
|
|
2
|
+
import { BuildContext } from '../../../core';
|
|
3
3
|
import { LoaderOptions } from './types';
|
|
4
4
|
|
|
5
|
-
export function styleLoader(
|
|
6
|
-
{ isProduction,
|
|
7
|
-
{
|
|
8
|
-
) {
|
|
5
|
+
export function styleLoader(context: BuildContext, { esModule }: LoaderOptions = {}) {
|
|
6
|
+
const { isProduction, emitExposedDependencies } = context.build;
|
|
7
|
+
const { isWebComponent } = context.package;
|
|
9
8
|
const loader =
|
|
10
9
|
isProduction || isWebComponent || emitExposedDependencies
|
|
11
10
|
? MiniCssExtractPlugin.loader
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Configuration } from 'webpack';
|
|
2
|
+
import { Overrides, WebpackBuildContext } from '../types';
|
|
2
3
|
import { rulesConfig } from './rules-config';
|
|
3
|
-
import { Context, Overrides } from './types';
|
|
4
4
|
|
|
5
5
|
type Config = Configuration['module'];
|
|
6
6
|
type Result = Pick<Configuration, 'module'>;
|
|
7
7
|
|
|
8
|
-
export function moduleConfig(context:
|
|
8
|
+
export function moduleConfig(context: WebpackBuildContext, overrides: Overrides): Result {
|
|
9
9
|
const module: Config = { ...rulesConfig(context, overrides) };
|
|
10
10
|
|
|
11
11
|
return { module };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';
|
|
2
2
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
3
3
|
import { Configuration } from 'webpack';
|
|
4
|
-
import {
|
|
4
|
+
import { Overrides, WebpackBuildContext } from '../types';
|
|
5
5
|
|
|
6
6
|
type Config = Configuration['optimization'];
|
|
7
7
|
type ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };
|
|
8
8
|
type Result = Pick<Configuration, 'optimization'>;
|
|
9
9
|
|
|
10
|
-
export function optimizationConfig(context:
|
|
11
|
-
const {
|
|
10
|
+
export function optimizationConfig(context: WebpackBuildContext, _: Overrides): Result {
|
|
11
|
+
const { headless, isProduction, emitExposedDependencies } = context.build;
|
|
12
12
|
|
|
13
13
|
const optimization: ConfigWithCacheGroups = {
|
|
14
14
|
chunkIds: isProduction ? 'deterministic' : 'named',
|
|
@@ -30,14 +30,16 @@ export function optimizationConfig(context: Context, _: Overrides): Result {
|
|
|
30
30
|
return { optimization };
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function minimizeConfig(optimization: ConfigWithCacheGroups, context:
|
|
34
|
-
const { isProduction
|
|
33
|
+
function minimizeConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {
|
|
34
|
+
const { isProduction } = context.build;
|
|
35
|
+
const { codeCoverage } = context.options;
|
|
36
|
+
const { minify } = context.bundlerConfig;
|
|
35
37
|
if (!isProduction) {
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
const minifyJs =
|
|
40
|
-
const minifyCss =
|
|
41
|
+
const minifyJs = minify?.js ?? true;
|
|
42
|
+
const minifyCss = minify?.css ?? true;
|
|
41
43
|
optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);
|
|
42
44
|
if (!optimization.minimize) {
|
|
43
45
|
return;
|
|
@@ -59,8 +61,11 @@ function minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {
|
|
|
59
61
|
];
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
function sharedDependenciesConfig(
|
|
63
|
-
|
|
64
|
+
function sharedDependenciesConfig(
|
|
65
|
+
optimization: ConfigWithCacheGroups,
|
|
66
|
+
context: WebpackBuildContext
|
|
67
|
+
) {
|
|
68
|
+
const { emitExposedDependencies } = context.build;
|
|
64
69
|
if (!emitExposedDependencies) {
|
|
65
70
|
return;
|
|
66
71
|
}
|
|
@@ -75,8 +80,9 @@ function sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context:
|
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
function webComponentConfig(optimization: ConfigWithCacheGroups, context:
|
|
79
|
-
const { headless,
|
|
83
|
+
function webComponentConfig(optimization: ConfigWithCacheGroups, context: WebpackBuildContext) {
|
|
84
|
+
const { headless, isProduction } = context.build;
|
|
85
|
+
const { isWebComponent } = context.package;
|
|
80
86
|
if (!isWebComponent || headless) {
|
|
81
87
|
return;
|
|
82
88
|
}
|