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
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
|
+
const require_generator = require("./generator-C8D5cnbe.cjs");
|
|
3
|
+
const require_options = require("./options-DlvhQwWB.cjs");
|
|
4
|
+
const require_v4_generation_core = require("./v4-generation-core-D7MuR5ZF.cjs");
|
|
5
|
+
const require_wxml = require("./wxml-DSMNuUaP.cjs");
|
|
6
|
+
const require_hmr_timing = require("./hmr-timing-DMLfNfGG.cjs");
|
|
7
|
+
const require_context = require("./context-PZXBqrAJ.cjs");
|
|
8
|
+
const require_tailwindcss = require("./tailwindcss-Cs94gJgf.cjs");
|
|
9
|
+
const require_style_options = require("./style-options-CEfXwZzX.cjs");
|
|
7
10
|
let node_fs = require("node:fs");
|
|
8
|
-
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
11
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
9
12
|
let node_path = require("node:path");
|
|
10
|
-
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
13
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
11
14
|
let node_process = require("node:process");
|
|
12
|
-
node_process = require_rolldown_runtime.__toESM(node_process);
|
|
15
|
+
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
13
16
|
let node_buffer = require("node:buffer");
|
|
14
17
|
let node_stream = require("node:stream");
|
|
15
|
-
node_stream = require_rolldown_runtime.__toESM(node_stream);
|
|
18
|
+
node_stream = require_rolldown_runtime.__toESM(node_stream, 1);
|
|
16
19
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
17
20
|
//#region src/bundlers/gulp/module-graph.ts
|
|
18
21
|
const MODULE_EXTENSIONS = [
|
|
@@ -66,72 +69,20 @@ function createGulpModuleGraphOptions(opts) {
|
|
|
66
69
|
}
|
|
67
70
|
//#endregion
|
|
68
71
|
//#region src/bundlers/gulp/runtime-snapshot.ts
|
|
69
|
-
function createGulpRuntimeSnapshot(runtimeSourcesByFile,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
entries: [...runtimeSourcesByFile.entries()].map(([file, entry]) => ({
|
|
82
|
-
file,
|
|
83
|
-
output: {
|
|
84
|
-
fileName: file,
|
|
85
|
-
source: entry.source,
|
|
86
|
-
type: "asset"
|
|
87
|
-
},
|
|
88
|
-
source: entry.source,
|
|
89
|
-
type: entry.type
|
|
90
|
-
})),
|
|
91
|
-
jsEntries: /* @__PURE__ */ new Map(),
|
|
92
|
-
sourceHashByFile: /* @__PURE__ */ new Map(),
|
|
93
|
-
runtimeAffectingSignatureByFile: /* @__PURE__ */ new Map(),
|
|
94
|
-
runtimeAffectingHashByFile: /* @__PURE__ */ new Map(),
|
|
95
|
-
hasOmittedKnownFiles: false,
|
|
96
|
-
changedByType: {
|
|
97
|
-
html: /* @__PURE__ */ new Set(),
|
|
98
|
-
js: /* @__PURE__ */ new Set(),
|
|
99
|
-
css: /* @__PURE__ */ new Set(),
|
|
100
|
-
other: /* @__PURE__ */ new Set()
|
|
101
|
-
},
|
|
102
|
-
runtimeAffectingChangedByType,
|
|
103
|
-
processFiles: {
|
|
104
|
-
html: /* @__PURE__ */ new Set(),
|
|
105
|
-
js: /* @__PURE__ */ new Set(),
|
|
106
|
-
css: /* @__PURE__ */ new Set()
|
|
107
|
-
},
|
|
108
|
-
linkedImpactsByEntry: /* @__PURE__ */ new Map()
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/bundlers/gulp/vinyl-transform.ts
|
|
113
|
-
const Transform = node_stream.default.Transform;
|
|
114
|
-
function createVinylTransform(phase, handler, getTimingDetails) {
|
|
115
|
-
return new Transform({
|
|
116
|
-
objectMode: true,
|
|
117
|
-
async transform(file, _encoding, callback) {
|
|
118
|
-
const hmrTimingStartedAt = performance.now();
|
|
119
|
-
try {
|
|
120
|
-
await handler(file);
|
|
121
|
-
require_hmr_timing.emitHmrTiming("gulp", phase, performance.now() - hmrTimingStartedAt, {
|
|
122
|
-
file: file.relative || node_path.default.basename(file.path),
|
|
123
|
-
...getTimingDetails?.(file)
|
|
124
|
-
});
|
|
125
|
-
callback(null, file);
|
|
126
|
-
} catch (error) {
|
|
127
|
-
callback(error, file);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
72
|
+
function createGulpRuntimeSnapshot(runtimeSourcesByFile, state, computeHash, options = {}) {
|
|
73
|
+
return require_hmr_timing.buildRuntimeCompilationSnapshot([...runtimeSourcesByFile.entries()].map(([file, entry]) => ({
|
|
74
|
+
file,
|
|
75
|
+
runtimeCandidate: true,
|
|
76
|
+
source: entry.source,
|
|
77
|
+
type: entry.type
|
|
78
|
+
})), state, {
|
|
79
|
+
computeHash,
|
|
80
|
+
createRuntimeAffectingSignature: require_v4_generation_core.createRuntimeAffectingSourceSignature,
|
|
81
|
+
removedFiles: options.removedFiles
|
|
130
82
|
});
|
|
131
83
|
}
|
|
132
84
|
//#endregion
|
|
133
|
-
//#region src/bundlers/gulp/shared/create-native-framework-plugins.ts
|
|
134
|
-
const debug = require_wxml.createDebug();
|
|
85
|
+
//#region src/bundlers/gulp/shared/create-native-framework-plugins/cache-state.ts
|
|
135
86
|
const GULP_RUNTIME_SOURCE_CACHE_MAX = 256;
|
|
136
87
|
const GULP_PROCESS_CACHE_MAX = 512;
|
|
137
88
|
function toMb(bytes) {
|
|
@@ -141,13 +92,15 @@ function touchMapEntry(map, key, value) {
|
|
|
141
92
|
map.delete(key);
|
|
142
93
|
map.set(key, value);
|
|
143
94
|
}
|
|
144
|
-
function pruneGulpRuntimeSourceCaches(
|
|
95
|
+
function pruneGulpRuntimeSourceCaches(sourcesByFile) {
|
|
96
|
+
const removedFiles = [];
|
|
145
97
|
while (sourcesByFile.size > GULP_RUNTIME_SOURCE_CACHE_MAX) {
|
|
146
98
|
const oldestKey = sourcesByFile.keys().next().value;
|
|
147
99
|
if (typeof oldestKey !== "string") break;
|
|
148
100
|
sourcesByFile.delete(oldestKey);
|
|
149
|
-
|
|
101
|
+
removedFiles.push(oldestKey);
|
|
150
102
|
}
|
|
103
|
+
return removedFiles;
|
|
151
104
|
}
|
|
152
105
|
function rememberGulpProcessCacheKey(cacheKeys, key) {
|
|
153
106
|
cacheKeys.delete(key);
|
|
@@ -192,6 +145,227 @@ function resolveGulpMemoryDebugStats(context) {
|
|
|
192
145
|
tailwind: { v4: require_generator.getTailwindV4IncrementalGenerateCacheStats() }
|
|
193
146
|
};
|
|
194
147
|
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/bundlers/gulp/asset-emission-plan.ts
|
|
150
|
+
function applyGulpAssetEmissionPlan(plan, options) {
|
|
151
|
+
for (const operation of plan.operations()) {
|
|
152
|
+
if (operation.kind === "delete") {
|
|
153
|
+
options.deleteAsset(operation.assetId);
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
options.writeAsset(operation.assetId, typeof operation.source === "string" ? node_buffer.Buffer.from(operation.source) : node_buffer.Buffer.from(operation.source));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function writeGulpFileAsset(file, source) {
|
|
160
|
+
const plan = new require_v4_generation_core.AssetEmissionPlan();
|
|
161
|
+
plan.write(file.path, source);
|
|
162
|
+
applyGulpAssetEmissionPlan(plan, {
|
|
163
|
+
deleteAsset(assetId) {
|
|
164
|
+
if (assetId === file.path) file.contents = null;
|
|
165
|
+
},
|
|
166
|
+
writeAsset(assetId, contents) {
|
|
167
|
+
if (assetId === file.path) file.contents = contents;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/bundlers/gulp/vinyl-transform.ts
|
|
173
|
+
const Transform = node_stream.default.Transform;
|
|
174
|
+
function createVinylTransform(phase, handler, getTimingDetails) {
|
|
175
|
+
return new Transform({
|
|
176
|
+
objectMode: true,
|
|
177
|
+
async transform(file, _encoding, callback) {
|
|
178
|
+
const hmrTimingStartedAt = performance.now();
|
|
179
|
+
try {
|
|
180
|
+
await handler(file);
|
|
181
|
+
require_hmr_timing.emitHmrTiming("gulp", phase, performance.now() - hmrTimingStartedAt, {
|
|
182
|
+
file: file.relative || node_path.default.basename(file.path),
|
|
183
|
+
...getTimingDetails?.(file)
|
|
184
|
+
});
|
|
185
|
+
callback(null, file);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
callback(error, file);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.ts
|
|
194
|
+
function createGulpFileTransforms(context) {
|
|
195
|
+
const { cache, createRuntimeSetHash, debug, generatedCssPreflightModeByFile, getCompilationDependencyRevision, getSourceCandidateGetter, getSourceCandidateSourceGetter, getRuntimeSet, gulpProcessCacheKeys, opts, refreshGulpV4SourceCandidates, refreshRuntimeSet, refreshRuntimeSetForSource, registerAutoCssSource, rememberCompilationScope, resolveGulpStyleOutputExtension, resolveGulpTransformTimingDetails, resolveModuleGraphOptions, resolveWxmlHandlerOptions, resolveWxssFileHandlerOptions, resolveWxssUserHandlerOptions, runtimeState } = context;
|
|
196
|
+
const { templateHandler, styleHandler, jsHandler } = opts;
|
|
197
|
+
function createWxssTransform(options, stage) {
|
|
198
|
+
return createVinylTransform(`css:${stage}`, async (file) => {
|
|
199
|
+
if (!file.contents) return;
|
|
200
|
+
const rawSource = file.contents.toString();
|
|
201
|
+
const cssSourceChanged = await registerAutoCssSource(file, rawSource);
|
|
202
|
+
const shouldUseGenerator = runtimeState.tailwindRuntime.majorVersion === 4;
|
|
203
|
+
let gulpSourceCandidateGetter = getSourceCandidateGetter();
|
|
204
|
+
if (shouldUseGenerator) gulpSourceCandidateGetter = await refreshGulpV4SourceCandidates(cssSourceChanged);
|
|
205
|
+
const nextRuntimeSet = await refreshRuntimeSet({
|
|
206
|
+
forceRefresh: cssSourceChanged,
|
|
207
|
+
forceCollect: cssSourceChanged,
|
|
208
|
+
clearCache: cssSourceChanged
|
|
209
|
+
});
|
|
210
|
+
const sourceCandidateSourceGetter = getSourceCandidateSourceGetter();
|
|
211
|
+
const sourceTraceTokenSources = sourceCandidateSourceGetter ? require_v4_generation_core.createCssTokenSourceMap(sourceCandidateSourceGetter(void 0), opts) : void 0;
|
|
212
|
+
const sourceTraceSignature = require_v4_generation_core.createCssSourceTraceCacheSignature(sourceTraceTokenSources, opts);
|
|
213
|
+
const sourceCandidateSignature = gulpSourceCandidateGetter ? `gulp-source-candidates:1:${[...gulpSourceCandidateGetter(void 0)].sort().join("\n")}` : void 0;
|
|
214
|
+
const styleOutputExtension = resolveGulpStyleOutputExtension(file);
|
|
215
|
+
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, rawSource, options);
|
|
216
|
+
const outputFile = (file.relative || node_path.default.basename(file.path)).replaceAll(node_path.default.sep, "/");
|
|
217
|
+
const compilationScope = {
|
|
218
|
+
id: outputFile,
|
|
219
|
+
kind: cssHandlerOptions.isMainChunk ? "global" : "component"
|
|
220
|
+
};
|
|
221
|
+
rememberCompilationScope(file.path, compilationScope.id);
|
|
222
|
+
const compilationDependencyRevision = getCompilationDependencyRevision(compilationScope.id);
|
|
223
|
+
const outputSignature = `${styleOutputExtension ? `gulp-output:1:${stage}:${styleOutputExtension}` : `gulp-output:0:${stage}`}:compiler-dependencies:${compilationDependencyRevision}`;
|
|
224
|
+
await require_hmr_timing.processCachedTask({
|
|
225
|
+
cache,
|
|
226
|
+
cacheKey: file.path,
|
|
227
|
+
hash: createRuntimeSetHash(rawSource, nextRuntimeSet, sourceTraceSignature, sourceCandidateSignature, outputSignature),
|
|
228
|
+
applyResult(source) {
|
|
229
|
+
writeGulpFileAsset(file, source);
|
|
230
|
+
},
|
|
231
|
+
onCacheHit() {
|
|
232
|
+
debug("css cache hit: %s", file.path);
|
|
233
|
+
},
|
|
234
|
+
async transform() {
|
|
235
|
+
await runtimeState.readyPromise;
|
|
236
|
+
const generated = shouldUseGenerator ? await require_v4_generation_core.generateTailwindV4Css({
|
|
237
|
+
opts,
|
|
238
|
+
runtimeState,
|
|
239
|
+
runtime: nextRuntimeSet,
|
|
240
|
+
rawSource,
|
|
241
|
+
file: file.path,
|
|
242
|
+
outputFile,
|
|
243
|
+
scope: compilationScope,
|
|
244
|
+
cssHandlerOptions,
|
|
245
|
+
cssUserHandlerOptions: resolveWxssUserHandlerOptions(options),
|
|
246
|
+
getSourceCandidatesForEntries: gulpSourceCandidateGetter,
|
|
247
|
+
styleHandler,
|
|
248
|
+
debug,
|
|
249
|
+
deferCssAdaptation: stage === "generate"
|
|
250
|
+
}) : void 0;
|
|
251
|
+
const transformedCss = generated?.css ?? (stage === "generate" ? rawSource : (await styleHandler(rawSource, cssHandlerOptions)).css);
|
|
252
|
+
if (stage === "generate") {
|
|
253
|
+
const preflightMode = generated?.metadata?.preflightMode;
|
|
254
|
+
if (preflightMode) generatedCssPreflightModeByFile.set(file.path, preflightMode);
|
|
255
|
+
else generatedCssPreflightModeByFile.delete(file.path);
|
|
256
|
+
}
|
|
257
|
+
const css = require_v4_generation_core.annotateCssSourceTrace(transformedCss, {
|
|
258
|
+
opts,
|
|
259
|
+
tokenSources: sourceTraceTokenSources
|
|
260
|
+
});
|
|
261
|
+
const generatedCss = stage === "generate" && generated ? `${require_v4_generation_core.createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
|
|
262
|
+
const outputCss = stage === "generate" ? generatedCss : (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss, { styleOutputExtension });
|
|
263
|
+
debug("css handle: %s", file.path);
|
|
264
|
+
return { result: outputCss };
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
268
|
+
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
269
|
+
}, () => resolveGulpTransformTimingDetails(`css:${stage}`));
|
|
270
|
+
}
|
|
271
|
+
const generateWxss = (options = {}) => createWxssTransform(options, "generate");
|
|
272
|
+
const transformWxss = (options = {}) => createWxssTransform(options, "transform");
|
|
273
|
+
const adaptWxss = (options = {}) => createVinylTransform("css:adapt", async (file) => {
|
|
274
|
+
if (!file.contents) return;
|
|
275
|
+
const rawSource = file.contents.toString();
|
|
276
|
+
const generatedCss = require_v4_generation_core.hasBundlerGeneratedCssMarker(rawSource);
|
|
277
|
+
const source = generatedCss ? require_v4_generation_core.stripBundlerGeneratedCssMarkers(rawSource) : rawSource;
|
|
278
|
+
const styleOutputExtension = resolveGulpStyleOutputExtension(file);
|
|
279
|
+
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, source, options);
|
|
280
|
+
const handled = await styleHandler(source, cssHandlerOptions);
|
|
281
|
+
const preflightMode = generatedCssPreflightModeByFile.get(file.path);
|
|
282
|
+
writeGulpFileAsset(file, (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss ? require_v4_generation_core.finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
283
|
+
injectPreflight: preflightMode?.inject ?? cssHandlerOptions.isMainChunk,
|
|
284
|
+
preservePreflight: preflightMode?.preserve ?? cssHandlerOptions.isMainChunk,
|
|
285
|
+
styleOptions: cssHandlerOptions
|
|
286
|
+
}) : handled.css, { styleOutputExtension }));
|
|
287
|
+
debug("css adapt: %s", file.path);
|
|
288
|
+
}, () => resolveGulpTransformTimingDetails("css:adapt"));
|
|
289
|
+
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|
|
290
|
+
if (!file.contents) return;
|
|
291
|
+
const filename = node_path.default.resolve(file.path);
|
|
292
|
+
const rawSource = file.contents.toString();
|
|
293
|
+
await refreshRuntimeSetForSource(file, rawSource, "js");
|
|
294
|
+
await runtimeState.readyPromise;
|
|
295
|
+
const moduleGraph = resolveModuleGraphOptions(options.moduleGraph);
|
|
296
|
+
const handlerOptions = {
|
|
297
|
+
...options,
|
|
298
|
+
generateMap: false,
|
|
299
|
+
filename,
|
|
300
|
+
moduleGraph,
|
|
301
|
+
babelParserOptions: {
|
|
302
|
+
...options?.babelParserOptions ?? {},
|
|
303
|
+
sourceFilename: filename
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
if (runtimeState.tailwindRuntime.majorVersion !== void 0) handlerOptions.tailwindcssMajorVersion = runtimeState.tailwindRuntime.majorVersion;
|
|
307
|
+
await require_hmr_timing.processCachedTask({
|
|
308
|
+
cache,
|
|
309
|
+
cacheKey: file.path,
|
|
310
|
+
rawSource,
|
|
311
|
+
applyResult(source) {
|
|
312
|
+
writeGulpFileAsset(file, source);
|
|
313
|
+
},
|
|
314
|
+
onCacheHit() {
|
|
315
|
+
debug("js cache hit: %s", file.path);
|
|
316
|
+
},
|
|
317
|
+
async transform() {
|
|
318
|
+
await runtimeState.readyPromise;
|
|
319
|
+
const currentSource = file.contents?.toString() ?? rawSource;
|
|
320
|
+
if (require_context.shouldSkipJsTransform(currentSource, {
|
|
321
|
+
...handlerOptions,
|
|
322
|
+
classNameSet: getRuntimeSet()
|
|
323
|
+
})) return { result: currentSource };
|
|
324
|
+
const { code } = await jsHandler(currentSource, getRuntimeSet(), handlerOptions);
|
|
325
|
+
debug("js handle: %s", file.path);
|
|
326
|
+
return { result: code };
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
330
|
+
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
331
|
+
}, () => resolveGulpTransformTimingDetails("js"));
|
|
332
|
+
const transformWxml = (options = {}) => createVinylTransform("html", async (file) => {
|
|
333
|
+
if (!file.contents) return;
|
|
334
|
+
const rawSource = file.contents.toString();
|
|
335
|
+
await refreshRuntimeSetForSource(file, rawSource, "html");
|
|
336
|
+
await runtimeState.readyPromise;
|
|
337
|
+
await require_hmr_timing.processCachedTask({
|
|
338
|
+
cache,
|
|
339
|
+
cacheKey: file.path,
|
|
340
|
+
rawSource,
|
|
341
|
+
applyResult(source) {
|
|
342
|
+
writeGulpFileAsset(file, source);
|
|
343
|
+
},
|
|
344
|
+
onCacheHit() {
|
|
345
|
+
debug("html cache hit: %s", file.path);
|
|
346
|
+
},
|
|
347
|
+
async transform() {
|
|
348
|
+
await runtimeState.readyPromise;
|
|
349
|
+
const code = await templateHandler(rawSource, resolveWxmlHandlerOptions(options));
|
|
350
|
+
debug("html handle: %s", file.path);
|
|
351
|
+
return { result: code };
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
355
|
+
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
356
|
+
}, () => resolveGulpTransformTimingDetails("html"));
|
|
357
|
+
return {
|
|
358
|
+
adaptWxss,
|
|
359
|
+
generateWxss,
|
|
360
|
+
transformWxss,
|
|
361
|
+
transformWxml,
|
|
362
|
+
transformJs
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/bundlers/gulp/shared/create-native-framework-plugins.ts
|
|
367
|
+
const debug = require_wxml.createDebug();
|
|
368
|
+
const GULP_COMPILATION_SCOPE_CACHE_MAX = 512;
|
|
195
369
|
/**
|
|
196
370
|
* @name weapp-tw-gulp
|
|
197
371
|
* @description native framework 的插件组合实现
|
|
@@ -203,7 +377,7 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
203
377
|
...options,
|
|
204
378
|
__internalDeferMissingCssEntriesWarning: true
|
|
205
379
|
});
|
|
206
|
-
const {
|
|
380
|
+
const { cache } = opts;
|
|
207
381
|
const initialTailwindRuntime = opts.tailwindRuntime;
|
|
208
382
|
const refreshTailwindcssRuntime = opts.refreshTailwindcssRuntime;
|
|
209
383
|
const readyPromise = require_context.createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
@@ -221,12 +395,13 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
221
395
|
let cachedGulpSourceCandidateSourceGetter;
|
|
222
396
|
let runtimeSetInitialized = false;
|
|
223
397
|
let runtimeSetDirty = false;
|
|
224
|
-
const runtimeSourceHashByFile = /* @__PURE__ */ new Map();
|
|
225
398
|
const runtimeSourcesByFile = /* @__PURE__ */ new Map();
|
|
399
|
+
const runtimeSnapshotState = require_hmr_timing.createRuntimeCompilationBuildState();
|
|
226
400
|
const generatedCssPreflightModeByFile = /* @__PURE__ */ new Map();
|
|
401
|
+
const compilationScopeBySourceFile = /* @__PURE__ */ new Map();
|
|
227
402
|
let cachedGulpSourceCandidateSignature;
|
|
228
403
|
const gulpProcessCacheKeys = /* @__PURE__ */ new Set();
|
|
229
|
-
const bundleRuntimeClassSetManager = options.__internalGulpRuntimeClassSetManager ?? require_hmr_timing.
|
|
404
|
+
const bundleRuntimeClassSetManager = options.__internalGulpRuntimeClassSetManager ?? require_hmr_timing.createRuntimeClassSetManager();
|
|
230
405
|
function invalidateGulpSourceCandidates() {
|
|
231
406
|
cachedGulpSourceCandidateSignature = void 0;
|
|
232
407
|
cachedGulpSourceCandidateGetter = void 0;
|
|
@@ -254,19 +429,18 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
254
429
|
}
|
|
255
430
|
async function refreshRuntimeSetForSource(file, rawSource, type) {
|
|
256
431
|
const filename = node_path.default.resolve(file.path);
|
|
257
|
-
const hash = cache.computeHash(rawSource);
|
|
258
|
-
const changed = runtimeSourceHashByFile.get(filename) !== hash;
|
|
259
|
-
runtimeSourceHashByFile.delete(filename);
|
|
260
|
-
runtimeSourceHashByFile.set(filename, hash);
|
|
261
432
|
touchMapEntry(runtimeSourcesByFile, filename, {
|
|
262
433
|
source: rawSource,
|
|
263
434
|
type
|
|
264
435
|
});
|
|
265
|
-
|
|
436
|
+
require_hmr_timing.removeRuntimeCompilationBuildStateFiles(runtimeSnapshotState, pruneGulpRuntimeSourceCaches(runtimeSourcesByFile));
|
|
437
|
+
const snapshot = createGulpRuntimeSnapshot(runtimeSourcesByFile, runtimeSnapshotState, (source) => cache.computeHash(source));
|
|
438
|
+
const changed = snapshot.changedByType[type].has(filename);
|
|
439
|
+
require_hmr_timing.updateRuntimeCompilationBuildState(runtimeSnapshotState, snapshot, /* @__PURE__ */ new Map());
|
|
266
440
|
if (changed) invalidateGulpSourceCandidates();
|
|
267
441
|
if (!changed && runtimeSetInitialized) return runtimeSet;
|
|
268
442
|
if (!runtimeSetDirty) try {
|
|
269
|
-
runtimeSet = await bundleRuntimeClassSetManager.sync(runtimeState.tailwindRuntime,
|
|
443
|
+
runtimeSet = await bundleRuntimeClassSetManager.sync(runtimeState.tailwindRuntime, snapshot);
|
|
270
444
|
runtimeSetInitialized = true;
|
|
271
445
|
return runtimeSet;
|
|
272
446
|
} catch (error) {
|
|
@@ -277,7 +451,7 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
277
451
|
}
|
|
278
452
|
async function refreshGulpV4SourceCandidates(forceRefresh = false) {
|
|
279
453
|
const root = opts.tailwindcssBasedir ?? node_process.default.cwd();
|
|
280
|
-
const sourceScan = await
|
|
454
|
+
const sourceScan = await require_options.resolveSourceScanEntries(opts, runtimeState.tailwindRuntime, { root });
|
|
281
455
|
const nextSignature = cache.computeHash(JSON.stringify({
|
|
282
456
|
root,
|
|
283
457
|
entries: sourceScan?.entries,
|
|
@@ -289,7 +463,7 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
289
463
|
dependencies: [...sourceScan?.dependencies ?? []].sort()
|
|
290
464
|
}));
|
|
291
465
|
if (!forceRefresh && cachedGulpSourceCandidateSignature === nextSignature && cachedGulpSourceCandidateGetter) return cachedGulpSourceCandidateGetter;
|
|
292
|
-
const collector =
|
|
466
|
+
const collector = require_v4_generation_core.createSourceCandidateCollector({
|
|
293
467
|
bareArbitraryValues: opts.arbitraryValues?.bareArbitraryValues,
|
|
294
468
|
customAttributesEntities: opts.customAttributesEntities,
|
|
295
469
|
disabledDefaultTemplateHandler: opts.disabledDefaultTemplateHandler
|
|
@@ -338,7 +512,7 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
338
512
|
return cachedDefaultModuleGraphOptions;
|
|
339
513
|
}
|
|
340
514
|
function resolveWxssHandlerOptions(options) {
|
|
341
|
-
const styleHandlerMajorVersion =
|
|
515
|
+
const styleHandlerMajorVersion = require_style_options.normalizeStyleHandlerMajorVersion(runtimeState.tailwindRuntime.majorVersion);
|
|
342
516
|
const majorVersion = styleHandlerMajorVersion ?? "unknown";
|
|
343
517
|
if (!options || Object.keys(options).length === 0) {
|
|
344
518
|
let cached = defaultStyleHandlerOptionsCache.get(majorVersion);
|
|
@@ -417,167 +591,78 @@ function createNativeGulpPlugins(options = {}) {
|
|
|
417
591
|
gulpProcessCacheKeys,
|
|
418
592
|
phase,
|
|
419
593
|
runtimeSet,
|
|
420
|
-
runtimeSourceHashByFile,
|
|
594
|
+
runtimeSourceHashByFile: runtimeSnapshotState.sourceHashByFile,
|
|
421
595
|
runtimeSourcesByFile
|
|
422
596
|
}) };
|
|
423
597
|
}
|
|
424
|
-
function
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if (shouldUseGenerator) gulpSourceCandidateGetter = await refreshGulpV4SourceCandidates(cssSourceChanged);
|
|
432
|
-
const nextRuntimeSet = await refreshRuntimeSet({
|
|
433
|
-
forceRefresh: cssSourceChanged,
|
|
434
|
-
forceCollect: cssSourceChanged,
|
|
435
|
-
clearCache: cssSourceChanged
|
|
436
|
-
});
|
|
437
|
-
const sourceTraceTokenSources = cachedGulpSourceCandidateSourceGetter ? require_hmr_timing.createCssTokenSourceMap(cachedGulpSourceCandidateSourceGetter(void 0), opts) : void 0;
|
|
438
|
-
const sourceTraceSignature = require_hmr_timing.createCssSourceTraceCacheSignature(sourceTraceTokenSources, opts);
|
|
439
|
-
const sourceCandidateSignature = cachedGulpSourceCandidateGetter ? `gulp-source-candidates:1:${[...cachedGulpSourceCandidateGetter(void 0)].sort().join("\n")}` : void 0;
|
|
440
|
-
const styleOutputExtension = resolveGulpStyleOutputExtension(file);
|
|
441
|
-
const outputSignature = styleOutputExtension ? `gulp-output:1:${stage}:${styleOutputExtension}` : `gulp-output:0:${stage}`;
|
|
442
|
-
await require_hmr_timing.processCachedTask({
|
|
443
|
-
cache,
|
|
444
|
-
cacheKey: file.path,
|
|
445
|
-
hash: createRuntimeSetHash(rawSource, nextRuntimeSet, sourceTraceSignature, sourceCandidateSignature, outputSignature),
|
|
446
|
-
applyResult(source) {
|
|
447
|
-
file.contents = node_buffer.Buffer.from(source);
|
|
448
|
-
},
|
|
449
|
-
onCacheHit() {
|
|
450
|
-
debug("css cache hit: %s", file.path);
|
|
451
|
-
},
|
|
452
|
-
async transform() {
|
|
453
|
-
await runtimeState.readyPromise;
|
|
454
|
-
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, rawSource, options);
|
|
455
|
-
const generated = shouldUseGenerator ? await require_hmr_timing.generateCssByGenerator({
|
|
456
|
-
opts,
|
|
457
|
-
runtimeState,
|
|
458
|
-
runtime: nextRuntimeSet,
|
|
459
|
-
rawSource,
|
|
460
|
-
file: file.path,
|
|
461
|
-
cssHandlerOptions,
|
|
462
|
-
cssUserHandlerOptions: resolveWxssUserHandlerOptions(options),
|
|
463
|
-
getSourceCandidatesForEntries: gulpSourceCandidateGetter,
|
|
464
|
-
styleHandler,
|
|
465
|
-
debug,
|
|
466
|
-
deferCssAdaptation: stage === "generate"
|
|
467
|
-
}) : void 0;
|
|
468
|
-
const transformedCss = generated?.css ?? (stage === "generate" ? rawSource : (await styleHandler(rawSource, cssHandlerOptions)).css);
|
|
469
|
-
if (stage === "generate") {
|
|
470
|
-
const preflightMode = generated?.metadata?.preflightMode;
|
|
471
|
-
if (preflightMode) generatedCssPreflightModeByFile.set(file.path, preflightMode);
|
|
472
|
-
else generatedCssPreflightModeByFile.delete(file.path);
|
|
473
|
-
}
|
|
474
|
-
const css = require_hmr_timing.annotateCssSourceTrace(transformedCss, {
|
|
475
|
-
opts,
|
|
476
|
-
tokenSources: sourceTraceTokenSources
|
|
477
|
-
});
|
|
478
|
-
const generatedCss = stage === "generate" && generated ? `${require_hmr_timing.createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
|
|
479
|
-
const outputCss = stage === "generate" ? generatedCss : (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss, { styleOutputExtension });
|
|
480
|
-
debug("css handle: %s", file.path);
|
|
481
|
-
return { result: outputCss };
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
485
|
-
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
486
|
-
}, () => resolveGulpTransformTimingDetails(`css:${stage}`));
|
|
598
|
+
function rememberCompilationScope(sourceFile, scopeId) {
|
|
599
|
+
touchMapEntry(compilationScopeBySourceFile, node_path.default.resolve(sourceFile), scopeId);
|
|
600
|
+
while (compilationScopeBySourceFile.size > GULP_COMPILATION_SCOPE_CACHE_MAX) {
|
|
601
|
+
const oldestSourceFile = compilationScopeBySourceFile.keys().next().value;
|
|
602
|
+
if (typeof oldestSourceFile !== "string") break;
|
|
603
|
+
compilationScopeBySourceFile.delete(oldestSourceFile);
|
|
604
|
+
}
|
|
487
605
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
preservePreflight: preflightMode?.preserve ?? cssHandlerOptions.isMainChunk,
|
|
502
|
-
styleOptions: cssHandlerOptions
|
|
503
|
-
}) : handled.css;
|
|
504
|
-
file.contents = node_buffer.Buffer.from((0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(finalized, { styleOutputExtension }));
|
|
505
|
-
debug("css adapt: %s", file.path);
|
|
506
|
-
}, () => resolveGulpTransformTimingDetails("css:adapt"));
|
|
507
|
-
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|
|
508
|
-
if (!file.contents) return;
|
|
509
|
-
const filename = node_path.default.resolve(file.path);
|
|
510
|
-
const rawSource = file.contents.toString();
|
|
511
|
-
await refreshRuntimeSetForSource(file, rawSource, "js");
|
|
512
|
-
await runtimeState.readyPromise;
|
|
513
|
-
const moduleGraph = resolveModuleGraphOptions(options.moduleGraph);
|
|
514
|
-
const handlerOptions = {
|
|
515
|
-
...options,
|
|
516
|
-
generateMap: false,
|
|
517
|
-
filename,
|
|
518
|
-
moduleGraph,
|
|
519
|
-
babelParserOptions: {
|
|
520
|
-
...options?.babelParserOptions ?? {},
|
|
521
|
-
sourceFilename: filename
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
if (runtimeState.tailwindRuntime.majorVersion !== void 0) handlerOptions.tailwindcssMajorVersion = runtimeState.tailwindRuntime.majorVersion;
|
|
525
|
-
await require_hmr_timing.processCachedTask({
|
|
526
|
-
cache,
|
|
527
|
-
cacheKey: file.path,
|
|
528
|
-
rawSource,
|
|
529
|
-
applyResult(source) {
|
|
530
|
-
file.contents = node_buffer.Buffer.from(source);
|
|
531
|
-
},
|
|
532
|
-
onCacheHit() {
|
|
533
|
-
debug("js cache hit: %s", file.path);
|
|
534
|
-
},
|
|
535
|
-
async transform() {
|
|
536
|
-
await runtimeState.readyPromise;
|
|
537
|
-
const currentSource = file.contents?.toString() ?? rawSource;
|
|
538
|
-
if (require_context.shouldSkipJsTransform(currentSource, {
|
|
539
|
-
...handlerOptions,
|
|
540
|
-
classNameSet: runtimeSet
|
|
541
|
-
})) return { result: currentSource };
|
|
542
|
-
const { code } = await jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
543
|
-
debug("js handle: %s", file.path);
|
|
544
|
-
return { result: code };
|
|
606
|
+
/** 记录 Gulp watcher 提交的源码或生成依赖变化。 */
|
|
607
|
+
async function watchChange(id, change = { event: "update" }) {
|
|
608
|
+
require_v4_generation_core.beginCompilerShadowRun(runtimeState);
|
|
609
|
+
const file = node_path.default.resolve(id);
|
|
610
|
+
const affectedScopes = require_v4_generation_core.recordCompilationDependencyChanges(runtimeState, require_v4_generation_core.createCompilationDependencyChanges([file]));
|
|
611
|
+
invalidateGulpSourceCandidates();
|
|
612
|
+
if (change.event === "delete") {
|
|
613
|
+
const removedRuntimeSource = runtimeSourcesByFile.delete(file);
|
|
614
|
+
const removedCssSource = require_generator.removeTailwindV4CssSource(opts, file);
|
|
615
|
+
const removedScopeId = compilationScopeBySourceFile.get(file);
|
|
616
|
+
if (removedScopeId) {
|
|
617
|
+
require_v4_generation_core.invalidateCompilationScope(runtimeState, removedScopeId);
|
|
618
|
+
compilationScopeBySourceFile.delete(file);
|
|
545
619
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
await require_hmr_timing.processCachedTask({
|
|
556
|
-
cache,
|
|
557
|
-
cacheKey: file.path,
|
|
558
|
-
rawSource,
|
|
559
|
-
applyResult(source) {
|
|
560
|
-
file.contents = node_buffer.Buffer.from(source);
|
|
561
|
-
},
|
|
562
|
-
onCacheHit() {
|
|
563
|
-
debug("html cache hit: %s", file.path);
|
|
564
|
-
},
|
|
565
|
-
async transform() {
|
|
566
|
-
await runtimeState.readyPromise;
|
|
567
|
-
const code = await templateHandler(rawSource, resolveWxmlHandlerOptions(options));
|
|
568
|
-
debug("html handle: %s", file.path);
|
|
569
|
-
return { result: code };
|
|
620
|
+
require_hmr_timing.removeRuntimeCompilationBuildStateFiles(runtimeSnapshotState, [file]);
|
|
621
|
+
generatedCssPreflightModeByFile.delete(file);
|
|
622
|
+
gulpProcessCacheKeys.delete(file);
|
|
623
|
+
cache.instance.delete(file);
|
|
624
|
+
cache.hashMap.delete(file);
|
|
625
|
+
if (removedRuntimeSource || removedCssSource) {
|
|
626
|
+
runtimeSetInitialized = false;
|
|
627
|
+
runtimeSetDirty = true;
|
|
628
|
+
await bundleRuntimeClassSetManager.reset();
|
|
570
629
|
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}, () => resolveGulpTransformTimingDetails("html"));
|
|
630
|
+
}
|
|
631
|
+
return affectedScopes;
|
|
632
|
+
}
|
|
575
633
|
return {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
634
|
+
...createGulpFileTransforms({
|
|
635
|
+
cache,
|
|
636
|
+
createRuntimeSetHash,
|
|
637
|
+
debug,
|
|
638
|
+
generatedCssPreflightModeByFile,
|
|
639
|
+
getCompilationDependencyRevision: (scopeId) => require_v4_generation_core.getCompilationScopeDependencyRevision(runtimeState, scopeId),
|
|
640
|
+
getSourceCandidateGetter: () => cachedGulpSourceCandidateGetter,
|
|
641
|
+
getSourceCandidateSourceGetter: () => cachedGulpSourceCandidateSourceGetter,
|
|
642
|
+
getRuntimeSet: () => runtimeSet,
|
|
643
|
+
gulpProcessCacheKeys,
|
|
644
|
+
opts,
|
|
645
|
+
refreshGulpV4SourceCandidates,
|
|
646
|
+
refreshRuntimeSet,
|
|
647
|
+
refreshRuntimeSetForSource,
|
|
648
|
+
registerAutoCssSource,
|
|
649
|
+
rememberCompilationScope,
|
|
650
|
+
resolveGulpStyleOutputExtension,
|
|
651
|
+
resolveGulpTransformTimingDetails,
|
|
652
|
+
resolveModuleGraphOptions,
|
|
653
|
+
resolveWxmlHandlerOptions,
|
|
654
|
+
resolveWxssFileHandlerOptions,
|
|
655
|
+
resolveWxssUserHandlerOptions,
|
|
656
|
+
runtimeState
|
|
657
|
+
}),
|
|
658
|
+
beginCompilerShadowRun: () => require_v4_generation_core.beginCompilerShadowRun(runtimeState),
|
|
659
|
+
completeCompilerShadowRun: (revision) => require_hmr_timing.finalizeCompilerShadowRun(runtimeState, { revision }),
|
|
660
|
+
async dispose() {
|
|
661
|
+
await require_v4_generation_core.disposeCompilerOwner(runtimeState);
|
|
662
|
+
await bundleRuntimeClassSetManager.reset();
|
|
663
|
+
},
|
|
664
|
+
getCompilerShadowRunSnapshot: () => require_v4_generation_core.getCompilerShadowRunSnapshot(runtimeState),
|
|
665
|
+
watchChange
|
|
581
666
|
};
|
|
582
667
|
}
|
|
583
668
|
//#endregion
|