@servicetitan/startup 38.0.0 → 38.2.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/bin/js-yaml.js +2 -2
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +32 -10
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +6 -0
- package/dist/cli/commands/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/bundle-package.js +59 -0
- package/dist/cli/commands/bundle-package.js.map +1 -0
- package/dist/cli/commands/bundle-vite.js +13 -4
- package/dist/cli/commands/bundle-vite.js.map +1 -1
- package/dist/cli/commands/bundle-webpack.js +13 -4
- package/dist/cli/commands/bundle-webpack.js.map +1 -1
- package/dist/cli/commands/clean.js +13 -4
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/command.d.ts +13 -0
- package/dist/cli/commands/command.d.ts.map +1 -0
- package/dist/cli/commands/command.js +74 -0
- package/dist/cli/commands/command.js.map +1 -0
- package/dist/cli/commands/convert-eslint-config.js +14 -7
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.js +13 -4
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +13 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +14 -21
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +13 -4
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.js +13 -4
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-check.d.ts.map +1 -1
- package/dist/cli/commands/mfe-check.js +15 -7
- package/dist/cli/commands/mfe-check.js.map +1 -1
- package/dist/cli/commands/mfe-generate-metadata.js +13 -4
- package/dist/cli/commands/mfe-generate-metadata.js.map +1 -1
- package/dist/cli/commands/mfe-list.js +13 -4
- package/dist/cli/commands/mfe-list.js.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +13 -4
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +13 -4
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-package-rollback.js +13 -4
- package/dist/cli/commands/mfe-package-rollback.js.map +1 -1
- package/dist/cli/commands/mfe-publish.js +13 -4
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/mfe-purge-cache.js +13 -4
- package/dist/cli/commands/mfe-purge-cache.js.map +1 -1
- package/dist/cli/commands/prepare-package.js +13 -4
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/registry/build.d.ts +1 -1
- package/dist/cli/commands/registry/build.d.ts.map +1 -1
- package/dist/cli/commands/registry/build.js +3 -5
- package/dist/cli/commands/registry/build.js.map +1 -1
- package/dist/cli/commands/registry/bundle-package.d.ts +41 -0
- package/dist/cli/commands/registry/bundle-package.d.ts.map +1 -0
- package/dist/cli/commands/registry/bundle-package.js +54 -0
- package/dist/cli/commands/registry/bundle-package.js.map +1 -0
- package/dist/cli/commands/registry/command-registry.d.ts +42 -18
- package/dist/cli/commands/registry/command-registry.d.ts.map +1 -1
- package/dist/cli/commands/registry/command-registry.js +10 -19
- package/dist/cli/commands/registry/command-registry.js.map +1 -1
- package/dist/cli/commands/registry/install.d.ts +0 -16
- package/dist/cli/commands/registry/install.d.ts.map +1 -1
- package/dist/cli/commands/registry/install.js +1 -17
- package/dist/cli/commands/registry/install.js.map +1 -1
- package/dist/cli/commands/registry/start.d.ts +1 -1
- package/dist/cli/commands/registry/start.d.ts.map +1 -1
- package/dist/cli/commands/registry/start.js +3 -5
- package/dist/cli/commands/registry/start.js.map +1 -1
- package/dist/cli/commands/review/review.js +14 -7
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js +1 -3
- package/dist/cli/commands/review/rules/no-deprecated-content-base.js.map +1 -1
- package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js +1 -3
- package/dist/cli/commands/review/rules/no-direct-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js +1 -3
- package/dist/cli/commands/review/rules/no-typescript-entry-point.js.map +1 -1
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js +5 -12
- package/dist/cli/commands/review/rules/prefer-open-ended-peer-dependencies.js.map +1 -1
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js +5 -12
- package/dist/cli/commands/review/rules/require-compatible-launch-darkly-sdk.js.map +1 -1
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js +1 -3
- package/dist/cli/commands/review/rules/require-explicit-side-effects.js.map +1 -1
- package/dist/cli/commands/review/rules/require-one-collection-version.js +1 -3
- package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js +1 -3
- package/dist/cli/commands/review/rules/require-servicetitan-scope.js.map +1 -1
- package/dist/cli/commands/review/rules/require-tsconfig-references.js +1 -3
- package/dist/cli/commands/review/rules/require-tsconfig-references.js.map +1 -1
- package/dist/cli/commands/review/utils/compare-version.js +8 -19
- package/dist/cli/commands/review/utils/compare-version.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +1 -0
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +20 -6
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +37 -14
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/stylelint.js +13 -4
- package/dist/cli/commands/stylelint.js.map +1 -1
- package/dist/cli/commands/styles-check.js +13 -4
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/test/runners/jest.js +1 -3
- package/dist/cli/commands/test/runners/jest.js.map +1 -1
- package/dist/cli/commands/test/tests.js +13 -4
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +1 -6
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +2 -20
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +17 -13
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/cli-task.d.ts +3 -0
- package/dist/cli/tasks/cli-task.d.ts.map +1 -1
- package/dist/cli/tasks/cli-task.js +41 -9
- package/dist/cli/tasks/cli-task.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts +9 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/get-swc-options.js +18 -2
- package/dist/cli/tasks/swc-compile-package/get-swc-options.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts +3 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js +17 -3
- package/dist/cli/tasks/swc-compile-package/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/task.d.ts +2 -1
- package/dist/cli/tasks/task.d.ts.map +1 -1
- package/dist/cli/tasks/task.js +6 -3
- package/dist/cli/tasks/task.js.map +1 -1
- package/dist/cli/tasks/tsc-compile/tsc-compile.js +1 -3
- package/dist/cli/tasks/tsc-compile/tsc-compile.js.map +1 -1
- package/dist/cli/utils/cli-git.d.ts +7 -0
- package/dist/cli/utils/cli-git.d.ts.map +1 -1
- package/dist/cli/utils/cli-git.js +30 -0
- package/dist/cli/utils/cli-git.js.map +1 -1
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +8 -1
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/cli-os.d.ts +7 -1
- package/dist/cli/utils/cli-os.d.ts.map +1 -1
- package/dist/cli/utils/cli-os.js +42 -0
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/compile.d.ts.map +1 -1
- package/dist/cli/utils/compile.js +7 -4
- package/dist/cli/utils/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 +1 -1
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +1 -1
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/process-tree.js +2 -6
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/resolve-bundler.d.ts.map +1 -1
- package/dist/cli/utils/resolve-bundler.js +2 -1
- package/dist/cli/utils/resolve-bundler.js.map +1 -1
- package/dist/cli/utils/ts-config.d.ts +1 -1
- package/dist/cli/utils/ts-config.d.ts.map +1 -1
- package/dist/cli/utils/ts-config.js +1 -3
- package/dist/cli/utils/ts-config.js.map +1 -1
- package/dist/cli/utils/with-exponential-backoff.d.ts +7 -0
- package/dist/cli/utils/with-exponential-backoff.d.ts.map +1 -0
- package/dist/cli/utils/with-exponential-backoff.js +28 -0
- package/dist/cli/utils/with-exponential-backoff.js.map +1 -0
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +6 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/postinstall.js +118 -0
- package/dist/scripts/generate-bin-wrappers.js +203 -0
- package/dist/storybook-config/swc.d.ts +6 -0
- package/dist/storybook-config/swc.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.d.ts.map +1 -1
- package/dist/storybook-config/webpack-final.js +2 -1
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +21 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +15 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +176 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/utils/exit-when-parent-exits.d.ts +6 -0
- package/dist/utils/exit-when-parent-exits.d.ts.map +1 -0
- package/dist/utils/exit-when-parent-exits.js +37 -0
- package/dist/utils/exit-when-parent-exits.js.map +1 -0
- package/dist/utils/find-up.d.ts +1 -1
- package/dist/utils/find-up.d.ts.map +1 -1
- package/dist/utils/find-up.js +2 -2
- package/dist/utils/find-up.js.map +1 -1
- package/dist/utils/get-configuration.d.ts +6 -3
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +10 -2
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/log.js +1 -3
- package/dist/utils/log.js.map +1 -1
- package/dist/vite/build-shared-dependencies.d.ts.map +1 -1
- package/dist/vite/build-shared-dependencies.js +2 -0
- package/dist/vite/build-shared-dependencies.js.map +1 -1
- package/dist/vite/config/base-config.d.ts.map +1 -1
- package/dist/vite/config/base-config.js +12 -1
- package/dist/vite/config/base-config.js.map +1 -1
- package/dist/vite/config/create-filtering-logger.d.ts.map +1 -1
- package/dist/vite/config/create-filtering-logger.js +6 -2
- package/dist/vite/config/create-filtering-logger.js.map +1 -1
- package/dist/vite/config/create-vite-config.js +7 -2
- package/dist/vite/config/create-vite-config.js.map +1 -1
- package/dist/vite/config/load-config-file.js +8 -19
- package/dist/vite/config/load-config-file.js.map +1 -1
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.html +2 -2
- package/dist/vite/index.js +16 -0
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugins/chain-source-maps-plugin.js +1 -1
- package/dist/vite/plugins/chain-source-maps-plugin.js.map +1 -1
- package/dist/vite/plugins/clean-plugin.js +1 -1
- package/dist/vite/plugins/clean-plugin.js.map +1 -1
- package/dist/vite/plugins/css-injector-plugin.js +1 -1
- package/dist/vite/plugins/css-injector-plugin.js.map +1 -1
- package/dist/vite/plugins/design-system-guard-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/design-system-guard-plugin.js +10 -5
- package/dist/vite/plugins/design-system-guard-plugin.js.map +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.js +1 -1
- package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -1
- package/dist/vite/plugins/externals-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/externals-plugin.js +11 -5
- package/dist/vite/plugins/externals-plugin.js.map +1 -1
- package/dist/vite/plugins/html-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/html-plugin.js +5 -3
- package/dist/vite/plugins/html-plugin.js.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.d.ts +2 -2
- package/dist/vite/plugins/ignore-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/ignore-modules-plugin.js +36 -24
- package/dist/vite/plugins/ignore-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/index.d.ts +3 -0
- package/dist/vite/plugins/index.d.ts.map +1 -1
- package/dist/vite/plugins/index.js +3 -0
- package/dist/vite/plugins/index.js.map +1 -1
- package/dist/vite/plugins/less-tilde-plugin.d.ts +8 -0
- package/dist/vite/plugins/less-tilde-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/less-tilde-plugin.js +53 -0
- package/dist/vite/plugins/less-tilde-plugin.js.map +1 -0
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js +1 -1
- package/dist/vite/plugins/magic-comments-plugin/magic-comments-plugin.js.map +1 -1
- package/dist/vite/plugins/metadata-plugin.js +1 -1
- package/dist/vite/plugins/metadata-plugin.js.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts +1 -1
- package/dist/vite/plugins/moment-locales-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/moment-locales-plugin.js +30 -14
- package/dist/vite/plugins/moment-locales-plugin.js.map +1 -1
- package/dist/vite/plugins/react-refresh-plugin/index.d.ts +2 -0
- package/dist/vite/plugins/react-refresh-plugin/index.d.ts.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/index.js +20 -0
- package/dist/vite/plugins/react-refresh-plugin/index.js.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts +4 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js +143 -0
- package/dist/vite/plugins/react-refresh-plugin/react-refresh-plugin.js.map +1 -0
- package/dist/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js +14 -11
- package/dist/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.js.map +1 -1
- package/dist/vite/plugins/style-urls-plugin.js +1 -1
- package/dist/vite/plugins/style-urls-plugin.js.map +1 -1
- package/dist/vite/plugins/virtual-modules-plugin.d.ts.map +1 -1
- package/dist/vite/plugins/virtual-modules-plugin.js +9 -6
- package/dist/vite/plugins/virtual-modules-plugin.js.map +1 -1
- package/dist/vite/plugins/window-externals-plugin.d.ts +22 -0
- package/dist/vite/plugins/window-externals-plugin.d.ts.map +1 -0
- package/dist/vite/plugins/window-externals-plugin.js +74 -0
- package/dist/vite/plugins/window-externals-plugin.js.map +1 -0
- package/dist/webpack/bundle-webpack.d.ts.map +1 -1
- package/dist/webpack/bundle-webpack.js +6 -1
- package/dist/webpack/bundle-webpack.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +17 -12
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.js +1 -1
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +1 -3
- package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js.map +1 -1
- package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/configuration.expose-loader.js +13 -0
- package/dist/webpack/loaders/expose-loader/__tests__/__mocks__/index.js +1 -0
- package/dist/webpack/utils/index.d.ts +1 -0
- package/dist/webpack/utils/index.d.ts.map +1 -1
- package/dist/webpack/utils/index.js +1 -0
- package/dist/webpack/utils/index.js.map +1 -1
- package/dist/webpack/utils/normalize-proxy-config.d.ts +6 -0
- package/dist/webpack/utils/normalize-proxy-config.d.ts.map +1 -0
- package/dist/webpack/utils/normalize-proxy-config.js +52 -0
- package/dist/webpack/utils/normalize-proxy-config.js.map +1 -0
- package/package.json +32 -26
- package/src/cli/commands/__tests__/build.test.ts +81 -20
- package/src/cli/commands/__tests__/bundle-package.test.ts +65 -0
- package/src/cli/commands/__tests__/command.test.ts +154 -0
- package/src/cli/commands/__tests__/init.test.ts +1 -1
- package/src/cli/commands/__tests__/install.test.ts +5 -72
- package/src/cli/commands/__tests__/mfe-check.test.ts +26 -5
- package/src/cli/commands/__tests__/run-task.test.ts +20 -1
- package/src/cli/commands/__tests__/start.test.ts +77 -16
- package/src/cli/commands/build.ts +15 -6
- package/src/cli/commands/bundle-package.ts +20 -0
- package/src/cli/commands/command.ts +64 -0
- package/src/cli/commands/init.ts +0 -1
- package/src/cli/commands/install.ts +5 -21
- package/src/cli/commands/mfe-check.ts +6 -10
- package/src/cli/commands/registry/build.ts +3 -2
- package/src/cli/commands/registry/bundle-package.ts +22 -0
- package/src/cli/commands/registry/command-registry.ts +2 -0
- package/src/cli/commands/registry/install.ts +1 -6
- package/src/cli/commands/registry/start.ts +3 -2
- package/src/cli/commands/run-task.ts +8 -2
- package/src/cli/commands/start.ts +17 -6
- package/src/cli/commands/types.ts +2 -6
- package/src/cli/index.ts +3 -0
- package/src/cli/tasks/__tests__/cli-task.test.ts +181 -69
- package/src/cli/tasks/__tests__/task.test.ts +40 -45
- package/src/cli/tasks/cli-task.ts +43 -2
- package/src/cli/tasks/swc-compile-package/__tests__/get-swc-options.test.ts +46 -4
- package/src/cli/tasks/swc-compile-package/__tests__/swc-compile-package.test.ts +25 -4
- package/src/cli/tasks/swc-compile-package/get-swc-options.ts +14 -1
- package/src/cli/tasks/swc-compile-package/swc-compile-package.ts +6 -2
- package/src/cli/tasks/task.ts +8 -2
- package/src/cli/tasks/tsc-compile/__tests__/tsc-compile.test.ts +8 -32
- package/src/cli/tasks/tsc-compile-package/__tests__/tsc-compile-package.test.ts +10 -19
- package/src/cli/utils/__tests__/cli-git.test.ts +54 -3
- package/src/cli/utils/__tests__/cli-npm.test.ts +33 -0
- package/src/cli/utils/__tests__/cli-os.test.ts +183 -4
- package/src/cli/utils/__tests__/compile.test.ts +37 -2
- package/src/cli/utils/__tests__/copy-files.test.ts +1 -1
- package/src/cli/utils/__tests__/with-exponential-backoff.test.ts +119 -0
- package/src/cli/utils/cli-git.ts +27 -1
- package/src/cli/utils/cli-npm.ts +19 -4
- package/src/cli/utils/cli-os.ts +44 -0
- package/src/cli/utils/compile.ts +8 -1
- package/src/cli/utils/copy-files.ts +1 -1
- package/src/cli/utils/index.ts +1 -1
- package/src/cli/utils/resolve-bundler.ts +2 -1
- package/src/cli/utils/ts-config.ts +1 -1
- package/src/cli/utils/with-exponential-backoff.ts +28 -0
- package/src/core/constants.ts +2 -0
- package/src/storybook-config/__tests__/vite-final.test.ts +6 -0
- package/src/storybook-config/__tests__/webpack-final.test.ts +26 -12
- package/src/storybook-config/webpack-final.ts +10 -4
- package/src/telemetry/__tests__/telemetry.test.ts +326 -0
- package/src/telemetry/index.ts +2 -0
- package/src/telemetry/telemetry.ts +134 -0
- package/src/utils/__tests__/exit-when-parent-exits.test.ts +87 -0
- package/src/utils/__tests__/find-up.test.ts +49 -0
- package/src/utils/__tests__/get-configuration.test.ts +62 -0
- package/src/utils/exit-when-parent-exits.ts +33 -0
- package/src/utils/find-up.ts +2 -2
- package/src/utils/get-configuration.ts +14 -5
- package/src/utils/index.ts +1 -0
- package/src/vite/__tests__/build-shared-dependencies.test.ts +39 -5
- package/src/vite/build-shared-dependencies.ts +2 -1
- package/src/vite/config/__tests__/base-config.test.ts +12 -4
- package/src/vite/config/__tests__/create-css-config.test.ts +2 -6
- package/src/vite/config/__tests__/create-filtering-logger.test.ts +3 -2
- package/src/vite/config/__tests__/create-vite-config.test.ts +6 -3
- package/src/vite/config/base-config.ts +13 -1
- package/src/vite/config/create-filtering-logger.ts +8 -2
- package/src/vite/config/create-vite-config.ts +6 -3
- package/src/vite/index.html +2 -2
- package/src/vite/index.ts +2 -0
- package/src/vite/plugins/__tests__/chain-source-maps-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/clean-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/css-injector-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/design-system-guard-plugin.test.ts +15 -3
- package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/externals-plugin.test.ts +24 -3
- package/src/vite/plugins/__tests__/html-plugin.test.ts +10 -3
- package/src/vite/plugins/__tests__/html-template.test.ts +10 -2
- package/src/vite/plugins/__tests__/ignore-modules-plugin.test.ts +30 -6
- package/src/vite/plugins/__tests__/less-tilde-plugin.test.ts +91 -0
- package/src/vite/plugins/__tests__/metadata-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/moment-locales-plugin.test.ts +35 -25
- package/src/vite/plugins/__tests__/style-urls-plugin.test.ts +1 -1
- package/src/vite/plugins/__tests__/virtual-modules-plugin.test.ts +20 -9
- package/src/vite/plugins/__tests__/window-externals-plugin.test.ts +128 -0
- package/src/vite/plugins/chain-source-maps-plugin.ts +1 -1
- package/src/vite/plugins/clean-plugin.ts +1 -1
- package/src/vite/plugins/css-injector-plugin.ts +1 -1
- package/src/vite/plugins/design-system-guard-plugin.ts +11 -8
- package/src/vite/plugins/dev-server-routing-plugin.ts +1 -1
- package/src/vite/plugins/externals-plugin.ts +15 -6
- package/src/vite/plugins/html-plugin.ts +4 -2
- package/src/vite/plugins/ignore-modules-plugin.ts +32 -23
- package/src/vite/plugins/index.ts +3 -0
- package/src/vite/plugins/less-tilde-plugin.ts +64 -0
- package/src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts +1 -1
- package/src/vite/plugins/metadata-plugin.ts +1 -1
- package/src/vite/plugins/moment-locales-plugin.ts +24 -14
- package/src/vite/plugins/react-refresh-plugin/README.md +165 -0
- package/src/vite/plugins/react-refresh-plugin/__tests__/react-refresh-plugin.test.ts +366 -0
- package/src/vite/plugins/react-refresh-plugin/__tests__/refresh-runtime.test.ts +193 -0
- package/src/vite/plugins/react-refresh-plugin/index.ts +1 -0
- package/src/vite/plugins/react-refresh-plugin/react-refresh-plugin.ts +144 -0
- package/src/vite/plugins/react-refresh-plugin/refresh-runtime.js +113 -0
- package/src/vite/plugins/shared-dependencies-plugin/__tests__/shared-dependencies-plugin.test.ts +21 -16
- package/src/vite/plugins/shared-dependencies-plugin/shared-dependencies-plugin.ts +13 -12
- package/src/vite/plugins/style-urls-plugin.ts +1 -1
- package/src/vite/plugins/virtual-modules-plugin.ts +8 -7
- package/src/vite/plugins/window-externals-plugin.ts +94 -0
- package/src/webpack/__tests__/bundle-webpack.test.ts +32 -0
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +27 -1
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -5
- package/src/webpack/__tests__/create-webpack-config.test.ts +10 -6
- package/src/webpack/bundle-webpack.ts +7 -1
- package/src/webpack/configs/optimization-config.ts +22 -11
- package/src/webpack/configs/output-config.ts +1 -1
- package/src/webpack/utils/__tests__/normalize-proxy-config.test.ts +121 -0
- package/src/webpack/utils/index.ts +1 -0
- package/src/webpack/utils/normalize-proxy-config.ts +59 -0
- package/tsconfig/types.d.ts +10 -0
- package/dist/cli/utils/get-bundle-command.d.ts +0 -3
- package/dist/cli/utils/get-bundle-command.d.ts.map +0 -1
- package/dist/cli/utils/get-bundle-command.js +0 -16
- package/dist/cli/utils/get-bundle-command.js.map +0 -1
- package/src/cli/utils/__tests__/get-bundle-command.test.ts +0 -23
- package/src/cli/utils/get-bundle-command.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/html-plugin.ts"],"sourcesContent":["import { Eta } from 'eta';\nimport fs from 'fs';\nimport path from 'path';\nimport type { Plugin } from 'vite';\nimport { getSharedEntryPoints } from '../../core';\nimport { ViteBuildContext } from '../types';\n\nexport function htmlPlugin(context: ViteBuildContext): Plugin {\n const { name, isProduction } = context.build;\n const { isWebComponent } = context.package;\n const { css, js } = getSharedEntryPoints(context);\n const { pluginOverrides } = context.bundlerConfig;\n\n const htmlTemplatePath = resolveTemplatePath(context);\n\n const eta = new Eta({ views: path.dirname(htmlTemplatePath) });\n\n let detectedFavicon: string | undefined;\n\n function renderHtml() {\n return eta.render(path.basename(htmlTemplatePath), {\n title: pluginOverrides.html?.title ?? 'ServiceTitan',\n favicon: pluginOverrides.html?.favicon ?? detectedFavicon,\n css,\n js,\n isProduction,\n isWebComponent,\n name,\n });\n }\n\n /*\n * Virtual entry point for the HTML module. The file doesn't exist on disk —\n * resolveId claims this path and load returns Eta-rendered HTML.\n *\n * Uses an absolute path (e.g., /path/to/project/index.html) instead of a\n * synthetic prefix because Vite resolves asset references in HTML (favicon,\n * CSS links) relative to the HTML file's directory. A non-filesystem path\n * would break those references.\n */\n const INDEX_HTML = 'index.html';\n const VIRTUAL_HTML_PATH = path.resolve(INDEX_HTML);\n\n return {\n name: 'html',\n /*\n * Auto-detect favicon.ico in vite's publicDir so projects following\n * the convention get a working favicon link without explicit config.\n */\n configResolved(config) {\n if (config.publicDir && fs.existsSync(path.join(config.publicDir, 'favicon.ico'))) {\n detectedFavicon = '/favicon.ico';\n }\n },\n /*\n * Dev server serves HTML via middleware (load is not called in dev mode).\n * Returns a callback so middleware registers after Vite's built-in middleware.\n */\n configureServer(server) {\n return () => {\n server.middlewares.use(async (req, res, next) => {\n if (!req.url?.endsWith(INDEX_HTML)) {\n return next();\n }\n let html = renderHtml();\n html = await server.transformIndexHtml(req.url, html);\n res.end(html);\n });\n };\n },\n resolveId(source: string, importer: string | undefined) {\n /*\n * Claim the HTML entry so Vite doesn't look for it on disk (it's virtual, rendered by Eta).\n * Only needed for production builds — dev mode serves HTML via configureServer middleware.\n */\n if (source === VIRTUAL_HTML_PATH) {\n return VIRTUAL_HTML_PATH;\n }\n if (importer?.includes(INDEX_HTML) && source.startsWith('.')) {\n const resolved = path.resolve(source + '.js');\n if (fs.existsSync(resolved)) {\n return resolved;\n }\n }\n },\n load(id: string) {\n if (id === VIRTUAL_HTML_PATH) {\n return renderHtml();\n }\n },\n };\n}\n\n/*\n * Resolve the HTML template, mirroring webpack HtmlWebpackPlugin's \"auto\" default:\n * an explicit override wins, then a project template (index.ejs, then index.html)\n * under the package source directory, then the built-in template. Eta renders .ejs\n * and .html identically, so the extension is a convention, not a syntax switch.\n */\nfunction resolveTemplatePath(context: ViteBuildContext): string {\n const { template } = context.bundlerConfig.pluginOverrides.html ?? {};\n if (template) {\n return path.resolve(template);\n }\n\n const projectTemplate = ['index.ejs', 'index.html']\n .map(file => path.resolve(context.package.source, file))\n .find(file => fs.existsSync(file));\n\n return projectTemplate ?? path.resolve(__dirname, '../index.html');\n}\n"],"names":["htmlPlugin","context","name","isProduction","build","isWebComponent","package","css","js","getSharedEntryPoints","pluginOverrides","bundlerConfig","htmlTemplatePath","resolveTemplatePath","eta","Eta","views","path","dirname","detectedFavicon","renderHtml","render","basename","title","html","favicon","INDEX_HTML","VIRTUAL_HTML_PATH","resolve","configResolved","config","publicDir","fs","existsSync","join","configureServer","server","middlewares","use","req","res","next","url","endsWith","transformIndexHtml","end","resolveId","source","importer","includes","startsWith","resolved","load","id","template","projectTemplate","map","file","find","__dirname"],"mappings":";;;;+BAOgBA;;;eAAAA;;;qBAPI;2DACL;6DACE;sBAEoB;;;;;;AAG9B,SAASA,WAAWC,OAAyB;IAChD,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAE,GAAGF,QAAQG,KAAK;IAC5C,MAAM,EAAEC,cAAc,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/plugins/html-plugin.ts"],"sourcesContent":["import { Eta } from 'eta';\nimport fs from 'fs';\nimport path from 'path';\nimport type { Plugin } from 'vite';\nimport { getSharedEntryPoints } from '../../core';\nimport { ViteBuildContext } from '../types';\n\nexport function htmlPlugin(context: ViteBuildContext): Plugin {\n const { name, isProduction } = context.build;\n const { isWebComponent, destination } = context.package;\n const { css, js } = getSharedEntryPoints(context);\n const { pluginOverrides } = context.bundlerConfig;\n\n const htmlTemplatePath = resolveTemplatePath(context);\n\n const eta = new Eta({ views: path.dirname(htmlTemplatePath) });\n\n let detectedFavicon: string | undefined;\n\n function renderHtml() {\n return eta.render(path.basename(htmlTemplatePath), {\n title: pluginOverrides.html?.title ?? 'ServiceTitan',\n favicon: pluginOverrides.html?.favicon ?? detectedFavicon,\n css,\n js,\n isProduction,\n isWebComponent,\n name,\n tsOutDir: destination,\n });\n }\n\n /*\n * Virtual entry point for the HTML module. The file doesn't exist on disk —\n * resolveId claims this path and load returns Eta-rendered HTML.\n *\n * Uses an absolute path (e.g., /path/to/project/index.html) instead of a\n * synthetic prefix because Vite resolves asset references in HTML (favicon,\n * CSS links) relative to the HTML file's directory. A non-filesystem path\n * would break those references.\n */\n const INDEX_HTML = 'index.html';\n const VIRTUAL_HTML_PATH = path.resolve(INDEX_HTML);\n\n return {\n name: 'st:html',\n /*\n * Auto-detect favicon.ico in vite's publicDir so projects following\n * the convention get a working favicon link without explicit config.\n */\n configResolved(config) {\n if (config.publicDir && fs.existsSync(path.join(config.publicDir, 'favicon.ico'))) {\n detectedFavicon = '/favicon.ico';\n }\n },\n /*\n * Dev server serves HTML via middleware (load is not called in dev mode).\n * Returns a callback so middleware registers after Vite's built-in middleware.\n */\n configureServer(server) {\n return () => {\n server.middlewares.use(async (req, res, next) => {\n if (!req.url?.endsWith(INDEX_HTML)) {\n return next();\n }\n let html = renderHtml();\n html = await server.transformIndexHtml(req.url, html);\n res.setHeader('Content-Type', 'text/html');\n res.end(html);\n });\n };\n },\n resolveId(source: string, importer: string | undefined) {\n /*\n * Claim the HTML entry so Vite doesn't look for it on disk (it's virtual, rendered by Eta).\n * Only needed for production builds — dev mode serves HTML via configureServer middleware.\n */\n if (source === VIRTUAL_HTML_PATH) {\n return VIRTUAL_HTML_PATH;\n }\n if (importer?.includes(INDEX_HTML) && source.startsWith('.')) {\n const resolved = path.resolve(source + '.js');\n if (fs.existsSync(resolved)) {\n return resolved;\n }\n }\n },\n load(id: string) {\n if (id === VIRTUAL_HTML_PATH) {\n return renderHtml();\n }\n },\n };\n}\n\n/*\n * Resolve the HTML template, mirroring webpack HtmlWebpackPlugin's \"auto\" default:\n * an explicit override wins, then a project template (index.ejs, then index.html)\n * under the package source directory, then the built-in template. Eta renders .ejs\n * and .html identically, so the extension is a convention, not a syntax switch.\n */\nfunction resolveTemplatePath(context: ViteBuildContext): string {\n const { template } = context.bundlerConfig.pluginOverrides.html ?? {};\n if (template) {\n return path.resolve(template);\n }\n\n const projectTemplate = ['index.ejs', 'index.html']\n .map(file => path.resolve(context.package.source, file))\n .find(file => fs.existsSync(file));\n\n return projectTemplate ?? path.resolve(__dirname, '../index.html');\n}\n"],"names":["htmlPlugin","context","name","isProduction","build","isWebComponent","destination","package","css","js","getSharedEntryPoints","pluginOverrides","bundlerConfig","htmlTemplatePath","resolveTemplatePath","eta","Eta","views","path","dirname","detectedFavicon","renderHtml","render","basename","title","html","favicon","tsOutDir","INDEX_HTML","VIRTUAL_HTML_PATH","resolve","configResolved","config","publicDir","fs","existsSync","join","configureServer","server","middlewares","use","req","res","next","url","endsWith","transformIndexHtml","setHeader","end","resolveId","source","importer","includes","startsWith","resolved","load","id","template","projectTemplate","map","file","find","__dirname"],"mappings":";;;;+BAOgBA;;;eAAAA;;;qBAPI;2DACL;6DACE;sBAEoB;;;;;;AAG9B,SAASA,WAAWC,OAAyB;IAChD,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAE,GAAGF,QAAQG,KAAK;IAC5C,MAAM,EAAEC,cAAc,EAAEC,WAAW,EAAE,GAAGL,QAAQM,OAAO;IACvD,MAAM,EAAEC,GAAG,EAAEC,EAAE,EAAE,GAAGC,IAAAA,0BAAoB,EAACT;IACzC,MAAM,EAAEU,eAAe,EAAE,GAAGV,QAAQW,aAAa;IAEjD,MAAMC,mBAAmBC,oBAAoBb;IAE7C,MAAMc,MAAM,IAAIC,QAAG,CAAC;QAAEC,OAAOC,aAAI,CAACC,OAAO,CAACN;IAAkB;IAE5D,IAAIO;IAEJ,SAASC;;YAEMV,uBACEA;QAFb,OAAOI,IAAIO,MAAM,CAACJ,aAAI,CAACK,QAAQ,CAACV,mBAAmB;YAC/CW,KAAK,WAAEb,wBAAAA,gBAAgBc,IAAI,cAApBd,4CAAAA,sBAAsBa,KAAK,uCAAI;YACtCE,OAAO,YAAEf,yBAAAA,gBAAgBc,IAAI,cAApBd,6CAAAA,uBAAsBe,OAAO,yCAAIN;YAC1CZ;YACAC;YACAN;YACAE;YACAH;YACAyB,UAAUrB;QACd;IACJ;IAEA;;;;;;;;KAQC,GACD,MAAMsB,aAAa;IACnB,MAAMC,oBAAoBX,aAAI,CAACY,OAAO,CAACF;IAEvC,OAAO;QACH1B,MAAM;QACN;;;SAGC,GACD6B,gBAAeC,MAAM;YACjB,IAAIA,OAAOC,SAAS,IAAIC,WAAE,CAACC,UAAU,CAACjB,aAAI,CAACkB,IAAI,CAACJ,OAAOC,SAAS,EAAE,iBAAiB;gBAC/Eb,kBAAkB;YACtB;QACJ;QACA;;;SAGC,GACDiB,iBAAgBC,MAAM;YAClB,OAAO;gBACHA,OAAOC,WAAW,CAACC,GAAG,CAAC,OAAOC,KAAKC,KAAKC;wBAC/BF;oBAAL,IAAI,GAACA,WAAAA,IAAIG,GAAG,cAAPH,+BAAAA,SAASI,QAAQ,CAACjB,cAAa;wBAChC,OAAOe;oBACX;oBACA,IAAIlB,OAAOJ;oBACXI,OAAO,MAAMa,OAAOQ,kBAAkB,CAACL,IAAIG,GAAG,EAAEnB;oBAChDiB,IAAIK,SAAS,CAAC,gBAAgB;oBAC9BL,IAAIM,GAAG,CAACvB;gBACZ;YACJ;QACJ;QACAwB,WAAUC,MAAc,EAAEC,QAA4B;YAClD;;;aAGC,GACD,IAAID,WAAWrB,mBAAmB;gBAC9B,OAAOA;YACX;YACA,IAAIsB,CAAAA,qBAAAA,+BAAAA,SAAUC,QAAQ,CAACxB,gBAAesB,OAAOG,UAAU,CAAC,MAAM;gBAC1D,MAAMC,WAAWpC,aAAI,CAACY,OAAO,CAACoB,SAAS;gBACvC,IAAIhB,WAAE,CAACC,UAAU,CAACmB,WAAW;oBACzB,OAAOA;gBACX;YACJ;QACJ;QACAC,MAAKC,EAAU;YACX,IAAIA,OAAO3B,mBAAmB;gBAC1B,OAAOR;YACX;QACJ;IACJ;AACJ;AAEA;;;;;CAKC,GACD,SAASP,oBAAoBb,OAAyB;QAC7BA;IAArB,MAAM,EAAEwD,QAAQ,EAAE,IAAGxD,8CAAAA,QAAQW,aAAa,CAACD,eAAe,CAACc,IAAI,cAA1CxB,yDAAAA,8CAA8C,CAAC;IACpE,IAAIwD,UAAU;QACV,OAAOvC,aAAI,CAACY,OAAO,CAAC2B;IACxB;IAEA,MAAMC,kBAAkB;QAAC;QAAa;KAAa,CAC9CC,GAAG,CAACC,CAAAA,OAAQ1C,aAAI,CAACY,OAAO,CAAC7B,QAAQM,OAAO,CAAC2C,MAAM,EAAEU,OACjDC,IAAI,CAACD,CAAAA,OAAQ1B,WAAE,CAACC,UAAU,CAACyB;IAEhC,OAAOF,4BAAAA,6BAAAA,kBAAmBxC,aAAI,CAACY,OAAO,CAACgC,WAAW;AACtD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
import type { PackageContext } from '../../core/types';
|
|
3
|
-
export declare const THROW_PREFIX = "\
|
|
4
|
-
export declare const EMPTY_PREFIX = "\
|
|
3
|
+
export declare const THROW_PREFIX = "\0ignore-modules:throw:";
|
|
4
|
+
export declare const EMPTY_PREFIX = "\0ignore-modules:empty:";
|
|
5
5
|
/**
|
|
6
6
|
* Handles optional peer dependencies that are not installed.
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-modules-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/ignore-modules-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ignore-modules-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/ignore-modules-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,eAAO,MAAM,YAAY,4BAA4B,CAAC;AACtD,eAAO,MAAM,YAAY,4BAA4B,CAAC;AAEtD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IACzC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;CACjD,GAAG,MAAM,CAmCT"}
|
|
@@ -20,36 +20,48 @@ _export(exports, {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _core = require("../../core");
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const VIRTUAL_PREFIX = '\0ignore-modules:';
|
|
24
|
+
const VIRTUAL_ID_PATTERN = new RegExp(`^${VIRTUAL_PREFIX}`);
|
|
25
|
+
const THROW_PREFIX = `${VIRTUAL_PREFIX}throw:`;
|
|
26
|
+
const EMPTY_PREFIX = `${VIRTUAL_PREFIX}empty:`;
|
|
25
27
|
function ignoreModulesPlugin(context) {
|
|
26
28
|
const checker = (0, _core.checkResource)(context);
|
|
27
29
|
return {
|
|
28
|
-
name: 'ignore-modules',
|
|
30
|
+
name: 'st:ignore-modules',
|
|
29
31
|
enforce: 'pre',
|
|
30
|
-
resolveId
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
resolveId: {
|
|
33
|
+
filter: {
|
|
34
|
+
id: /^[@a-z]/
|
|
35
|
+
},
|
|
36
|
+
handler (source, importer) {
|
|
37
|
+
if (!importer) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const mode = checker({
|
|
41
|
+
resource: source,
|
|
42
|
+
importer
|
|
43
|
+
});
|
|
44
|
+
if (mode === 'throw') {
|
|
45
|
+
return `${THROW_PREFIX}${source}`;
|
|
46
|
+
}
|
|
47
|
+
if (mode === 'empty') {
|
|
48
|
+
return `${EMPTY_PREFIX}${source}`;
|
|
49
|
+
}
|
|
43
50
|
}
|
|
44
51
|
},
|
|
45
|
-
load
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
load: {
|
|
53
|
+
filter: {
|
|
54
|
+
id: VIRTUAL_ID_PATTERN
|
|
55
|
+
},
|
|
56
|
+
handler (id) {
|
|
57
|
+
if (id.startsWith(THROW_PREFIX)) {
|
|
58
|
+
const source = id.slice(THROW_PREFIX.length);
|
|
59
|
+
const message = JSON.stringify(`Cannot find module '${source}'`);
|
|
60
|
+
return `throw Object.assign(new Error(${message}), { code: 'MODULE_NOT_FOUND' });`;
|
|
61
|
+
}
|
|
62
|
+
if (id.startsWith(EMPTY_PREFIX)) {
|
|
63
|
+
return 'export {};';
|
|
64
|
+
}
|
|
53
65
|
}
|
|
54
66
|
}
|
|
55
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/ignore-modules-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { checkResource } from '../../core';\nimport type { PackageContext } from '../../core/types';\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/plugins/ignore-modules-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { checkResource } from '../../core';\nimport type { PackageContext } from '../../core/types';\n\nconst VIRTUAL_PREFIX = '\\0ignore-modules:';\nconst VIRTUAL_ID_PATTERN = new RegExp(`^${VIRTUAL_PREFIX}`);\n\nexport const THROW_PREFIX = `${VIRTUAL_PREFIX}throw:`;\nexport const EMPTY_PREFIX = `${VIRTUAL_PREFIX}empty:`;\n\n/**\n * Handles optional peer dependencies that are not installed.\n *\n * @see {@link file://./../../webpack/configs/plugins/ignore-plugin/ignore-plugin.ts} for the webpack counterpart.\n *\n * 'throw' mode: substitutes a virtual module whose body throws \"Cannot find module\" on\n * evaluation. Mirrors webpack's `webpackMissingModule()` semantics. Top-level static\n * imports of the resource crash module evaluation, and `try { await import(...) } catch {}`\n * (or `try { require(...) } catch {}` in CJS code Rolldown bundles) work as expected.\n * This is the default for matched optional peers.\n *\n * 'empty' mode: substitutes a virtual module with no exports. Required for top-level\n * `import * as X from 'optional'` followed by `X.foo === undefined` detection. Opt in via\n * `cli.peerDependenciesMeta[\"pkg\"].fallback = \"empty\"` in the importer's package.json.\n */\nexport function ignoreModulesPlugin(context: {\n package: Pick<PackageContext, 'dependencies'>;\n}): Plugin {\n const checker = checkResource(context);\n\n return {\n name: 'st:ignore-modules',\n enforce: 'pre',\n resolveId: {\n filter: { id: /^[@a-z]/ }, // Only bare specifiers can be optional peers\n handler(source, importer) {\n if (!importer) {\n return;\n }\n const mode = checker({ resource: source, importer });\n if (mode === 'throw') {\n return `${THROW_PREFIX}${source}`;\n }\n if (mode === 'empty') {\n return `${EMPTY_PREFIX}${source}`;\n }\n },\n },\n load: {\n filter: { id: VIRTUAL_ID_PATTERN },\n handler(id) {\n if (id.startsWith(THROW_PREFIX)) {\n const source = id.slice(THROW_PREFIX.length);\n const message = JSON.stringify(`Cannot find module '${source}'`);\n return `throw Object.assign(new Error(${message}), { code: 'MODULE_NOT_FOUND' });`;\n }\n if (id.startsWith(EMPTY_PREFIX)) {\n return 'export {};';\n }\n },\n },\n };\n}\n"],"names":["EMPTY_PREFIX","THROW_PREFIX","ignoreModulesPlugin","VIRTUAL_PREFIX","VIRTUAL_ID_PATTERN","RegExp","context","checker","checkResource","name","enforce","resolveId","filter","id","handler","source","importer","mode","resource","load","startsWith","slice","length","message","JSON","stringify"],"mappings":";;;;;;;;;;;QAQaA;eAAAA;;QADAC;eAAAA;;QAkBGC;eAAAA;;;sBAxBc;AAG9B,MAAMC,iBAAiB;AACvB,MAAMC,qBAAqB,IAAIC,OAAO,CAAC,CAAC,EAAEF,gBAAgB;AAEnD,MAAMF,eAAe,GAAGE,eAAe,MAAM,CAAC;AAC9C,MAAMH,eAAe,GAAGG,eAAe,MAAM,CAAC;AAiB9C,SAASD,oBAAoBI,OAEnC;IACG,MAAMC,UAAUC,IAAAA,mBAAa,EAACF;IAE9B,OAAO;QACHG,MAAM;QACNC,SAAS;QACTC,WAAW;YACPC,QAAQ;gBAAEC,IAAI;YAAU;YACxBC,SAAQC,MAAM,EAAEC,QAAQ;gBACpB,IAAI,CAACA,UAAU;oBACX;gBACJ;gBACA,MAAMC,OAAOV,QAAQ;oBAAEW,UAAUH;oBAAQC;gBAAS;gBAClD,IAAIC,SAAS,SAAS;oBAClB,OAAO,GAAGhB,eAAec,QAAQ;gBACrC;gBACA,IAAIE,SAAS,SAAS;oBAClB,OAAO,GAAGjB,eAAee,QAAQ;gBACrC;YACJ;QACJ;QACAI,MAAM;YACFP,QAAQ;gBAAEC,IAAIT;YAAmB;YACjCU,SAAQD,EAAE;gBACN,IAAIA,GAAGO,UAAU,CAACnB,eAAe;oBAC7B,MAAMc,SAASF,GAAGQ,KAAK,CAACpB,aAAaqB,MAAM;oBAC3C,MAAMC,UAAUC,KAAKC,SAAS,CAAC,CAAC,oBAAoB,EAAEV,OAAO,CAAC,CAAC;oBAC/D,OAAO,CAAC,8BAA8B,EAAEQ,QAAQ,iCAAiC,CAAC;gBACtF;gBACA,IAAIV,GAAGO,UAAU,CAACpB,eAAe;oBAC7B,OAAO;gBACX;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -8,10 +8,13 @@ export * from './externals-plugin';
|
|
|
8
8
|
export * from './html-plugin';
|
|
9
9
|
export * from './ignore-modules-plugin';
|
|
10
10
|
export * from './istanbul-plugin';
|
|
11
|
+
export * from './less-tilde-plugin';
|
|
11
12
|
export * from './magic-comments-plugin';
|
|
12
13
|
export * from './metadata-plugin';
|
|
13
14
|
export * from './moment-locales-plugin';
|
|
15
|
+
export * from './react-refresh-plugin';
|
|
14
16
|
export * from './style-urls-plugin';
|
|
15
17
|
export * from './svgr-plugin';
|
|
16
18
|
export * from './virtual-modules-plugin';
|
|
19
|
+
export * from './window-externals-plugin';
|
|
17
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
|
|
@@ -12,12 +12,15 @@ _export_star(require("./externals-plugin"), exports);
|
|
|
12
12
|
_export_star(require("./html-plugin"), exports);
|
|
13
13
|
_export_star(require("./ignore-modules-plugin"), exports);
|
|
14
14
|
_export_star(require("./istanbul-plugin"), exports);
|
|
15
|
+
_export_star(require("./less-tilde-plugin"), exports);
|
|
15
16
|
_export_star(require("./magic-comments-plugin"), exports);
|
|
16
17
|
_export_star(require("./metadata-plugin"), exports);
|
|
17
18
|
_export_star(require("./moment-locales-plugin"), exports);
|
|
19
|
+
_export_star(require("./react-refresh-plugin"), exports);
|
|
18
20
|
_export_star(require("./style-urls-plugin"), exports);
|
|
19
21
|
_export_star(require("./svgr-plugin"), exports);
|
|
20
22
|
_export_star(require("./virtual-modules-plugin"), exports);
|
|
23
|
+
_export_star(require("./window-externals-plugin"), exports);
|
|
21
24
|
function _export_star(from, to) {
|
|
22
25
|
Object.keys(from).forEach(function(k) {
|
|
23
26
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/index.ts"],"sourcesContent":["export * from './bundle-stat-plugin';\nexport * from './chain-source-maps-plugin';\nexport * from './clean-plugin';\nexport * from './css-injector-plugin';\nexport * from './design-system-guard-plugin';\nexport * from './dev-server-routing-plugin';\nexport * from './externals-plugin';\nexport * from './html-plugin';\nexport * from './ignore-modules-plugin';\nexport * from './istanbul-plugin';\nexport * from './magic-comments-plugin';\nexport * from './metadata-plugin';\nexport * from './moment-locales-plugin';\nexport * from './style-urls-plugin';\nexport * from './svgr-plugin';\nexport * from './virtual-modules-plugin';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/plugins/index.ts"],"sourcesContent":["export * from './bundle-stat-plugin';\nexport * from './chain-source-maps-plugin';\nexport * from './clean-plugin';\nexport * from './css-injector-plugin';\nexport * from './design-system-guard-plugin';\nexport * from './dev-server-routing-plugin';\nexport * from './externals-plugin';\nexport * from './html-plugin';\nexport * from './ignore-modules-plugin';\nexport * from './istanbul-plugin';\nexport * from './less-tilde-plugin';\nexport * from './magic-comments-plugin';\nexport * from './metadata-plugin';\nexport * from './moment-locales-plugin';\nexport * from './react-refresh-plugin';\nexport * from './style-urls-plugin';\nexport * from './svgr-plugin';\nexport * from './virtual-modules-plugin';\nexport * from './window-externals-plugin';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"less-tilde-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/less-tilde-plugin.ts"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACvB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C;AAQD,wBAAgB,eAAe;kBAET,GAAG,iBAAiB,iBAAiB;EAK1D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "lessTildePlugin", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return lessTildePlugin;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
+
const _utils = require("../../utils");
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function lessTildePlugin() {
|
|
20
|
+
return {
|
|
21
|
+
install (less, pluginManager) {
|
|
22
|
+
const TildeFileManager = createTildeFileManager(less);
|
|
23
|
+
pluginManager.addFileManager(new TildeFileManager());
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/*
|
|
28
|
+
* A FileManager subclass bound to the Less instance Vite passes to the plugin. It claims `~`
|
|
29
|
+
* imports and rewrites them to a node_modules path before delegating to the base loader.
|
|
30
|
+
*/ function createTildeFileManager(less) {
|
|
31
|
+
return class extends less.FileManager {
|
|
32
|
+
supports(filename) {
|
|
33
|
+
return filename.startsWith('~');
|
|
34
|
+
}
|
|
35
|
+
loadFile(filename, currentDirectory, options, environment) {
|
|
36
|
+
return super.loadFile(resolveFromNodeModules(filename.slice(1), currentDirectory), currentDirectory, options, environment);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/*
|
|
41
|
+
* Resolve a bare `pkg/path` specifier against the nearest node_modules, walking up from the
|
|
42
|
+
* importing file's directory, so the import binds to the importer's dependencies (matching
|
|
43
|
+
* webpack, and covering both pnpm's symlinked store and npm's hoisted tree).
|
|
44
|
+
*/ function resolveFromNodeModules(specifier, fromDirectory) {
|
|
45
|
+
const withExtension = _path.default.extname(specifier) ? specifier : `${specifier}.less`;
|
|
46
|
+
const resolved = (0, _utils.findUp)((directory)=>{
|
|
47
|
+
const candidate = _path.default.join(directory, 'node_modules', withExtension);
|
|
48
|
+
return _fs.default.existsSync(candidate) ? candidate : undefined;
|
|
49
|
+
}, fromDirectory);
|
|
50
|
+
return resolved !== null && resolved !== void 0 ? resolved : withExtension;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=less-tilde-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/plugins/less-tilde-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { findUp } from '../../utils';\n\ninterface LessPluginManager {\n addFileManager(manager: unknown): void;\n}\n\n/*\n * Less plugin that resolves webpack-style `~pkg` imports (e.g. `~@servicetitan/tokens/...`) from\n * node_modules. Vite's Less integration does not understand the `~` prefix, so without this every\n * style importing a package with `~` fails to resolve. Mirrors the old less-loader behavior to\n * ease webpack-to-Vite migration.\n */\nexport function lessTildePlugin() {\n return {\n install(less: any, pluginManager: LessPluginManager) {\n const TildeFileManager = createTildeFileManager(less);\n pluginManager.addFileManager(new TildeFileManager());\n },\n };\n}\n\n/*\n * A FileManager subclass bound to the Less instance Vite passes to the plugin. It claims `~`\n * imports and rewrites them to a node_modules path before delegating to the base loader.\n */\nfunction createTildeFileManager(less: any) {\n return class extends less.FileManager {\n supports(filename: string) {\n return filename.startsWith('~');\n }\n\n loadFile(\n filename: string,\n currentDirectory: string,\n options: unknown,\n environment: unknown\n ) {\n return super.loadFile(\n resolveFromNodeModules(filename.slice(1), currentDirectory),\n currentDirectory,\n options,\n environment\n );\n }\n };\n}\n\n/*\n * Resolve a bare `pkg/path` specifier against the nearest node_modules, walking up from the\n * importing file's directory, so the import binds to the importer's dependencies (matching\n * webpack, and covering both pnpm's symlinked store and npm's hoisted tree).\n */\nfunction resolveFromNodeModules(specifier: string, fromDirectory: string): string {\n const withExtension = path.extname(specifier) ? specifier : `${specifier}.less`;\n\n const resolved = findUp(directory => {\n const candidate = path.join(directory, 'node_modules', withExtension);\n return fs.existsSync(candidate) ? candidate : undefined;\n }, fromDirectory);\n\n return resolved ?? withExtension;\n}\n"],"names":["lessTildePlugin","install","less","pluginManager","TildeFileManager","createTildeFileManager","addFileManager","FileManager","supports","filename","startsWith","loadFile","currentDirectory","options","environment","resolveFromNodeModules","slice","specifier","fromDirectory","withExtension","path","extname","resolved","findUp","directory","candidate","join","fs","existsSync","undefined"],"mappings":";;;;+BAcgBA;;;eAAAA;;;2DAdD;6DACE;uBACM;;;;;;AAYhB,SAASA;IACZ,OAAO;QACHC,SAAQC,IAAS,EAAEC,aAAgC;YAC/C,MAAMC,mBAAmBC,uBAAuBH;YAChDC,cAAcG,cAAc,CAAC,IAAIF;QACrC;IACJ;AACJ;AAEA;;;CAGC,GACD,SAASC,uBAAuBH,IAAS;IACrC,OAAO,cAAcA,KAAKK,WAAW;QACjCC,SAASC,QAAgB,EAAE;YACvB,OAAOA,SAASC,UAAU,CAAC;QAC/B;QAEAC,SACIF,QAAgB,EAChBG,gBAAwB,EACxBC,OAAgB,EAChBC,WAAoB,EACtB;YACE,OAAO,KAAK,CAACH,SACTI,uBAAuBN,SAASO,KAAK,CAAC,IAAIJ,mBAC1CA,kBACAC,SACAC;QAER;IACJ;AACJ;AAEA;;;;CAIC,GACD,SAASC,uBAAuBE,SAAiB,EAAEC,aAAqB;IACpE,MAAMC,gBAAgBC,aAAI,CAACC,OAAO,CAACJ,aAAaA,YAAY,GAAGA,UAAU,KAAK,CAAC;IAE/E,MAAMK,WAAWC,IAAAA,aAAM,EAACC,CAAAA;QACpB,MAAMC,YAAYL,aAAI,CAACM,IAAI,CAACF,WAAW,gBAAgBL;QACvD,OAAOQ,WAAE,CAACC,UAAU,CAACH,aAAaA,YAAYI;IAClD,GAAGX;IAEH,OAAOI,qBAAAA,sBAAAA,WAAYH;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { ViteBuildContext } from '../../types';\nimport { parseMagicComments } from './parse-magic-comments';\n\n/* Mirrors Vite's default chunk file naming. A magic comment only substitutes the [name] token. */\nconst CHUNK_FILE_NAME = 'assets/[name]-[hash].js';\n\n/*\n * Honors `webpackChunkName` magic comments on dynamic imports. Vite splits dynamic\n * imports into separate chunks, named after the source file; this renames the chunk\n * to specified `webpackChunkName`. Warns when a name is reused by different modules.\n */\nexport function magicCommentsPlugin(context: ViteBuildContext): Plugin | undefined {\n if (!context.build.isProduction) {\n return;\n }\n\n const chunkNames = new Map<string, string>();\n const moduleByName = new Map<string, string>();\n\n return {\n name: 'magic-comments',\n apply: 'build',\n enforce: 'pre',\n config: () => ({\n build: {\n rolldownOptions: {\n output: {\n chunkFileNames: (chunk: { facadeModuleId?: string | null }) => {\n const name =\n chunk.facadeModuleId && chunkNames.get(chunk.facadeModuleId);\n return name ? CHUNK_FILE_NAME.replace('[name]', name) : CHUNK_FILE_NAME;\n },\n },\n },\n },\n }),\n transform: {\n filter: { id: { exclude: /node_modules/ }, code: 'webpackChunkName' },\n async handler(code, id) {\n const comments = await parseMagicComments(code);\n const resolved = await Promise.all(\n comments.map(({ importPath }) => this.resolve(importPath, id))\n );\n comments.forEach(({ chunkName }, index) => {\n const module = resolved[index];\n if (!module) {\n return;\n }\n const claimedBy = moduleByName.get(chunkName);\n if (claimedBy && claimedBy !== module.id) {\n this.warn(\n `webpackChunkName \"${chunkName}\" is used by multiple modules; Vite emits a separate chunk for each rather than merging them.`\n );\n } else {\n moduleByName.set(chunkName, module.id);\n }\n chunkNames.set(module.id, chunkName);\n });\n },\n },\n };\n}\n"],"names":["magicCommentsPlugin","CHUNK_FILE_NAME","context","build","isProduction","chunkNames","Map","moduleByName","name","apply","enforce","config","rolldownOptions","output","chunkFileNames","chunk","facadeModuleId","get","replace","transform","filter","id","exclude","code","handler","comments","parseMagicComments","resolved","Promise","all","map","importPath","resolve","forEach","chunkName","index","module","claimedBy","warn","set"],"mappings":";;;;+BAYgBA;;;eAAAA;;;oCAVmB;AAEnC,gGAAgG,GAChG,MAAMC,kBAAkB;AAOjB,SAASD,oBAAoBE,OAAyB;IACzD,IAAI,CAACA,QAAQC,KAAK,CAACC,YAAY,EAAE;QAC7B;IACJ;IAEA,MAAMC,aAAa,IAAIC;IACvB,MAAMC,eAAe,IAAID;IAEzB,OAAO;QACHE,MAAM;QACNC,OAAO;QACPC,SAAS;QACTC,QAAQ,IAAO,CAAA;gBACXR,OAAO;oBACHS,iBAAiB;wBACbC,QAAQ;4BACJC,gBAAgB,CAACC;gCACb,MAAMP,OACFO,MAAMC,cAAc,IAAIX,WAAWY,GAAG,CAACF,MAAMC,cAAc;gCAC/D,OAAOR,OAAOP,gBAAgBiB,OAAO,CAAC,UAAUV,QAAQP;4BAC5D;wBACJ;oBACJ;gBACJ;YACJ,CAAA;QACAkB,WAAW;YACPC,QAAQ;gBAAEC,IAAI;oBAAEC,SAAS;gBAAe;gBAAGC,MAAM;YAAmB;YACpE,MAAMC,SAAQD,IAAI,EAAEF,EAAE;gBAClB,MAAMI,WAAW,MAAMC,IAAAA,sCAAkB,EAACH;gBAC1C,MAAMI,WAAW,MAAMC,QAAQC,GAAG,CAC9BJ,SAASK,GAAG,CAAC,CAAC,EAAEC,UAAU,EAAE,GAAK,IAAI,CAACC,OAAO,CAACD,YAAYV;gBAE9DI,SAASQ,OAAO,CAAC,CAAC,EAAEC,SAAS,EAAE,EAAEC;oBAC7B,MAAMC,SAAST,QAAQ,CAACQ,MAAM;oBAC9B,IAAI,CAACC,QAAQ;wBACT;oBACJ;oBACA,MAAMC,YAAY9B,aAAaU,GAAG,CAACiB;oBACnC,IAAIG,aAAaA,cAAcD,OAAOf,EAAE,EAAE;wBACtC,IAAI,CAACiB,IAAI,CACL,CAAC,kBAAkB,EAAEJ,UAAU,6FAA6F,CAAC;oBAErI,OAAO;wBACH3B,aAAagC,GAAG,CAACL,WAAWE,OAAOf,EAAE;oBACzC;oBACAhB,WAAWkC,GAAG,CAACH,OAAOf,EAAE,EAAEa;gBAC9B;YACJ;QACJ;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/vite/plugins/magic-comments-plugin/magic-comments-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { ViteBuildContext } from '../../types';\nimport { parseMagicComments } from './parse-magic-comments';\n\n/* Mirrors Vite's default chunk file naming. A magic comment only substitutes the [name] token. */\nconst CHUNK_FILE_NAME = 'assets/[name]-[hash].js';\n\n/*\n * Honors `webpackChunkName` magic comments on dynamic imports. Vite splits dynamic\n * imports into separate chunks, named after the source file; this renames the chunk\n * to specified `webpackChunkName`. Warns when a name is reused by different modules.\n */\nexport function magicCommentsPlugin(context: ViteBuildContext): Plugin | undefined {\n if (!context.build.isProduction) {\n return;\n }\n\n const chunkNames = new Map<string, string>();\n const moduleByName = new Map<string, string>();\n\n return {\n name: 'st:magic-comments',\n apply: 'build',\n enforce: 'pre',\n config: () => ({\n build: {\n rolldownOptions: {\n output: {\n chunkFileNames: (chunk: { facadeModuleId?: string | null }) => {\n const name =\n chunk.facadeModuleId && chunkNames.get(chunk.facadeModuleId);\n return name ? CHUNK_FILE_NAME.replace('[name]', name) : CHUNK_FILE_NAME;\n },\n },\n },\n },\n }),\n transform: {\n filter: { id: { exclude: /node_modules/ }, code: 'webpackChunkName' },\n async handler(code, id) {\n const comments = await parseMagicComments(code);\n const resolved = await Promise.all(\n comments.map(({ importPath }) => this.resolve(importPath, id))\n );\n comments.forEach(({ chunkName }, index) => {\n const module = resolved[index];\n if (!module) {\n return;\n }\n const claimedBy = moduleByName.get(chunkName);\n if (claimedBy && claimedBy !== module.id) {\n this.warn(\n `webpackChunkName \"${chunkName}\" is used by multiple modules; Vite emits a separate chunk for each rather than merging them.`\n );\n } else {\n moduleByName.set(chunkName, module.id);\n }\n chunkNames.set(module.id, chunkName);\n });\n },\n },\n };\n}\n"],"names":["magicCommentsPlugin","CHUNK_FILE_NAME","context","build","isProduction","chunkNames","Map","moduleByName","name","apply","enforce","config","rolldownOptions","output","chunkFileNames","chunk","facadeModuleId","get","replace","transform","filter","id","exclude","code","handler","comments","parseMagicComments","resolved","Promise","all","map","importPath","resolve","forEach","chunkName","index","module","claimedBy","warn","set"],"mappings":";;;;+BAYgBA;;;eAAAA;;;oCAVmB;AAEnC,gGAAgG,GAChG,MAAMC,kBAAkB;AAOjB,SAASD,oBAAoBE,OAAyB;IACzD,IAAI,CAACA,QAAQC,KAAK,CAACC,YAAY,EAAE;QAC7B;IACJ;IAEA,MAAMC,aAAa,IAAIC;IACvB,MAAMC,eAAe,IAAID;IAEzB,OAAO;QACHE,MAAM;QACNC,OAAO;QACPC,SAAS;QACTC,QAAQ,IAAO,CAAA;gBACXR,OAAO;oBACHS,iBAAiB;wBACbC,QAAQ;4BACJC,gBAAgB,CAACC;gCACb,MAAMP,OACFO,MAAMC,cAAc,IAAIX,WAAWY,GAAG,CAACF,MAAMC,cAAc;gCAC/D,OAAOR,OAAOP,gBAAgBiB,OAAO,CAAC,UAAUV,QAAQP;4BAC5D;wBACJ;oBACJ;gBACJ;YACJ,CAAA;QACAkB,WAAW;YACPC,QAAQ;gBAAEC,IAAI;oBAAEC,SAAS;gBAAe;gBAAGC,MAAM;YAAmB;YACpE,MAAMC,SAAQD,IAAI,EAAEF,EAAE;gBAClB,MAAMI,WAAW,MAAMC,IAAAA,sCAAkB,EAACH;gBAC1C,MAAMI,WAAW,MAAMC,QAAQC,GAAG,CAC9BJ,SAASK,GAAG,CAAC,CAAC,EAAEC,UAAU,EAAE,GAAK,IAAI,CAACC,OAAO,CAACD,YAAYV;gBAE9DI,SAASQ,OAAO,CAAC,CAAC,EAAEC,SAAS,EAAE,EAAEC;oBAC7B,MAAMC,SAAST,QAAQ,CAACQ,MAAM;oBAC9B,IAAI,CAACC,QAAQ;wBACT;oBACJ;oBACA,MAAMC,YAAY9B,aAAaU,GAAG,CAACiB;oBACnC,IAAIG,aAAaA,cAAcD,OAAOf,EAAE,EAAE;wBACtC,IAAI,CAACiB,IAAI,CACL,CAAC,kBAAkB,EAAEJ,UAAU,6FAA6F,CAAC;oBAErI,OAAO;wBACH3B,aAAagC,GAAG,CAACL,WAAWE,OAAOf,EAAE;oBACzC;oBACAhB,WAAWkC,GAAG,CAACH,OAAOf,EAAE,EAAEa;gBAC9B;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/metadata-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport type { Plugin } from 'vite';\nimport { BuildContext, generateMetadata } from '../../core';\nimport { getCssFileNames } from './utils';\n\nexport function metadataPlugin(context: BuildContext): Plugin | undefined {\n if (!context.package.isWebComponent) {\n return;\n }\n\n let outDir = '';\n\n return {\n name: 'metadata',\n configResolved(config) {\n outDir = config.build.outDir;\n },\n configureServer(server) {\n server.httpServer?.once('listening', () => {\n const address = server.httpServer?.address();\n if (!address || typeof address === 'string') {\n return;\n }\n\n const entrypoints = {\n module: true,\n port: address.port,\n css: [],\n js: ['@vite/client', '@id/__x00__VIRTUAL./index'],\n };\n\n const entrypointsPath = path.join(outDir, 'entrypoints.json');\n fs.mkdirSync(path.dirname(entrypointsPath), { recursive: true });\n fs.writeFileSync(entrypointsPath, JSON.stringify(entrypoints, null, 2));\n\n generateMetadata(context);\n });\n },\n writeBundle(options, bundle) {\n if (!options.dir) {\n throw new Error(\n 'web-component build requires output.dir — output.file is not supported'\n );\n }\n\n const js: string[] = [];\n\n for (const chunk of Object.values(bundle)) {\n if (chunk.type === 'chunk' && chunk.isEntry) {\n js.push(chunk.fileName);\n }\n }\n\n const css = getCssFileNames(bundle);\n\n fs.writeFileSync(\n path.join(options.dir, 'entrypoints.json'),\n JSON.stringify({ module: true, css, js }, null, 2)\n );\n\n generateMetadata(context);\n },\n };\n}\n"],"names":["metadataPlugin","context","package","isWebComponent","outDir","name","configResolved","config","build","configureServer","server","httpServer","once","address","entrypoints","module","port","css","js","entrypointsPath","path","join","fs","mkdirSync","dirname","recursive","writeFileSync","JSON","stringify","generateMetadata","writeBundle","options","bundle","dir","Error","chunk","Object","values","type","isEntry","push","fileName","getCssFileNames"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;sBAE8B;uBACf;;;;;;AAEzB,SAASA,eAAeC,OAAqB;IAChD,IAAI,CAACA,QAAQC,OAAO,CAACC,cAAc,EAAE;QACjC;IACJ;IAEA,IAAIC,SAAS;IAEb,OAAO;QACHC,MAAM;QACNC,gBAAeC,MAAM;YACjBH,SAASG,OAAOC,KAAK,CAACJ,MAAM;QAChC;QACAK,iBAAgBC,MAAM;gBAClBA;aAAAA,qBAAAA,OAAOC,UAAU,cAAjBD,yCAAAA,mBAAmBE,IAAI,CAAC,aAAa;oBACjBF;gBAAhB,MAAMG,WAAUH,qBAAAA,OAAOC,UAAU,cAAjBD,yCAAAA,mBAAmBG,OAAO;gBAC1C,IAAI,CAACA,WAAW,OAAOA,YAAY,UAAU;oBACzC;gBACJ;gBAEA,MAAMC,cAAc;oBAChBC,QAAQ;oBACRC,MAAMH,QAAQG,IAAI;oBAClBC,KAAK,EAAE;oBACPC,IAAI;wBAAC;wBAAgB;qBAA4B;gBACrD;gBAEA,MAAMC,kBAAkBC,aAAI,CAACC,IAAI,CAACjB,QAAQ;gBAC1CkB,WAAE,CAACC,SAAS,CAACH,aAAI,CAACI,OAAO,CAACL,kBAAkB;oBAAEM,WAAW;gBAAK;gBAC9DH,WAAE,CAACI,aAAa,CAACP,iBAAiBQ,KAAKC,SAAS,CAACd,aAAa,MAAM;gBAEpEe,IAAAA,sBAAgB,EAAC5B;YACrB;QACJ;QACA6B,aAAYC,OAAO,EAAEC,MAAM;YACvB,IAAI,CAACD,QAAQE,GAAG,EAAE;gBACd,MAAM,IAAIC,MACN;YAER;YAEA,MAAMhB,KAAe,EAAE;YAEvB,KAAK,MAAMiB,SAASC,OAAOC,MAAM,CAACL,QAAS;gBACvC,IAAIG,MAAMG,IAAI,KAAK,WAAWH,MAAMI,OAAO,EAAE;oBACzCrB,GAAGsB,IAAI,CAACL,MAAMM,QAAQ;gBAC1B;YACJ;YAEA,MAAMxB,MAAMyB,IAAAA,sBAAe,EAACV;YAE5BV,WAAE,CAACI,aAAa,CACZN,aAAI,CAACC,IAAI,CAACU,QAAQE,GAAG,EAAE,qBACvBN,KAAKC,SAAS,CAAC;gBAAEb,QAAQ;gBAAME;gBAAKC;YAAG,GAAG,MAAM;YAGpDW,IAAAA,sBAAgB,EAAC5B;QACrB;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/plugins/metadata-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport type { Plugin } from 'vite';\nimport { BuildContext, generateMetadata } from '../../core';\nimport { getCssFileNames } from './utils';\n\nexport function metadataPlugin(context: BuildContext): Plugin | undefined {\n if (!context.package.isWebComponent) {\n return;\n }\n\n let outDir = '';\n\n return {\n name: 'st:metadata',\n configResolved(config) {\n outDir = config.build.outDir;\n },\n configureServer(server) {\n server.httpServer?.once('listening', () => {\n const address = server.httpServer?.address();\n if (!address || typeof address === 'string') {\n return;\n }\n\n const entrypoints = {\n module: true,\n port: address.port,\n css: [],\n js: ['@vite/client', '@id/__x00__VIRTUAL./index'],\n };\n\n const entrypointsPath = path.join(outDir, 'entrypoints.json');\n fs.mkdirSync(path.dirname(entrypointsPath), { recursive: true });\n fs.writeFileSync(entrypointsPath, JSON.stringify(entrypoints, null, 2));\n\n generateMetadata(context);\n });\n },\n writeBundle(options, bundle) {\n if (!options.dir) {\n throw new Error(\n 'web-component build requires output.dir — output.file is not supported'\n );\n }\n\n const js: string[] = [];\n\n for (const chunk of Object.values(bundle)) {\n if (chunk.type === 'chunk' && chunk.isEntry) {\n js.push(chunk.fileName);\n }\n }\n\n const css = getCssFileNames(bundle);\n\n fs.writeFileSync(\n path.join(options.dir, 'entrypoints.json'),\n JSON.stringify({ module: true, css, js }, null, 2)\n );\n\n generateMetadata(context);\n },\n };\n}\n"],"names":["metadataPlugin","context","package","isWebComponent","outDir","name","configResolved","config","build","configureServer","server","httpServer","once","address","entrypoints","module","port","css","js","entrypointsPath","path","join","fs","mkdirSync","dirname","recursive","writeFileSync","JSON","stringify","generateMetadata","writeBundle","options","bundle","dir","Error","chunk","Object","values","type","isEntry","push","fileName","getCssFileNames"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;sBAE8B;uBACf;;;;;;AAEzB,SAASA,eAAeC,OAAqB;IAChD,IAAI,CAACA,QAAQC,OAAO,CAACC,cAAc,EAAE;QACjC;IACJ;IAEA,IAAIC,SAAS;IAEb,OAAO;QACHC,MAAM;QACNC,gBAAeC,MAAM;YACjBH,SAASG,OAAOC,KAAK,CAACJ,MAAM;QAChC;QACAK,iBAAgBC,MAAM;gBAClBA;aAAAA,qBAAAA,OAAOC,UAAU,cAAjBD,yCAAAA,mBAAmBE,IAAI,CAAC,aAAa;oBACjBF;gBAAhB,MAAMG,WAAUH,qBAAAA,OAAOC,UAAU,cAAjBD,yCAAAA,mBAAmBG,OAAO;gBAC1C,IAAI,CAACA,WAAW,OAAOA,YAAY,UAAU;oBACzC;gBACJ;gBAEA,MAAMC,cAAc;oBAChBC,QAAQ;oBACRC,MAAMH,QAAQG,IAAI;oBAClBC,KAAK,EAAE;oBACPC,IAAI;wBAAC;wBAAgB;qBAA4B;gBACrD;gBAEA,MAAMC,kBAAkBC,aAAI,CAACC,IAAI,CAACjB,QAAQ;gBAC1CkB,WAAE,CAACC,SAAS,CAACH,aAAI,CAACI,OAAO,CAACL,kBAAkB;oBAAEM,WAAW;gBAAK;gBAC9DH,WAAE,CAACI,aAAa,CAACP,iBAAiBQ,KAAKC,SAAS,CAACd,aAAa,MAAM;gBAEpEe,IAAAA,sBAAgB,EAAC5B;YACrB;QACJ;QACA6B,aAAYC,OAAO,EAAEC,MAAM;YACvB,IAAI,CAACD,QAAQE,GAAG,EAAE;gBACd,MAAM,IAAIC,MACN;YAER;YAEA,MAAMhB,KAAe,EAAE;YAEvB,KAAK,MAAMiB,SAASC,OAAOC,MAAM,CAACL,QAAS;gBACvC,IAAIG,MAAMG,IAAI,KAAK,WAAWH,MAAMI,OAAO,EAAE;oBACzCrB,GAAGsB,IAAI,CAACL,MAAMM,QAAQ;gBAC1B;YACJ;YAEA,MAAMxB,MAAMyB,IAAAA,sBAAe,EAACV;YAE5BV,WAAE,CAACI,aAAa,CACZN,aAAI,CAACC,IAAI,CAACU,QAAQE,GAAG,EAAE,qBACvBN,KAAKC,SAAS,CAAC;gBAAEb,QAAQ;gBAAME;gBAAKC;YAAG,GAAG,MAAM;YAGpDW,IAAAA,sBAAgB,EAAC5B;QACrB;IACJ;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
import { BuildContext } from '../../core';
|
|
3
|
-
export declare const VIRTUAL_MOMENT = "\
|
|
3
|
+
export declare const VIRTUAL_MOMENT = "\0moment-locales";
|
|
4
4
|
export declare function momentLocalesPlugin(_context: BuildContext): Plugin;
|
|
5
5
|
//# sourceMappingURL=moment-locales-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moment-locales-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/moment-locales-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,YAAY,EAAkB,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,cAAc,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"moment-locales-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/moment-locales-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,YAAY,EAAkB,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAajD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAkClE"}
|
|
@@ -17,30 +17,46 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _core = require("../../core");
|
|
20
|
-
const VIRTUAL_MOMENT = '\
|
|
20
|
+
const VIRTUAL_MOMENT = '\0moment-locales';
|
|
21
|
+
const VIRTUAL_ID_PATTERN = new RegExp(`^${VIRTUAL_MOMENT}`);
|
|
21
22
|
const UMD_LOCALE = /^moment\/locale\/(.+)$/;
|
|
22
23
|
function momentLocalesPlugin(_context) {
|
|
23
24
|
return {
|
|
24
|
-
name: 'moment-locales',
|
|
25
|
+
name: 'st:moment-locales',
|
|
25
26
|
enforce: 'pre',
|
|
26
|
-
resolveId
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
resolveId: {
|
|
28
|
+
filter: {
|
|
29
|
+
id: [
|
|
30
|
+
/^moment$/,
|
|
31
|
+
UMD_LOCALE
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
handler (source, importer, options) {
|
|
35
|
+
var _UMD_LOCALE_exec;
|
|
36
|
+
if (source === 'moment') {
|
|
37
|
+
return VIRTUAL_MOMENT;
|
|
38
|
+
}
|
|
39
|
+
// Redirect explicit UMD locale imports to the ESM build so they share that instance.
|
|
40
|
+
const locale = (_UMD_LOCALE_exec = UMD_LOCALE.exec(source)) === null || _UMD_LOCALE_exec === void 0 ? void 0 : _UMD_LOCALE_exec[1];
|
|
41
|
+
if (locale) {
|
|
42
|
+
return this.resolve(`moment/dist/locale/${locale}`, importer, options);
|
|
43
|
+
}
|
|
35
44
|
}
|
|
36
45
|
},
|
|
37
|
-
load
|
|
38
|
-
|
|
46
|
+
load: {
|
|
47
|
+
filter: {
|
|
48
|
+
id: VIRTUAL_ID_PATTERN
|
|
49
|
+
},
|
|
50
|
+
handler () {
|
|
39
51
|
return [
|
|
40
52
|
..._core.MOMENT_LOCALES.map((locale)=>`import 'moment/dist/locale/${locale}';`),
|
|
41
53
|
`import moment from 'moment/dist/moment.js';`,
|
|
42
54
|
`export * from 'moment/dist/moment.js';`,
|
|
43
|
-
`export default moment
|
|
55
|
+
`export default moment;`,
|
|
56
|
+
/*
|
|
57
|
+
* moment attaches these to the function itself rather than declaring them as
|
|
58
|
+
* real ES named exports, so `export *` above doesn't forward them.
|
|
59
|
+
*/ `export const isMoment = moment.isMoment;`
|
|
44
60
|
].join('\n');
|
|
45
61
|
}
|
|
46
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/moment-locales-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { BuildContext, MOMENT_LOCALES } from '../../core';\n\nexport const VIRTUAL_MOMENT = '\\
|
|
1
|
+
{"version":3,"sources":["../../../src/vite/plugins/moment-locales-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { BuildContext, MOMENT_LOCALES } from '../../core';\n\nexport const VIRTUAL_MOMENT = '\\0moment-locales';\nconst VIRTUAL_ID_PATTERN = new RegExp(`^${VIRTUAL_MOMENT}`);\n\nconst UMD_LOCALE = /^moment\\/locale\\/(.+)$/;\n\n/*\n * Statically bundle the supported moment locales for parity with webpack's\n * MomentLocalesPlugin. We need this because moment loads locales via a dynamic\n * require that, with Rolldown, never loads.\n *\n * Resolve everything through moment/dist (the ESM build) else Rolldown creates\n * a separate UMD instance from what the app uses.\n */\nexport function momentLocalesPlugin(_context: BuildContext): Plugin {\n return {\n name: 'st:moment-locales',\n enforce: 'pre',\n resolveId: {\n filter: { id: [/^moment$/, UMD_LOCALE] },\n handler(source, importer, options) {\n if (source === 'moment') {\n return VIRTUAL_MOMENT;\n }\n // Redirect explicit UMD locale imports to the ESM build so they share that instance.\n const locale = UMD_LOCALE.exec(source)?.[1];\n if (locale) {\n return this.resolve(`moment/dist/locale/${locale}`, importer, options);\n }\n },\n },\n load: {\n filter: { id: VIRTUAL_ID_PATTERN },\n handler() {\n return [\n ...MOMENT_LOCALES.map(locale => `import 'moment/dist/locale/${locale}';`),\n `import moment from 'moment/dist/moment.js';`,\n `export * from 'moment/dist/moment.js';`,\n `export default moment;`,\n /*\n * moment attaches these to the function itself rather than declaring them as\n * real ES named exports, so `export *` above doesn't forward them.\n */\n `export const isMoment = moment.isMoment;`,\n ].join('\\n');\n },\n },\n };\n}\n"],"names":["VIRTUAL_MOMENT","momentLocalesPlugin","VIRTUAL_ID_PATTERN","RegExp","UMD_LOCALE","_context","name","enforce","resolveId","filter","id","handler","source","importer","options","locale","exec","resolve","load","MOMENT_LOCALES","map","join"],"mappings":";;;;;;;;;;;QAGaA;eAAAA;;QAaGC;eAAAA;;;sBAf6B;AAEtC,MAAMD,iBAAiB;AAC9B,MAAME,qBAAqB,IAAIC,OAAO,CAAC,CAAC,EAAEH,gBAAgB;AAE1D,MAAMI,aAAa;AAUZ,SAASH,oBAAoBI,QAAsB;IACtD,OAAO;QACHC,MAAM;QACNC,SAAS;QACTC,WAAW;YACPC,QAAQ;gBAAEC,IAAI;oBAAC;oBAAYN;iBAAW;YAAC;YACvCO,SAAQC,MAAM,EAAEC,QAAQ,EAAEC,OAAO;oBAKdV;gBAJf,IAAIQ,WAAW,UAAU;oBACrB,OAAOZ;gBACX;gBACA,qFAAqF;gBACrF,MAAMe,UAASX,mBAAAA,WAAWY,IAAI,CAACJ,qBAAhBR,uCAAAA,gBAAyB,CAAC,EAAE;gBAC3C,IAAIW,QAAQ;oBACR,OAAO,IAAI,CAACE,OAAO,CAAC,CAAC,mBAAmB,EAAEF,QAAQ,EAAEF,UAAUC;gBAClE;YACJ;QACJ;QACAI,MAAM;YACFT,QAAQ;gBAAEC,IAAIR;YAAmB;YACjCS;gBACI,OAAO;uBACAQ,oBAAc,CAACC,GAAG,CAACL,CAAAA,SAAU,CAAC,2BAA2B,EAAEA,OAAO,EAAE,CAAC;oBACxE,CAAC,2CAA2C,CAAC;oBAC7C,CAAC,sCAAsC,CAAC;oBACxC,CAAC,sBAAsB,CAAC;oBACxB;;;qBAGC,GACD,CAAC,wCAAwC,CAAC;iBAC7C,CAACM,IAAI,CAAC;YACX;QACJ;IACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/vite/plugins/react-refresh-plugin/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./react-refresh-plugin"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return from;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/vite/plugins/react-refresh-plugin/index.ts"],"sourcesContent":["export * from './react-refresh-plugin';\n"],"names":[],"mappings":";;;;qBAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-refresh-plugin.d.ts","sourceRoot":"","sources":["../../../../src/vite/plugins/react-refresh-plugin/react-refresh-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAuElD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAoE5E"}
|