weapp-tailwindcss 5.1.15 → 5.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/README.en.md +6 -0
- package/README.md +6 -0
- package/bin/{weapp-tailwindcss.js → weapp-tailwindcss.cjs} +1 -1
- package/dist/bundlers/framework-selector.d.ts +2 -2
- package/dist/bundlers/gulp/asset-emission-plan.d.ts +10 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +10 -3
- package/dist/bundlers/gulp/index.d.ts +10 -3
- package/dist/bundlers/gulp/module-graph.d.ts +1 -1
- package/dist/bundlers/gulp/runtime-snapshot.d.ts +4 -2
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/cache-state.d.ts +71 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +45 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +9 -2
- package/dist/bundlers/rspack/index.d.ts +2 -2
- package/dist/bundlers/shared/cache.d.ts +1 -1
- package/dist/bundlers/shared/css-imports.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +21 -0
- package/dist/bundlers/shared/generator-css/candidates.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +19 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +25 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +4 -72
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +5 -3
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +58 -0
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +32 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +13 -5
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +16 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +7 -9
- package/dist/bundlers/shared/generator-css/types.d.ts +12 -3
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +10 -0
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -33
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -1
- package/dist/bundlers/shared/generator-css.d.ts +9 -10
- package/dist/bundlers/shared/runtime-class-set/entries.d.ts +4 -0
- package/dist/bundlers/shared/runtime-class-set/escaped-candidates.d.ts +9 -0
- package/dist/bundlers/shared/runtime-class-set.d.ts +30 -0
- package/dist/bundlers/shared/runtime-entry-type.d.ts +8 -0
- package/dist/bundlers/shared/runtime-signatures.d.ts +8 -0
- package/dist/bundlers/shared/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/shared/source-candidates/collector.d.ts +8 -0
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +10 -0
- package/dist/bundlers/{vite → shared}/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/store.d.ts +2 -0
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +69 -0
- package/dist/bundlers/shared/source-candidates.d.ts +4 -0
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +18 -0
- package/dist/bundlers/shared/source-scan.d.ts +16 -0
- package/dist/bundlers/shared/static-config-content.d.ts +5 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +9 -1
- package/dist/bundlers/vite/bundle-entries.d.ts +1 -1
- package/dist/bundlers/vite/bundle-state.d.ts +11 -38
- package/dist/bundlers/vite/css-asset-identity.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer/options.d.ts +54 -0
- package/dist/bundlers/vite/css-finalizer/plugin.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -43
- package/dist/bundlers/vite/css-memory.d.ts +1 -2
- package/dist/bundlers/vite/frameworks/generic/index.d.ts +2 -2
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -2
- package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +3 -3
- package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +3 -3
- package/dist/bundlers/vite/frameworks/weapp-vite/index.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/asset-emission-plan.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +4 -4
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-cache-task.d.ts +34 -0
- package/dist/bundlers/vite/generate-bundle/css-composition-plan.d.ts +58 -0
- package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-entry-processing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +21 -2
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-source-plan.d.ts +19 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +61 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-result.d.ts +23 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +42 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/finalize/bundle.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +69 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -70
- package/dist/bundlers/vite/generate-bundle/html-processing.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +6 -5
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-plan.d.ts +35 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +5 -6
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +54 -0
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-source-memory.d.ts +3 -3
- package/dist/bundlers/vite/generate-bundle/runtime.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +1 -8
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +3 -3
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +14 -1
- package/dist/bundlers/vite/generate-bundle/transform-filter.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/transform-scheduling.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +8 -7
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/validate-runtime-candidates.d.ts +22 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +7 -7
- package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +1 -4
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -3
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +2 -30
- package/dist/bundlers/vite/index.d.ts +3 -3
- package/dist/bundlers/vite/js-precheck.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +13 -0
- package/dist/bundlers/vite/processed-css-assets/collector.d.ts +4 -0
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +34 -0
- package/dist/bundlers/vite/processed-css-assets/empty-at-rule.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +42 -0
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +89 -0
- package/dist/bundlers/vite/processed-css-assets/style-files.d.ts +3 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +4 -71
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +3 -1
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +1 -2
- package/dist/bundlers/vite/runtime-candidate-entry.d.ts +9 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +4 -4
- package/dist/bundlers/vite/serve-css-generation.d.ts +2 -0
- package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
- package/dist/bundlers/vite/serve-root-import-shell.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +2 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +8 -8
- package/dist/bundlers/vite/shared/framework-hmr-candidate-state.d.ts +45 -0
- package/dist/bundlers/vite/shared/framework-post-plugin.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-processed-css-registry.d.ts +22 -0
- package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-source-candidates-plugin.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +38 -0
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +4 -4
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +2 -13
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -10
- package/dist/bundlers/vite/source-candidates.d.ts +1 -68
- package/dist/bundlers/vite/source-output-relations.d.ts +24 -0
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -18
- package/dist/bundlers/vite/source-scan.d.ts +2 -16
- package/dist/bundlers/vite/static-config-content.d.ts +1 -5
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/web-css-compat.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/asset-emission-plan.d.ts +18 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/finalize-assets.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-result.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-task.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +11 -41
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/html-js-tasks.d.ts +5 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/js-module-graph.d.ts +4 -10
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +8 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/memory-trace.d.ts +78 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +43 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/resources.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/runtime-candidates.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +21 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +9 -219
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +4 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-refresh.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +8 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/generic/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/index.d.ts +7 -7
- package/dist/bundlers/webpack/frameworks/mpx/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/taro/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/uni-app/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/weapp-vite/index.d.ts +2 -2
- package/dist/bundlers/webpack/index.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +7 -2
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +1 -1
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +20 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin/watch-output.d.ts +13 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +3 -21
- package/dist/cli/context.d.ts +2 -2
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/helpers/options.d.ts +3 -3
- package/dist/cli/helpers.d.ts +1 -1
- package/dist/cli.cjs +37012 -0
- package/dist/cli.js +145 -176
- package/dist/compiler/artifact.d.ts +14 -0
- package/dist/compiler/candidate-index.d.ts +10 -0
- package/dist/compiler/compilation-change-coordinator.d.ts +28 -0
- package/dist/compiler/compilation-dependency-state.d.ts +16 -0
- package/dist/compiler/compilation-scope-graph.d.ts +31 -0
- package/dist/compiler/compilation-session-pool.d.ts +54 -0
- package/dist/compiler/compiler-owner-state.d.ts +3 -0
- package/dist/compiler/composition.d.ts +8 -0
- package/dist/compiler/emission-plan.d.ts +26 -0
- package/dist/compiler/index.d.ts +23 -0
- package/dist/compiler/invalidation.d.ts +3 -0
- package/dist/compiler/mode.d.ts +3 -0
- package/dist/compiler/owner-lifecycle.d.ts +1 -0
- package/dist/compiler/platform-adapter.d.ts +9 -0
- package/dist/compiler/runtime-affecting-signature.d.ts +2 -0
- package/dist/compiler/runtime-build-state.d.ts +6 -0
- package/dist/compiler/runtime-snapshot.d.ts +53 -0
- package/dist/compiler/scope-planner.d.ts +6 -0
- package/dist/compiler/semantic-css.d.ts +66 -0
- package/dist/compiler/session.d.ts +13 -0
- package/dist/compiler/shadow-gate.d.ts +26 -0
- package/dist/compiler/shadow-report-session.d.ts +37 -0
- package/dist/compiler/shadow-report.d.ts +15 -0
- package/dist/compiler/source-graph.d.ts +32 -0
- package/dist/compiler/tailwind-generation-session-pool.d.ts +22 -0
- package/dist/compiler/types.d.ts +95 -0
- package/dist/constants.d.ts +2 -2
- package/dist/context/compiler-context-cache.d.ts +1 -1
- package/dist/context/custom-attributes.d.ts +1 -1
- package/dist/context/handlers.d.ts +3 -3
- package/dist/context/index.d.ts +1 -1
- package/dist/context/runtime-package-replacements.d.ts +1 -1
- package/dist/context/style-options.d.ts +1 -1
- package/dist/context/tailwindcss.d.ts +3 -3
- package/dist/{context-VeFq_8vW.js → context-PZXBqrAJ.cjs} +32 -94
- package/dist/{context-BgGWVAmN.mjs → context-oTkxC5aZ.js} +23 -12
- package/dist/{core.mjs → core.cjs} +13 -12
- package/dist/core.d.ts +2 -2
- package/dist/core.js +12 -13
- package/dist/css-imports-DfNC3e6a.cjs +43 -0
- package/dist/css-loader-runtime-CSv0lKqV.cjs +11 -0
- package/dist/css-macro/postcss.cjs +19 -0
- package/dist/css-macro/postcss.js +2 -19
- package/dist/{css-macro.mjs → css-macro.cjs} +11 -8
- package/dist/css-macro.d.ts +2 -2
- package/dist/css-macro.js +8 -11
- package/dist/{defaults.mjs → defaults.cjs} +16 -11
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +11 -16
- package/dist/{escape.mjs → escape.cjs} +18 -4
- package/dist/escape.js +4 -18
- package/dist/framework/platform.d.ts +1 -1
- package/dist/{framework.mjs → framework.cjs} +47 -25
- package/dist/framework.d.ts +1 -1
- package/dist/framework.js +25 -47
- package/dist/generator/index.d.ts +6 -6
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +2 -2
- package/dist/{generator-CEnUsjed.js → generator-C8D5cnbe.cjs} +730 -468
- package/dist/{generator-CEo920So.mjs → generator-CDdzqf1S.js} +747 -497
- package/dist/generator.cjs +12 -0
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +2 -12
- package/dist/{gulp-3m1dAiig.js → gulp-Cjcss8T_.cjs} +326 -241
- package/dist/{gulp-DP71z1jG.mjs → gulp-DNXQvDUw.js} +316 -234
- package/dist/gulp.cjs +5 -0
- package/dist/gulp.d.ts +4 -4
- package/dist/gulp.js +2 -5
- package/dist/{hmr-timing-1aS6--U7.mjs → hmr-timing-CuJwQzDc.js} +5230 -3259
- package/dist/hmr-timing-DMLfNfGG.cjs +555 -0
- package/dist/index.cjs +45 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -45
- package/dist/js/JsTokenUpdater.d.ts +1 -1
- package/dist/js/ModuleGraph.d.ts +3 -3
- package/dist/js/NodePathWalker.d.ts +2 -2
- package/dist/js/babel/process.d.ts +2 -2
- package/dist/js/babel.d.ts +8 -8
- package/dist/js/evalTransforms.d.ts +2 -2
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/handlers.d.ts +2 -2
- package/dist/js/index.d.ts +3 -3
- package/dist/js/literal-transform.d.ts +1 -1
- package/dist/js/module-graph/ignored-exports.d.ts +4 -4
- package/dist/js/module-graph/types.d.ts +2 -2
- package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
- package/dist/js/precheck.d.ts +1 -1
- package/dist/js/replacement-cache.d.ts +1 -1
- package/dist/js/sourceAnalysis.d.ts +3 -3
- package/dist/js/taggedTemplateIgnore.d.ts +1 -1
- package/dist/object-Bvy6-w9r.js +47 -0
- package/dist/object-C_Vr6_S5.cjs +58 -0
- package/dist/options-DlvhQwWB.cjs +775 -0
- package/dist/pipeline-helpers-XtUmUlci.cjs +955 -0
- package/dist/postcss-html-transform.cjs +7 -0
- package/dist/postcss-html-transform.js +3 -5
- package/dist/postcss.cjs +15 -0
- package/dist/postcss.js +7 -11
- package/dist/presets/hbuilderx.d.ts +2 -2
- package/dist/presets/index.d.ts +4 -4
- package/dist/presets/shared.d.ts +1 -1
- package/dist/presets/taro.d.ts +2 -2
- package/dist/presets/uni-app-x.d.ts +1 -1
- package/dist/presets/uni-app.d.ts +2 -2
- package/dist/{presets.mjs → presets.cjs} +37 -24
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +24 -36
- package/dist/reset.cjs +19 -0
- package/dist/reset.d.ts +2 -2
- package/dist/reset.js +2 -19
- package/dist/{rolldown-runtime-emK7D4bc.js → rolldown-runtime-CVvi-lCc.cjs} +15 -0
- package/dist/{rspack.mjs → rspack.cjs} +10 -4
- package/dist/rspack.d.ts +3 -3
- package/dist/rspack.js +4 -10
- package/dist/runtime-branch/create-branch.d.ts +1 -1
- package/dist/runtime-branch/generator-target-env.d.ts +1 -1
- package/dist/runtime-branch/index.d.ts +2 -2
- package/dist/runtime-branch/mini-program.d.ts +1 -1
- package/dist/runtime-branch/native-app.d.ts +1 -1
- package/dist/runtime-branch/platform.d.ts +2 -2
- package/dist/runtime-branch/tailwind-version.d.ts +1 -1
- package/dist/runtime-branch/types.d.ts +2 -2
- package/dist/runtime-branch/web.d.ts +1 -1
- package/dist/runtime-branch.d.ts +1 -1
- package/dist/runtime-registry-Y7NrD2WH.cjs +31 -0
- package/dist/shared/classname-transform.d.ts +1 -1
- package/dist/shared/mpx-plugin-owner.d.ts +2 -0
- package/dist/shared/mpx.d.ts +1 -1
- package/dist/{source-candidate-scan-signature-Cf7259PR.mjs → source-candidate-scan-signature-B0S7f5P7.js} +26 -336
- package/dist/{source-candidate-scan-signature-BAahhiwb.js → source-candidate-scan-signature-BmSuoxR9.cjs} +31 -414
- package/dist/style-injector/internal.d.ts +6 -6
- package/dist/style-options-CEfXwZzX.cjs +75 -0
- package/dist/tailwindcss/candidates.d.ts +2 -2
- package/dist/tailwindcss/index.d.ts +1 -1
- package/dist/tailwindcss/runtime/cache.d.ts +1 -1
- package/dist/tailwindcss/runtime-factory.d.ts +2 -2
- package/dist/tailwindcss/runtime-options.d.ts +1 -1
- package/dist/tailwindcss/runtime-types.d.ts +2 -2
- package/dist/tailwindcss/runtime.d.ts +2 -2
- package/dist/tailwindcss/source-scan.d.ts +2 -2
- package/dist/tailwindcss/targets.d.ts +1 -1
- package/dist/tailwindcss/v4/config.d.ts +1 -1
- package/dist/tailwindcss/v4/css-sources.d.ts +2 -1
- package/dist/tailwindcss/v4/index.d.ts +2 -2
- package/dist/tailwindcss/v4/multi-runtime.d.ts +1 -1
- package/dist/tailwindcss/v4/runtime-factory.d.ts +5 -5
- package/dist/tailwindcss/v4/runtime-options.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/css-macro-source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/cache-stats.d.ts +26 -0
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/engine.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +51 -0
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +17 -0
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -28
- package/dist/tailwindcss/v4-engine/index.d.ts +5 -5
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +1 -0
- package/dist/{tailwindcss-KBYPJ2DW.js → tailwindcss-Cs94gJgf.cjs} +10 -770
- package/dist/{tailwindcss-xs704TRw.mjs → tailwindcss-D7TGiZR2.js} +23 -23
- package/dist/transform-BUEyOCT7.cjs +341 -0
- package/dist/transform-BbaPIji9.js +342 -0
- package/dist/typedoc.export.d.ts +4 -4
- package/dist/types/index.d.ts +7 -7
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/typedoc-tailwindcss-runtime.d.ts +3 -3
- package/dist/types/user-defined-options/general.d.ts +5 -5
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/types/user-defined-options/index.d.ts +9 -9
- package/dist/types/user-defined-options/matcher.d.ts +2 -2
- package/dist/types.cjs +0 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -0
- package/dist/uni-app-x/harmony.d.ts +1 -0
- package/dist/uni-app-x/index.d.ts +2 -2
- package/dist/uni-app-x/options.d.ts +1 -1
- package/dist/uni-app-x/style-asset/harmony-apply.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +3 -0
- package/dist/uni-app-x/style-asset.d.ts +5 -4
- package/dist/uni-app-x/transform.d.ts +1 -1
- package/dist/uni-app-x/vite/harmony-apply.d.ts +19 -0
- package/dist/uni-app-x/vite/native-target.d.ts +2 -0
- package/dist/uni-app-x/vite.d.ts +5 -2
- package/dist/unocss/index.d.ts +1 -1
- package/dist/utils/disabled.d.ts +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/{hmr-timing-B8p4f0ca.js → v4-generation-core-D7MuR5ZF.cjs} +4886 -3330
- package/dist/{vite-nXZEiwG0.mjs → vite-BI1TeUPO.js} +6148 -4522
- package/dist/{vite-DUVjMduj.js → vite-CBzmUTu-.cjs} +6267 -4666
- package/dist/vite.cjs +4 -0
- package/dist/vite.d.ts +3 -3
- package/dist/vite.js +2 -4
- package/dist/watch-dependencies-BZGubvuJ.cjs +40 -0
- package/dist/{weapp-tw-css-generation-loader.js → weapp-tw-css-generation-loader.cjs} +3 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +201 -0
- package/dist/{weapp-tw-runtime-classset-loader.js → weapp-tw-runtime-classset-loader.cjs} +19 -15
- package/dist/{webpack-nppysF4B.js → webpack-Dao6bWEj.cjs} +1000 -1473
- package/dist/{webpack-C_UUFRgj.mjs → webpack-dAY9h8r8.js} +1462 -1185
- package/dist/webpack.cjs +5 -0
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +2 -5
- package/dist/wxml/Tokenizer.d.ts +2 -2
- package/dist/wxml/custom-attributes.d.ts +1 -1
- package/dist/wxml/index.d.ts +2 -2
- package/dist/wxml/shared.d.ts +1 -1
- package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +1 -1
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
- package/dist/wxml/utils/codegen.d.ts +1 -1
- package/dist/wxml/utils/custom-template.d.ts +2 -2
- package/dist/wxml/utils/fragment-helpers.d.ts +2 -2
- package/dist/wxml/utils/fragment-updater.d.ts +2 -2
- package/dist/wxml/utils/template-fragments.d.ts +2 -2
- package/dist/wxml/utils.d.ts +5 -5
- package/dist/wxml-DSMNuUaP.cjs +38609 -0
- package/dist/{cli.mjs → wxml-IBzZSaQC.js} +237 -718
- package/package.json +59 -54
- package/dist/css-macro/postcss.mjs +0 -2
- package/dist/generator.mjs +0 -2
- package/dist/gulp.mjs +0 -2
- package/dist/index.mjs +0 -9
- package/dist/object-BJSWl-E5.mjs +0 -9
- package/dist/object-COs_Mw6p.js +0 -14
- package/dist/postcss-html-transform.mjs +0 -5
- package/dist/postcss.mjs +0 -11
- package/dist/reset.mjs +0 -2
- package/dist/transform-B_KM9sLX.mjs +0 -14930
- package/dist/transform-CcYptivi.js +0 -14927
- package/dist/types.mjs +0 -1
- package/dist/vite.mjs +0 -2
- package/dist/watch-dependencies-bpG6kmAf.js +0 -80
- package/dist/weapp-tw-css-import-rewrite-loader-DNk0IxAt.js +0 -10198
- package/dist/weapp-tw-css-import-rewrite-loader.js +0 -10
- package/dist/webpack.mjs +0 -2
- package/dist/wxml-Ce10eREX.js +0 -3979
- package/dist/wxml-DdGdeqaH.mjs +0 -3861
- /package/dist/{auto-2dg_uhEJ.mjs → auto-2dg_uhEJ.js} +0 -0
- /package/dist/{auto-DtU6f3X6.js → auto-DtU6f3X6.cjs} +0 -0
- /package/dist/bundlers/{vite → shared}/source-scan/dependencies.d.ts +0 -0
- /package/dist/{cache-options-DavPxrhC.js → cache-options-DavPxrhC.cjs} +0 -0
- /package/dist/{cache-options-DwBtLwQe.mjs → cache-options-DwBtLwQe.js} +0 -0
- /package/dist/{logger-BNzxZbZj.mjs → logger-BNzxZbZj.js} +0 -0
- /package/dist/{logger-TlKT3xmR.js → logger-TlKT3xmR.cjs} +0 -0
- /package/dist/{utils-CuKLf1Zv.js → utils-CuKLf1Zv.cjs} +0 -0
- /package/dist/{utils-MVwpU07P.mjs → utils-MVwpU07P.js} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/bundlers/webpack/loaders/runtime-registry.ts
|
|
2
|
+
const runtimeRegistryHolder = globalThis;
|
|
3
|
+
const runtimeRegistry = runtimeRegistryHolder.__WEAPP_TW_WEBPACK_LOADER_RUNTIME_REGISTRY__ ?? (runtimeRegistryHolder.__WEAPP_TW_WEBPACK_LOADER_RUNTIME_REGISTRY__ = /* @__PURE__ */ new Map());
|
|
4
|
+
function setWebpackLoaderRuntime(key, entry) {
|
|
5
|
+
runtimeRegistry.set(key, entry);
|
|
6
|
+
}
|
|
7
|
+
function deleteWebpackLoaderRuntime(key) {
|
|
8
|
+
runtimeRegistry.delete(key);
|
|
9
|
+
}
|
|
10
|
+
function getWebpackLoaderRuntime(key) {
|
|
11
|
+
return key ? runtimeRegistry.get(key) : void 0;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
Object.defineProperty(exports, "deleteWebpackLoaderRuntime", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return deleteWebpackLoaderRuntime;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "getWebpackLoaderRuntime", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return getWebpackLoaderRuntime;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "setWebpackLoaderRuntime", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return setWebpackLoaderRuntime;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IJsHandlerOptions } from '../types';
|
|
1
|
+
import type { IJsHandlerOptions } from '../types/index.js';
|
|
2
2
|
export type ClassNameTransformDecision = 'direct' | 'escaped' | 'fallback' | 'skip';
|
|
3
3
|
export interface ClassNameTransformResult {
|
|
4
4
|
decision: ClassNameTransformDecision;
|
package/dist/shared/mpx.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { detectAppType } from "./framework.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
import {
|
|
1
|
+
import { detectAppType } from "./framework.js";
|
|
2
|
+
import { At as toPosixPath } from "./generator-CDdzqf1S.js";
|
|
3
|
+
import { n as hasCssMacroTailwindV4CustomVariantConditionalComments } from "./auto-2dg_uhEJ.js";
|
|
4
|
+
import { _ as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions } from "./tailwindcss-D7TGiZR2.js";
|
|
5
|
+
import { x as isSourceStyleRequest } from "./hmr-timing-CuJwQzDc.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import process from "node:process";
|
|
9
|
-
import { cleanUrl, ensurePosix } from "@weapp-tailwindcss/shared";
|
|
10
|
-
import { Buffer } from "node:buffer";
|
|
11
8
|
import { weappStyleInjector } from "weapp-style-injector/vite";
|
|
12
9
|
import { StyleInjector } from "weapp-style-injector/vite/taro";
|
|
13
10
|
import { StyleInjector as StyleInjector$1 } from "weapp-style-injector/vite/uni-app";
|
|
@@ -211,20 +208,6 @@ function createBuiltinWebpackStyleInjectorPlugin(options, delegateFactory) {
|
|
|
211
208
|
return delegateFactory(normalized);
|
|
212
209
|
}
|
|
213
210
|
//#endregion
|
|
214
|
-
//#region src/utils/disabled.ts
|
|
215
|
-
function resolvePluginDisabledState(disabled) {
|
|
216
|
-
if (disabled === true) return { plugin: true };
|
|
217
|
-
if (disabled === false || disabled == null) return { plugin: false };
|
|
218
|
-
return { plugin: disabled.plugin ?? false };
|
|
219
|
-
}
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/utils/resolve-package.ts
|
|
222
|
-
const require = createRequire(import.meta.url);
|
|
223
|
-
function resolvePackageDir(name) {
|
|
224
|
-
const pkgPath = require.resolve(`${name}/package.json`);
|
|
225
|
-
return path.dirname(pkgPath);
|
|
226
|
-
}
|
|
227
|
-
//#endregion
|
|
228
211
|
//#region src/bundlers/shared/module-graph.ts
|
|
229
212
|
const QUERY_HASH_RE = /[?#].*$/u;
|
|
230
213
|
const PROTOCOL_RE = /^[a-z][a-z+.-]*:/iu;
|
|
@@ -269,324 +252,31 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
269
252
|
return matchWithExtensions(candidate, hasOutput);
|
|
270
253
|
}
|
|
271
254
|
//#endregion
|
|
272
|
-
//#region src/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (
|
|
276
|
-
|
|
277
|
-
if (!generated) return;
|
|
278
|
-
return {
|
|
279
|
-
...generated,
|
|
280
|
-
classSet: generated.classSet,
|
|
281
|
-
dependencies: generated.dependencies,
|
|
282
|
-
metadata: {
|
|
283
|
-
file: options.file,
|
|
284
|
-
majorVersion,
|
|
285
|
-
outputFile: options.outputFile,
|
|
286
|
-
...generated.metadata ?? {}
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/bundlers/vite/bundle-entries.ts
|
|
292
|
-
function readOutputEntry(entry) {
|
|
293
|
-
if (entry.output.type === "chunk") return entry.output.code;
|
|
294
|
-
const source = entry.output.source;
|
|
295
|
-
if (typeof source === "string") return source;
|
|
296
|
-
if (source instanceof Uint8Array) return Buffer.from(source).toString();
|
|
297
|
-
const fallbackSource = source;
|
|
298
|
-
if (fallbackSource == null) return;
|
|
299
|
-
if (typeof fallbackSource.toString === "function") return fallbackSource.toString();
|
|
300
|
-
}
|
|
301
|
-
function isJavaScriptEntry(entry) {
|
|
302
|
-
if (entry.output.type === "chunk") return true;
|
|
303
|
-
return entry.fileName.endsWith(".js");
|
|
304
|
-
}
|
|
305
|
-
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
306
|
-
const normalizedEntries = /* @__PURE__ */ new Map();
|
|
307
|
-
for (const [id, entry] of entries) normalizedEntries.set(normalizeOutputPathKey(id), entry);
|
|
308
|
-
const getEntry = (id) => entries.get(id) ?? normalizedEntries.get(normalizeOutputPathKey(id));
|
|
309
|
-
return {
|
|
310
|
-
resolve(specifier, importer) {
|
|
311
|
-
return resolveOutputSpecifier(specifier, importer, outputDir, (candidate) => Boolean(getEntry(candidate)));
|
|
312
|
-
},
|
|
313
|
-
load(id) {
|
|
314
|
-
const entry = getEntry(id);
|
|
315
|
-
if (!entry) return;
|
|
316
|
-
return readOutputEntry(entry);
|
|
317
|
-
},
|
|
318
|
-
filter(id) {
|
|
319
|
-
return Boolean(getEntry(id));
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
324
|
-
if (!linked) return;
|
|
325
|
-
const normalizedEntries = /* @__PURE__ */ new Map();
|
|
326
|
-
for (const [entryId, entry] of entries) normalizedEntries.set(normalizeOutputPathKey(entryId), entry);
|
|
327
|
-
for (const [id, { code }] of Object.entries(linked)) {
|
|
328
|
-
const entry = entries.get(id) ?? normalizedEntries.get(normalizeOutputPathKey(id));
|
|
329
|
-
if (!entry) continue;
|
|
330
|
-
const previous = readOutputEntry(entry);
|
|
331
|
-
if (previous == null || previous === code) continue;
|
|
332
|
-
if (entry.output.type === "chunk") entry.output.code = code;
|
|
333
|
-
else entry.output.source = code;
|
|
334
|
-
onApplied?.(entry, code);
|
|
335
|
-
onLinkedUpdate(entry.fileName, previous, code);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
//#endregion
|
|
339
|
-
//#region src/bundlers/vite/runtime-affecting-signature.ts
|
|
340
|
-
const CSS_BLOCK_COMMENT_RE = /\/\*[\s\S]*?\*\//g;
|
|
341
|
-
const CSS_AROUND_PUNCTUATION_RE = /\s*([{}:;,>+~()])\s*/g;
|
|
342
|
-
const CSS_TRAILING_DECLARATION_SEMICOLON_RE = /;\}/g;
|
|
343
|
-
const CSS_WHITESPACE_RE = /\s+/g;
|
|
344
|
-
const JS_RUNTIME_AFFECTING_TEXT_HINT_RE = /["'`/]/;
|
|
345
|
-
const JS_INCOMPLETE_TRAILING_OPERATOR_RE = /(?:=>|[=+\-*%&|^!~?:,.({[\]])\s*$/;
|
|
346
|
-
function createHtmlRuntimeAffectingSignature(source) {
|
|
347
|
-
try {
|
|
348
|
-
const parts = [];
|
|
349
|
-
const parser = new Parser({
|
|
350
|
-
onattribute(name, value) {
|
|
351
|
-
parts.push(`a:${name}=${value}`);
|
|
352
|
-
},
|
|
353
|
-
oncomment(data) {
|
|
354
|
-
parts.push(`c:${data}`);
|
|
355
|
-
},
|
|
356
|
-
ontext(data) {
|
|
357
|
-
const value = data.trim();
|
|
358
|
-
if (value.length > 0) parts.push(`t:${value}`);
|
|
359
|
-
}
|
|
360
|
-
}, { xmlMode: true });
|
|
361
|
-
parser.write(source);
|
|
362
|
-
parser.end();
|
|
363
|
-
return parts.join("\n");
|
|
364
|
-
} catch {
|
|
365
|
-
return source;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
function createJsRuntimeAffectingSignature(source) {
|
|
369
|
-
if (!JS_RUNTIME_AFFECTING_TEXT_HINT_RE.test(source) && !JS_INCOMPLETE_TRAILING_OPERATOR_RE.test(source)) return "";
|
|
370
|
-
try {
|
|
371
|
-
const ast = babelParse(source, {
|
|
372
|
-
cache: false,
|
|
373
|
-
cacheKey: "vite-runtime-affecting:unambiguous",
|
|
374
|
-
plugins: ["jsx", "typescript"],
|
|
375
|
-
sourceType: "unambiguous"
|
|
376
|
-
});
|
|
377
|
-
const parts = [];
|
|
378
|
-
traverse(ast, {
|
|
379
|
-
noScope: true,
|
|
380
|
-
StringLiteral(path) {
|
|
381
|
-
parts.push(`s:${path.node.value}`);
|
|
382
|
-
},
|
|
383
|
-
TemplateElement(path) {
|
|
384
|
-
parts.push(`t:${path.node.value.raw}`);
|
|
385
|
-
},
|
|
386
|
-
JSXText(path) {
|
|
387
|
-
const value = path.node.value.trim();
|
|
388
|
-
if (value.length > 0) parts.push(`x:${value}`);
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
const comments = ast.comments;
|
|
392
|
-
if (Array.isArray(comments)) {
|
|
393
|
-
for (const comment of comments) if (typeof comment?.value === "string" && comment.value.length > 0) parts.push(`c:${comment.value}`);
|
|
394
|
-
}
|
|
395
|
-
return parts.join("\n");
|
|
396
|
-
} catch {
|
|
397
|
-
return source;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function createCssRuntimeAffectingSignature(source) {
|
|
401
|
-
return source.replace(CSS_BLOCK_COMMENT_RE, "").replace(CSS_AROUND_PUNCTUATION_RE, "$1").replace(CSS_TRAILING_DECLARATION_SEMICOLON_RE, "}").replace(CSS_WHITESPACE_RE, " ").trim();
|
|
402
|
-
}
|
|
403
|
-
function createRuntimeAffectingSourceSignature(source, type) {
|
|
404
|
-
if (type === "html") return createHtmlRuntimeAffectingSignature(source);
|
|
405
|
-
if (type === "js") return createJsRuntimeAffectingSignature(source);
|
|
406
|
-
if (type === "css") return createCssRuntimeAffectingSignature(source);
|
|
407
|
-
return source;
|
|
255
|
+
//#region src/utils/disabled.ts
|
|
256
|
+
function resolvePluginDisabledState(disabled) {
|
|
257
|
+
if (disabled === true) return { plugin: true };
|
|
258
|
+
if (disabled === false || disabled == null) return { plugin: false };
|
|
259
|
+
return { plugin: disabled.plugin ?? false };
|
|
408
260
|
}
|
|
409
261
|
//#endregion
|
|
410
|
-
//#region src/
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
const cssLangRE = new RegExp(`\\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\\?)`);
|
|
416
|
-
const htmlLangRE = /\.html?(?:$|\?)/;
|
|
417
|
-
function isCSSRequest(request) {
|
|
418
|
-
return cssLangRE.test(request) || isSourceStyleRequest(request);
|
|
419
|
-
}
|
|
420
|
-
function isHTMLRequest(request) {
|
|
421
|
-
return htmlLangRE.test(request);
|
|
422
|
-
}
|
|
423
|
-
function normalizePath(id) {
|
|
424
|
-
return path.posix.normalize(isWindows ? ensurePosix(id) : id);
|
|
425
|
-
}
|
|
426
|
-
async function formatPostcssSourceMap(rawMap, file) {
|
|
427
|
-
const inputFileDir = path.dirname(file);
|
|
428
|
-
const sources = rawMap.sources.map((source) => {
|
|
429
|
-
const cleanSource = cleanUrl(decodeURIComponent(source));
|
|
430
|
-
if (cleanSource[0] === "<" && cleanSource.endsWith(">")) return `\0${cleanSource}`;
|
|
431
|
-
return normalizePath(path.resolve(inputFileDir, cleanSource));
|
|
432
|
-
});
|
|
433
|
-
return {
|
|
434
|
-
file,
|
|
435
|
-
mappings: rawMap.mappings,
|
|
436
|
-
names: rawMap.names,
|
|
437
|
-
sources,
|
|
438
|
-
sourcesContent: rawMap.sourcesContent,
|
|
439
|
-
version: rawMap.version
|
|
440
|
-
};
|
|
262
|
+
//#region src/utils/resolve-package.ts
|
|
263
|
+
const require = createRequire(import.meta.url);
|
|
264
|
+
function resolvePackageDir(name) {
|
|
265
|
+
const pkgPath = require.resolve(`${name}/package.json`);
|
|
266
|
+
return path.dirname(pkgPath);
|
|
441
267
|
}
|
|
442
268
|
//#endregion
|
|
443
|
-
//#region src/bundlers/
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
linkedByEntry: /* @__PURE__ */ new Map(),
|
|
451
|
-
dependentsByLinkedFile: /* @__PURE__ */ new Map(),
|
|
452
|
-
bundleMarkupCandidatesByFile: /* @__PURE__ */ new Map(),
|
|
453
|
-
generatorCandidateSignature: void 0
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
function createChangedByType() {
|
|
457
|
-
return {
|
|
458
|
-
html: /* @__PURE__ */ new Set(),
|
|
459
|
-
js: /* @__PURE__ */ new Set(),
|
|
460
|
-
css: /* @__PURE__ */ new Set(),
|
|
461
|
-
other: /* @__PURE__ */ new Set()
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
function createProcessFiles() {
|
|
465
|
-
return {
|
|
466
|
-
html: /* @__PURE__ */ new Set(),
|
|
467
|
-
js: /* @__PURE__ */ new Set(),
|
|
468
|
-
css: /* @__PURE__ */ new Set()
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
function readEntrySource(output) {
|
|
472
|
-
if (output.type === "chunk") return output.code;
|
|
473
|
-
return typeof output.source === "string" ? output.source : Buffer.from(output.source).toString();
|
|
474
|
-
}
|
|
475
|
-
function classifyBundleEntry(file, opts) {
|
|
476
|
-
if (opts.htmlMatcher(file) || isHTMLRequest(file)) return "html";
|
|
477
|
-
if (opts.cssMatcher(file) || isCSSRequest(file)) return "css";
|
|
478
|
-
if (opts.jsMatcher(file) || opts.wxsMatcher(file)) return "js";
|
|
269
|
+
//#region src/bundlers/shared/runtime-entry-type.ts
|
|
270
|
+
const CSS_REQUEST_RE = /\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\?)/;
|
|
271
|
+
const HTML_REQUEST_RE = /\.html?(?:$|\?)/;
|
|
272
|
+
function classifyRuntimeEntry(file, matchers) {
|
|
273
|
+
if (matchers.htmlMatcher(file) || HTML_REQUEST_RE.test(file)) return "html";
|
|
274
|
+
if (matchers.cssMatcher(file) || CSS_REQUEST_RE.test(file) || isSourceStyleRequest(file)) return "css";
|
|
275
|
+
if (matchers.jsMatcher(file) || matchers.wxsMatcher(file)) return "js";
|
|
479
276
|
return "other";
|
|
480
277
|
}
|
|
481
|
-
function collectJsEntries(fileName, output, outDir, store) {
|
|
482
|
-
const entry = {
|
|
483
|
-
fileName,
|
|
484
|
-
output
|
|
485
|
-
};
|
|
486
|
-
if (!isJavaScriptEntry(entry)) return;
|
|
487
|
-
const absolute = toAbsoluteOutputPath(fileName, outDir);
|
|
488
|
-
store.set(absolute, entry);
|
|
489
|
-
}
|
|
490
|
-
function markProcessFile(type, file, processFiles) {
|
|
491
|
-
if (type === "html" || type === "js" || type === "css") processFiles[type].add(file);
|
|
492
|
-
}
|
|
493
|
-
function buildBundleSnapshot(bundle, opts, outDir, state, forceAll = false, options = {}) {
|
|
494
|
-
const sourceHashByFile = /* @__PURE__ */ new Map();
|
|
495
|
-
const runtimeAffectingSignatureByFile = /* @__PURE__ */ new Map();
|
|
496
|
-
const runtimeAffectingHashByFile = /* @__PURE__ */ new Map();
|
|
497
|
-
const changedByType = createChangedByType();
|
|
498
|
-
const runtimeAffectingChangedByType = createChangedByType();
|
|
499
|
-
const processFiles = createProcessFiles();
|
|
500
|
-
const linkedImpactsByEntry = /* @__PURE__ */ new Map();
|
|
501
|
-
const jsEntries = /* @__PURE__ */ new Map();
|
|
502
|
-
const entries = [];
|
|
503
|
-
const firstRun = state.iteration === 0 && state.sourceHashByFile.size === 0;
|
|
504
|
-
const hasOmittedKnownFiles = options.hasOmittedKnownFiles === true;
|
|
505
|
-
for (const [file, output] of Object.entries(bundle)) {
|
|
506
|
-
const type = classifyBundleEntry(file, opts);
|
|
507
|
-
const source = readEntrySource(output);
|
|
508
|
-
const hash = opts.cache.computeHash(source);
|
|
509
|
-
sourceHashByFile.set(file, hash);
|
|
510
|
-
const previousHash = state.sourceHashByFile.get(file);
|
|
511
|
-
const changed = previousHash == null || previousHash !== hash;
|
|
512
|
-
const previousRuntimeAffectingHash = state.runtimeAffectingHashByFile.get(file);
|
|
513
|
-
const runtimeAffectingHash = !changed && previousRuntimeAffectingHash != null ? previousRuntimeAffectingHash : (() => {
|
|
514
|
-
const runtimeAffectingSignature = createRuntimeAffectingSourceSignature(source, type);
|
|
515
|
-
runtimeAffectingSignatureByFile.set(file, runtimeAffectingSignature);
|
|
516
|
-
return opts.cache.computeHash(runtimeAffectingSignature);
|
|
517
|
-
})();
|
|
518
|
-
runtimeAffectingHashByFile.set(file, runtimeAffectingHash);
|
|
519
|
-
if (changed) changedByType[type].add(file);
|
|
520
|
-
if (previousRuntimeAffectingHash == null || previousRuntimeAffectingHash !== runtimeAffectingHash) runtimeAffectingChangedByType[type].add(file);
|
|
521
|
-
if (forceAll || firstRun) markProcessFile(type, file, processFiles);
|
|
522
|
-
else if (type === "html") processFiles.html.add(file);
|
|
523
|
-
else if (changed && (type === "js" || type === "css")) processFiles[type].add(file);
|
|
524
|
-
collectJsEntries(file, output, outDir, jsEntries);
|
|
525
|
-
entries.push({
|
|
526
|
-
file,
|
|
527
|
-
output,
|
|
528
|
-
source,
|
|
529
|
-
type
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
if (!forceAll && !firstRun) for (const changedFile of changedByType.js) {
|
|
533
|
-
const dependents = state.dependentsByLinkedFile.get(changedFile);
|
|
534
|
-
if (!dependents) continue;
|
|
535
|
-
for (const entryFile of dependents) {
|
|
536
|
-
processFiles.js.add(entryFile);
|
|
537
|
-
let impacts = linkedImpactsByEntry.get(entryFile);
|
|
538
|
-
if (!impacts) {
|
|
539
|
-
impacts = /* @__PURE__ */ new Set();
|
|
540
|
-
linkedImpactsByEntry.set(entryFile, impacts);
|
|
541
|
-
}
|
|
542
|
-
impacts.add(changedFile);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
return {
|
|
546
|
-
entries,
|
|
547
|
-
jsEntries,
|
|
548
|
-
sourceHashByFile,
|
|
549
|
-
runtimeAffectingSignatureByFile,
|
|
550
|
-
runtimeAffectingHashByFile,
|
|
551
|
-
hasOmittedKnownFiles,
|
|
552
|
-
changedByType,
|
|
553
|
-
runtimeAffectingChangedByType,
|
|
554
|
-
processFiles,
|
|
555
|
-
linkedImpactsByEntry
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
function invertLinkedByEntry(linkedByEntry) {
|
|
559
|
-
const dependentsByLinkedFile = /* @__PURE__ */ new Map();
|
|
560
|
-
for (const [entryFile, linkedFiles] of linkedByEntry.entries()) for (const linkedFile of linkedFiles) {
|
|
561
|
-
let dependents = dependentsByLinkedFile.get(linkedFile);
|
|
562
|
-
if (!dependents) {
|
|
563
|
-
dependents = /* @__PURE__ */ new Set();
|
|
564
|
-
dependentsByLinkedFile.set(linkedFile, dependents);
|
|
565
|
-
}
|
|
566
|
-
dependents.add(entryFile);
|
|
567
|
-
}
|
|
568
|
-
return dependentsByLinkedFile;
|
|
569
|
-
}
|
|
570
|
-
function replaceMapEntries(target, source) {
|
|
571
|
-
target.clear();
|
|
572
|
-
for (const [key, value] of source) target.set(key, value);
|
|
573
|
-
return target;
|
|
574
|
-
}
|
|
575
|
-
function mergeMapEntries(target, source) {
|
|
576
|
-
for (const [key, value] of source) target.set(key, value);
|
|
577
|
-
return target;
|
|
578
|
-
}
|
|
579
|
-
function updateBundleBuildState(state, snapshot, linkedByEntry, options = {}) {
|
|
580
|
-
const incremental = options.incremental === true;
|
|
581
|
-
state.iteration += 1;
|
|
582
|
-
state.sourceHashByFile = incremental ? mergeMapEntries(state.sourceHashByFile, snapshot.sourceHashByFile) : replaceMapEntries(state.sourceHashByFile, snapshot.sourceHashByFile);
|
|
583
|
-
state.runtimeAffectingSignatureByFile.clear();
|
|
584
|
-
state.runtimeAffectingHashByFile = incremental ? mergeMapEntries(state.runtimeAffectingHashByFile, snapshot.runtimeAffectingHashByFile) : replaceMapEntries(state.runtimeAffectingHashByFile, snapshot.runtimeAffectingHashByFile);
|
|
585
|
-
state.linkedByEntry = incremental ? mergeMapEntries(state.linkedByEntry, linkedByEntry) : replaceMapEntries(state.linkedByEntry, linkedByEntry);
|
|
586
|
-
state.dependentsByLinkedFile = invertLinkedByEntry(state.linkedByEntry);
|
|
587
|
-
}
|
|
588
278
|
//#endregion
|
|
589
|
-
//#region src/bundlers/
|
|
279
|
+
//#region src/bundlers/shared/runtime-signatures.ts
|
|
590
280
|
function summarizeStringDiff(previous, next) {
|
|
591
281
|
if (previous === next) return "same";
|
|
592
282
|
const previousLength = previous.length;
|
|
@@ -699,9 +389,9 @@ async function createScopedGeneratorRuntime(options) {
|
|
|
699
389
|
return fallbackRuntime;
|
|
700
390
|
}
|
|
701
391
|
//#endregion
|
|
702
|
-
//#region src/bundlers/
|
|
392
|
+
//#region src/bundlers/shared/source-candidate-scan-signature.ts
|
|
703
393
|
function normalizeSignaturePath(value) {
|
|
704
|
-
return
|
|
394
|
+
return toPosixPath(path.resolve(value));
|
|
705
395
|
}
|
|
706
396
|
function serializeInlineCandidates(inlineCandidates) {
|
|
707
397
|
return {
|
|
@@ -728,4 +418,4 @@ function createSourceCandidateScanSignature(input) {
|
|
|
728
418
|
});
|
|
729
419
|
}
|
|
730
420
|
//#endregion
|
|
731
|
-
export {
|
|
421
|
+
export { resolveWebpackFrameworkProfile as S, createBuiltinViteStyleInjectorPlugins as _, createCandidateSignature as a, webpackStyleInjectorDelegates as b, getSnapshotHash as c, classifyRuntimeEntry as d, resolvePackageDir as f, toAbsoluteOutputPath as g, resolveOutputSpecifier as h, createScopedGeneratorSourceTraceMap as i, hasRuntimeAffectingSourceChanges as l, normalizeOutputPathKey as m, createScopedGeneratorCandidateSignature as n, createJsHashSalt as o, resolvePluginDisabledState as p, createScopedGeneratorRuntime as r, createLinkedImpactSignature as s, createSourceCandidateScanSignature as t, summarizeStringDiff as u, createBuiltinWebpackStyleInjectorPlugin as v, resolveViteFrameworkProfile as x, viteStyleInjectorDelegates as y };
|