weapp-tailwindcss 5.1.16 → 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 +4 -4
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +5 -3
- 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 +9 -2
- package/dist/bundlers/shared/generator-css/candidates.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +4 -3
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +58 -0
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +3 -14
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +3 -12
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +3 -12
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +3 -25
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +3 -4
- 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 +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +4 -3
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +9 -9
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +7 -6
- package/dist/bundlers/shared/generator-css/types.d.ts +12 -3
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -5
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -1
- package/dist/bundlers/shared/generator-css.d.ts +9 -9
- 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/{vite → shared}/source-candidates/collector.d.ts +1 -1
- 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/{vite → shared}/source-candidates/store.d.ts +1 -1
- package/dist/bundlers/{vite → shared}/source-candidates/types-and-cache.d.ts +3 -3
- 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 +8 -3
- 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 +3 -3
- package/dist/bundlers/vite/css-finalizer/plugin.d.ts +1 -1
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- 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 +1 -1
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +5 -5
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -2
- 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 → generate-bundle/runtime.d.ts} +4 -4
- 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 +6 -6
- 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 +2 -1
- package/dist/bundlers/vite/processed-css-assets/collector.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +1 -1
- 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 +4 -4
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +5 -5
- package/dist/bundlers/vite/processed-css-assets.d.ts +4 -4
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +3 -2
- 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 -1
- 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.d.ts +7 -7
- 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 -4
- 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 +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-task.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +11 -41
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/html-js-tasks.d.ts +1 -1
- 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 +4 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/memory-trace.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +6 -6
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/resources.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +4 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +9 -9
- 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 +4 -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 +2 -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 +4 -4
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +3 -3
- 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 +141 -168
- 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-BtLIID4m.js → context-PZXBqrAJ.cjs} +31 -93
- package/dist/{context-JzwzSX36.mjs → context-oTkxC5aZ.js} +22 -11
- 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-B91GhUJQ.js → generator-C8D5cnbe.cjs} +164 -33
- package/dist/{generator-Bv7myuhY.mjs → generator-CDdzqf1S.js} +155 -30
- package/dist/generator.cjs +12 -0
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +2 -12
- package/dist/{gulp-Q1wITegn.js → gulp-Cjcss8T_.cjs} +157 -103
- package/dist/{gulp-CKSklPlH.mjs → gulp-DNXQvDUw.js} +141 -90
- package/dist/gulp.cjs +5 -0
- package/dist/gulp.d.ts +4 -4
- package/dist/gulp.js +2 -5
- package/dist/{hmr-timing-BXg7nI8N.mjs → hmr-timing-CuJwQzDc.js} +3824 -1988
- 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.d.ts +1 -1
- package/dist/source-candidate-scan-signature-B0S7f5P7.js +421 -0
- package/dist/source-candidate-scan-signature-BmSuoxR9.cjs +555 -0
- 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/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/engine.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +4 -5
- 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 -2
- 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-B4phC0kB.js → tailwindcss-Cs94gJgf.cjs} +9 -769
- package/dist/{tailwindcss-BTcXX8Ka.mjs → tailwindcss-D7TGiZR2.js} +22 -22
- 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-CMPaWn9P.js → v4-generation-core-D7MuR5ZF.cjs} +3468 -2059
- package/dist/{vite-BwQWl9ft.mjs → vite-BI1TeUPO.js} +5968 -4456
- package/dist/{vite-DhVnXvAQ.js → vite-CBzmUTu-.cjs} +6159 -4672
- 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} +9 -11
- package/dist/{webpack-kh78iMSS.js → webpack-Dao6bWEj.cjs} +208 -954
- package/dist/{webpack-Bo1QrFPf.mjs → webpack-dAY9h8r8.js} +105 -101
- 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 -714
- package/package.json +56 -53
- 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/source-candidate-scan-signature-BKZZk_e6.js +0 -1078
- package/dist/source-candidate-scan-signature-CtK-mB_C.mjs +0 -854
- 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-B0tVkJLH.js +0 -10524
- 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,21 +1,21 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_framework = require("./framework.
|
|
3
|
-
require("./auto-DtU6f3X6.
|
|
4
|
-
const require_object = require("./object-
|
|
5
|
-
require("./utils-CuKLf1Zv.
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
|
+
const require_framework = require("./framework.cjs");
|
|
3
|
+
require("./auto-DtU6f3X6.cjs");
|
|
4
|
+
const require_object = require("./object-C_Vr6_S5.cjs");
|
|
5
|
+
require("./utils-CuKLf1Zv.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
|
-
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
7
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
8
8
|
let node_path = require("node:path");
|
|
9
|
-
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
9
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
10
10
|
let node_process = require("node:process");
|
|
11
|
-
node_process = require_rolldown_runtime.__toESM(node_process);
|
|
11
|
+
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
12
12
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
13
13
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
14
14
|
let lru_cache = require("lru-cache");
|
|
15
15
|
let node_module = require("node:module");
|
|
16
16
|
let node_fs_promises = require("node:fs/promises");
|
|
17
17
|
let micromatch = require("micromatch");
|
|
18
|
-
micromatch = require_rolldown_runtime.__toESM(micromatch);
|
|
18
|
+
micromatch = require_rolldown_runtime.__toESM(micromatch, 1);
|
|
19
19
|
//#region src/runtime-branch/generator-target-env.ts
|
|
20
20
|
const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
|
|
21
21
|
const uniWebPlatformEnvKeys = ["UNI_PLATFORM", "UNI_UTS_PLATFORM"];
|
|
@@ -136,13 +136,18 @@ function createDependencyFingerprint(files) {
|
|
|
136
136
|
}
|
|
137
137
|
}).join("|");
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function createTailwindV4SourceCacheKey(source) {
|
|
140
140
|
return [
|
|
141
141
|
source.projectRoot,
|
|
142
142
|
source.base,
|
|
143
143
|
createStableJson(source.baseFallbacks),
|
|
144
144
|
source.css,
|
|
145
|
-
createDependencyFingerprint(source.dependencies)
|
|
145
|
+
createDependencyFingerprint(source.dependencies)
|
|
146
|
+
].join("\0");
|
|
147
|
+
}
|
|
148
|
+
function createIncrementalGenerateCacheKey(source, target, styleOptions) {
|
|
149
|
+
return [
|
|
150
|
+
createTailwindV4SourceCacheKey(source),
|
|
146
151
|
target,
|
|
147
152
|
createStableJson(styleOptions)
|
|
148
153
|
].join("\0");
|
|
@@ -179,9 +184,6 @@ function resolveTargetCandidates(candidates, target) {
|
|
|
179
184
|
function collectSeenCandidates(generated) {
|
|
180
185
|
return new Set(generated.classSet);
|
|
181
186
|
}
|
|
182
|
-
function shouldDelegateWebSourceScanToTailwind(target, scanSources) {
|
|
183
|
-
return target === "web" && scanSources !== false;
|
|
184
|
-
}
|
|
185
187
|
function createIncrementalStyleOptions(styleOptions) {
|
|
186
188
|
return {
|
|
187
189
|
...styleOptions,
|
|
@@ -252,9 +254,6 @@ function normalizeTargetRpxLengthCandidates(candidates, target, styleOptions) {
|
|
|
252
254
|
restoreCandidates: /* @__PURE__ */ new Map()
|
|
253
255
|
};
|
|
254
256
|
}
|
|
255
|
-
function resolveGeneratedSourcePatterns(generatedSources, scanSources) {
|
|
256
|
-
return Array.isArray(scanSources) ? scanSources : generatedSources;
|
|
257
|
-
}
|
|
258
257
|
//#endregion
|
|
259
258
|
//#region src/tailwindcss/v4-engine/generator/cache-stats.ts
|
|
260
259
|
function getTailwindV4IncrementalGenerateCacheStats() {
|
|
@@ -304,7 +303,9 @@ function normalizeTailwindV4GeneratedUrlValues(css) {
|
|
|
304
303
|
});
|
|
305
304
|
}
|
|
306
305
|
async function transformTailwindV4CssToWeapp(css, options) {
|
|
307
|
-
const
|
|
306
|
+
const compatibleCss = normalizeTailwindV4GeneratedUrlValues((0, _weapp_tailwindcss_postcss.hasCssMacroStyleOptions)(options) ? await (0, _weapp_tailwindcss_postcss.transformCssMacroCss)(css, options) : css);
|
|
307
|
+
const customPropertyValues = options?.customPropertyValues;
|
|
308
|
+
const protectedCss = (0, _weapp_tailwindcss_postcss.protectDynamicColorMixAlpha)(compatibleCss, { customPropertyValues });
|
|
308
309
|
const result = await defaultStyleHandler(protectedCss.css, {
|
|
309
310
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
310
311
|
cssRemoveHoverPseudoClass: true,
|
|
@@ -313,6 +314,7 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
313
314
|
...options
|
|
314
315
|
});
|
|
315
316
|
const pruneOptions = {
|
|
317
|
+
preserveContentInit: options?.uniAppX === true && options.uniAppXCssTarget === "uvue" ? false : void 0,
|
|
316
318
|
preservePreflight: true,
|
|
317
319
|
preserveConditionalComments: (0, _weapp_tailwindcss_postcss.hasCssMacroStyleOptions)(options)
|
|
318
320
|
};
|
|
@@ -822,6 +824,55 @@ function createCompatibleSource(source, target) {
|
|
|
822
824
|
};
|
|
823
825
|
}
|
|
824
826
|
//#endregion
|
|
827
|
+
//#region src/tailwindcss/v4-engine/generator/native-session.ts
|
|
828
|
+
var TailwindV4NativeSessionPool = class {
|
|
829
|
+
constructor(createSession = _tailwindcss_mangle_engine.createTailwindGenerationSession) {
|
|
830
|
+
this.createSession = createSession;
|
|
831
|
+
require_object._defineProperty(this, "sessions", /* @__PURE__ */ new Map());
|
|
832
|
+
require_object._defineProperty(this, "disposed", false);
|
|
833
|
+
}
|
|
834
|
+
generate(target, sourceKey, source, request) {
|
|
835
|
+
const entry = this.getSession(target, sourceKey, source);
|
|
836
|
+
const generated = entry.pending.then(() => entry.session.generate(request));
|
|
837
|
+
entry.pending = generated.then(() => void 0, () => void 0);
|
|
838
|
+
return generated;
|
|
839
|
+
}
|
|
840
|
+
dispose() {
|
|
841
|
+
for (const entry of this.sessions.values()) this.disposeEntry(entry);
|
|
842
|
+
this.sessions.clear();
|
|
843
|
+
this.disposed = true;
|
|
844
|
+
}
|
|
845
|
+
get size() {
|
|
846
|
+
return this.sessions.size;
|
|
847
|
+
}
|
|
848
|
+
getSession(target, sourceKey, source) {
|
|
849
|
+
if (this.disposed) throw new Error("TailwindV4NativeSessionPool 已释放。");
|
|
850
|
+
const cached = this.sessions.get(target);
|
|
851
|
+
if (cached?.sourceKey === sourceKey) return cached;
|
|
852
|
+
if (cached) this.disposeEntry(cached);
|
|
853
|
+
const session = this.createSession(source);
|
|
854
|
+
const entry = {
|
|
855
|
+
pending: Promise.resolve(),
|
|
856
|
+
session,
|
|
857
|
+
sourceKey
|
|
858
|
+
};
|
|
859
|
+
this.sessions.set(target, entry);
|
|
860
|
+
return entry;
|
|
861
|
+
}
|
|
862
|
+
disposeEntry(entry) {
|
|
863
|
+
entry.pending.then(() => entry.session.dispose());
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
function createEngineSourceEntries(sources, sourceId) {
|
|
867
|
+
return sources.map((source, index) => ({
|
|
868
|
+
id: `${sourceId}:candidate-source:${index}`,
|
|
869
|
+
...source
|
|
870
|
+
}));
|
|
871
|
+
}
|
|
872
|
+
function serializeTailwindGenerationArtifact(artifact) {
|
|
873
|
+
return [...artifact.fragments].sort((left, right) => left.order - right.order).map((fragment) => fragment.root.toString()).join("\n");
|
|
874
|
+
}
|
|
875
|
+
//#endregion
|
|
825
876
|
//#region src/tailwindcss/source-scan.ts
|
|
826
877
|
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
827
878
|
"html",
|
|
@@ -1182,30 +1233,81 @@ async function resolveScanSources(source, scanSources) {
|
|
|
1182
1233
|
if (scanSources !== true) return scanSources;
|
|
1183
1234
|
return await resolveCssDefinedScanSources(source) ?? false;
|
|
1184
1235
|
}
|
|
1236
|
+
function resolveCompiledSourceRoot(source) {
|
|
1237
|
+
let root = null;
|
|
1238
|
+
try {
|
|
1239
|
+
_weapp_tailwindcss_postcss.postcss.parse(source.css).walkAtRules("import", (rule) => {
|
|
1240
|
+
if (!isTailwindCssImport(rule.params)) return;
|
|
1241
|
+
const sourceParam = parseImportSourceParam(rule.params);
|
|
1242
|
+
if (sourceParam?.none) {
|
|
1243
|
+
root = "none";
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
if (sourceParam?.sourcePath) {
|
|
1247
|
+
root = {
|
|
1248
|
+
base: source.base,
|
|
1249
|
+
pattern: sourceParam.sourcePath
|
|
1250
|
+
};
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1253
|
+
});
|
|
1254
|
+
} catch {}
|
|
1255
|
+
return root;
|
|
1256
|
+
}
|
|
1185
1257
|
//#endregion
|
|
1186
1258
|
//#region src/tailwindcss/v4-engine/generator/engine.ts
|
|
1259
|
+
function isCssSyntaxError(error) {
|
|
1260
|
+
return error instanceof Error && error.name === "CssSyntaxError";
|
|
1261
|
+
}
|
|
1187
1262
|
function createTailwindV4Engine(source) {
|
|
1263
|
+
const generationSessions = new TailwindV4NativeSessionPool();
|
|
1264
|
+
const incrementalCacheKeys = /* @__PURE__ */ new Set();
|
|
1265
|
+
const validationEngine = (0, _tailwindcss_mangle_engine.createTailwindV4Engine)(source);
|
|
1188
1266
|
async function generateOnce(generateSource, options = {}) {
|
|
1189
1267
|
const { scanSources = true, styleOptions, target = "weapp", ...patchOptions } = options;
|
|
1190
1268
|
const resolvedStyleOptions = resolveStyleOptions(generateSource, styleOptions);
|
|
1191
|
-
const
|
|
1269
|
+
const compatibleSource = createCompatibleSource(resolveCssMacroTailwindV4Source(generateSource), target);
|
|
1192
1270
|
const resolvedScanSources = await resolveScanSources(generateSource, scanSources);
|
|
1193
|
-
const
|
|
1194
|
-
const filesystemCandidates = !delegateSourceScan && Array.isArray(resolvedScanSources) ? new Set(await (0, _tailwindcss_mangle_engine.extractRawCandidates)(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
|
|
1271
|
+
const filesystemCandidates = Array.isArray(resolvedScanSources) ? new Set(await (0, _tailwindcss_mangle_engine.extractRawCandidates)(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
|
|
1195
1272
|
const normalizedCandidates = normalizeTargetRpxLengthCandidates(resolveTargetCandidates(/* @__PURE__ */ new Set([...collectCandidates(patchOptions.candidates), ...filesystemCandidates ?? []]), target), target, resolvedStyleOptions);
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
-
...patchOptions,
|
|
1273
|
+
const sourceId = compatibleSource.dependencies[0] ?? compatibleSource.base;
|
|
1274
|
+
const generationRequest = {
|
|
1275
|
+
...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues },
|
|
1276
|
+
...patchOptions.sources === void 0 ? {} : { sourceEntries: createEngineSourceEntries(patchOptions.sources, sourceId) },
|
|
1199
1277
|
candidates: normalizedCandidates.candidates
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1278
|
+
};
|
|
1279
|
+
let generatedCss;
|
|
1280
|
+
let classSet;
|
|
1281
|
+
let rawCandidates;
|
|
1282
|
+
let dependencies;
|
|
1283
|
+
try {
|
|
1284
|
+
const artifact = await generationSessions.generate(target, createTailwindV4SourceCacheKey(compatibleSource), compatibleSource, generationRequest);
|
|
1285
|
+
generatedCss = serializeTailwindGenerationArtifact(artifact);
|
|
1286
|
+
classSet = artifact.classSet;
|
|
1287
|
+
rawCandidates = artifact.rawCandidates;
|
|
1288
|
+
dependencies = artifact.dependencies;
|
|
1289
|
+
} catch (error) {
|
|
1290
|
+
if (!isCssSyntaxError(error)) throw error;
|
|
1291
|
+
const legacyResult = await (0, _tailwindcss_mangle_engine.createTailwindV4Engine)(compatibleSource).generate({
|
|
1292
|
+
...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues },
|
|
1293
|
+
...patchOptions.sources === void 0 ? {} : { sources: patchOptions.sources },
|
|
1294
|
+
candidates: normalizedCandidates.candidates,
|
|
1295
|
+
scanSources: false
|
|
1296
|
+
});
|
|
1297
|
+
generatedCss = legacyResult.css;
|
|
1298
|
+
classSet = legacyResult.classSet;
|
|
1299
|
+
rawCandidates = legacyResult.rawCandidates;
|
|
1300
|
+
dependencies = legacyResult.dependencies;
|
|
1301
|
+
}
|
|
1302
|
+
const sources = Array.isArray(resolvedScanSources) ? resolvedScanSources : [];
|
|
1303
|
+
const rawCss = restoreRpxLengthCssSelectors(generatedCss, normalizedCandidates.restoreCandidates);
|
|
1203
1304
|
const css = await transformTailwindV4CssByTarget(rawCss, target, resolvedStyleOptions);
|
|
1204
1305
|
return {
|
|
1205
|
-
|
|
1306
|
+
classSet: restoreRpxLengthCandidates(classSet, normalizedCandidates.restoreCandidates),
|
|
1307
|
+
rawCandidates: restoreRpxLengthCandidates(rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1308
|
+
dependencies,
|
|
1309
|
+
root: resolveCompiledSourceRoot(compatibleSource),
|
|
1206
1310
|
sources,
|
|
1207
|
-
classSet: restoreRpxLengthCandidates(result.classSet, normalizedCandidates.restoreCandidates),
|
|
1208
|
-
rawCandidates: restoreRpxLengthCandidates(result.rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1209
1311
|
css,
|
|
1210
1312
|
rawCss,
|
|
1211
1313
|
target
|
|
@@ -1219,6 +1321,7 @@ function createTailwindV4Engine(source) {
|
|
|
1219
1321
|
const styleOptions = resolveStyleOptions(source, options.styleOptions);
|
|
1220
1322
|
if ((options.sources?.length ?? 0) > 0 || options.bareArbitraryValues !== void 0 || Array.isArray(options.scanSources)) return generateOnce(cssMacroSource, options);
|
|
1221
1323
|
const cacheKey = createIncrementalGenerateCacheKey(compatibleSource, target, styleOptions);
|
|
1324
|
+
incrementalCacheKeys.add(cacheKey);
|
|
1222
1325
|
if (options.scanSources === true) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
1223
1326
|
const generated = await generateOnce(cssMacroSource, options);
|
|
1224
1327
|
if (!seedIncrementalGenerateCache({
|
|
@@ -1323,9 +1426,14 @@ function createTailwindV4Engine(source) {
|
|
|
1323
1426
|
}
|
|
1324
1427
|
return {
|
|
1325
1428
|
source,
|
|
1326
|
-
loadDesignSystem:
|
|
1327
|
-
validateCandidates:
|
|
1328
|
-
generate
|
|
1429
|
+
loadDesignSystem: validationEngine.loadDesignSystem,
|
|
1430
|
+
validateCandidates: validationEngine.validateCandidates,
|
|
1431
|
+
generate,
|
|
1432
|
+
dispose() {
|
|
1433
|
+
generationSessions.dispose();
|
|
1434
|
+
for (const cacheKey of incrementalCacheKeys) incrementalGenerateCache.delete(cacheKey);
|
|
1435
|
+
incrementalCacheKeys.clear();
|
|
1436
|
+
}
|
|
1329
1437
|
};
|
|
1330
1438
|
}
|
|
1331
1439
|
//#endregion
|
|
@@ -2694,6 +2802,23 @@ function upsertTailwindV4CssSource(opts, source) {
|
|
|
2694
2802
|
};
|
|
2695
2803
|
return true;
|
|
2696
2804
|
}
|
|
2805
|
+
function removeTailwindV4CssSource(opts, file) {
|
|
2806
|
+
const tailwindcss = opts.tailwindcss;
|
|
2807
|
+
const v4 = tailwindcss?.v4;
|
|
2808
|
+
const cssSources = v4?.cssSources;
|
|
2809
|
+
if (!cssSources || cssSources.length === 0) return false;
|
|
2810
|
+
const sourceFile = normalizeCssSourceFile(file);
|
|
2811
|
+
const nextCssSources = cssSources.filter((source) => normalizeCssSourceFile(source.file) !== sourceFile);
|
|
2812
|
+
if (nextCssSources.length === cssSources.length) return false;
|
|
2813
|
+
opts.tailwindcss = {
|
|
2814
|
+
...tailwindcss,
|
|
2815
|
+
v4: {
|
|
2816
|
+
...v4,
|
|
2817
|
+
cssSources: nextCssSources
|
|
2818
|
+
}
|
|
2819
|
+
};
|
|
2820
|
+
return true;
|
|
2821
|
+
}
|
|
2697
2822
|
//#endregion
|
|
2698
2823
|
//#region src/tailwindcss/v4-engine/source.ts
|
|
2699
2824
|
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
@@ -3363,6 +3488,12 @@ Object.defineProperty(exports, "removeTailwindSourceDirectives", {
|
|
|
3363
3488
|
return removeTailwindSourceDirectives;
|
|
3364
3489
|
}
|
|
3365
3490
|
});
|
|
3491
|
+
Object.defineProperty(exports, "removeTailwindV4CssSource", {
|
|
3492
|
+
enumerable: true,
|
|
3493
|
+
get: function() {
|
|
3494
|
+
return removeTailwindV4CssSource;
|
|
3495
|
+
}
|
|
3496
|
+
});
|
|
3366
3497
|
Object.defineProperty(exports, "removeTailwindV4GeneratedUserCssArtifacts", {
|
|
3367
3498
|
enumerable: true,
|
|
3368
3499
|
get: function() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.
|
|
2
|
-
import { c as withCssMacroStyleOptions, i as hasCssMacroTailwindV4Source, o as transformCssMacroCss, s as transformCssMacroTailwindV4Source, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.
|
|
3
|
-
import { t as omitUndefined } from "./object-
|
|
4
|
-
import "./utils-MVwpU07P.
|
|
1
|
+
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.js";
|
|
2
|
+
import { c as withCssMacroStyleOptions, i as hasCssMacroTailwindV4Source, o as transformCssMacroCss, s as transformCssMacroTailwindV4Source, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.js";
|
|
3
|
+
import { n as _defineProperty, t as omitUndefined } from "./object-Bvy6-w9r.js";
|
|
4
|
+
import "./utils-MVwpU07P.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
9
|
-
import { createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
9
|
+
import { createTailwindGenerationSession, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
10
10
|
import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
11
11
|
import { LRUCache } from "lru-cache";
|
|
12
12
|
import { stat } from "node:fs/promises";
|
|
@@ -131,13 +131,18 @@ function createDependencyFingerprint(files) {
|
|
|
131
131
|
}
|
|
132
132
|
}).join("|");
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function createTailwindV4SourceCacheKey(source) {
|
|
135
135
|
return [
|
|
136
136
|
source.projectRoot,
|
|
137
137
|
source.base,
|
|
138
138
|
createStableJson(source.baseFallbacks),
|
|
139
139
|
source.css,
|
|
140
|
-
createDependencyFingerprint(source.dependencies)
|
|
140
|
+
createDependencyFingerprint(source.dependencies)
|
|
141
|
+
].join("\0");
|
|
142
|
+
}
|
|
143
|
+
function createIncrementalGenerateCacheKey(source, target, styleOptions) {
|
|
144
|
+
return [
|
|
145
|
+
createTailwindV4SourceCacheKey(source),
|
|
141
146
|
target,
|
|
142
147
|
createStableJson(styleOptions)
|
|
143
148
|
].join("\0");
|
|
@@ -174,9 +179,6 @@ function resolveTargetCandidates(candidates, target) {
|
|
|
174
179
|
function collectSeenCandidates(generated) {
|
|
175
180
|
return new Set(generated.classSet);
|
|
176
181
|
}
|
|
177
|
-
function shouldDelegateWebSourceScanToTailwind(target, scanSources) {
|
|
178
|
-
return target === "web" && scanSources !== false;
|
|
179
|
-
}
|
|
180
182
|
function createIncrementalStyleOptions(styleOptions) {
|
|
181
183
|
return {
|
|
182
184
|
...styleOptions,
|
|
@@ -247,9 +249,6 @@ function normalizeTargetRpxLengthCandidates(candidates, target, styleOptions) {
|
|
|
247
249
|
restoreCandidates: /* @__PURE__ */ new Map()
|
|
248
250
|
};
|
|
249
251
|
}
|
|
250
|
-
function resolveGeneratedSourcePatterns(generatedSources, scanSources) {
|
|
251
|
-
return Array.isArray(scanSources) ? scanSources : generatedSources;
|
|
252
|
-
}
|
|
253
252
|
//#endregion
|
|
254
253
|
//#region src/tailwindcss/v4-engine/generator/cache-stats.ts
|
|
255
254
|
function getTailwindV4IncrementalGenerateCacheStats() {
|
|
@@ -299,7 +298,9 @@ function normalizeTailwindV4GeneratedUrlValues(css) {
|
|
|
299
298
|
});
|
|
300
299
|
}
|
|
301
300
|
async function transformTailwindV4CssToWeapp(css, options) {
|
|
302
|
-
const
|
|
301
|
+
const compatibleCss = normalizeTailwindV4GeneratedUrlValues(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css);
|
|
302
|
+
const customPropertyValues = options?.customPropertyValues;
|
|
303
|
+
const protectedCss = protectDynamicColorMixAlpha(compatibleCss, { customPropertyValues });
|
|
303
304
|
const result = await defaultStyleHandler(protectedCss.css, {
|
|
304
305
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
305
306
|
cssRemoveHoverPseudoClass: true,
|
|
@@ -308,6 +309,7 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
308
309
|
...options
|
|
309
310
|
});
|
|
310
311
|
const pruneOptions = {
|
|
312
|
+
preserveContentInit: options?.uniAppX === true && options.uniAppXCssTarget === "uvue" ? false : void 0,
|
|
311
313
|
preservePreflight: true,
|
|
312
314
|
preserveConditionalComments: hasCssMacroStyleOptions(options)
|
|
313
315
|
};
|
|
@@ -817,6 +819,55 @@ function createCompatibleSource(source, target) {
|
|
|
817
819
|
};
|
|
818
820
|
}
|
|
819
821
|
//#endregion
|
|
822
|
+
//#region src/tailwindcss/v4-engine/generator/native-session.ts
|
|
823
|
+
var TailwindV4NativeSessionPool = class {
|
|
824
|
+
constructor(createSession = createTailwindGenerationSession) {
|
|
825
|
+
this.createSession = createSession;
|
|
826
|
+
_defineProperty(this, "sessions", /* @__PURE__ */ new Map());
|
|
827
|
+
_defineProperty(this, "disposed", false);
|
|
828
|
+
}
|
|
829
|
+
generate(target, sourceKey, source, request) {
|
|
830
|
+
const entry = this.getSession(target, sourceKey, source);
|
|
831
|
+
const generated = entry.pending.then(() => entry.session.generate(request));
|
|
832
|
+
entry.pending = generated.then(() => void 0, () => void 0);
|
|
833
|
+
return generated;
|
|
834
|
+
}
|
|
835
|
+
dispose() {
|
|
836
|
+
for (const entry of this.sessions.values()) this.disposeEntry(entry);
|
|
837
|
+
this.sessions.clear();
|
|
838
|
+
this.disposed = true;
|
|
839
|
+
}
|
|
840
|
+
get size() {
|
|
841
|
+
return this.sessions.size;
|
|
842
|
+
}
|
|
843
|
+
getSession(target, sourceKey, source) {
|
|
844
|
+
if (this.disposed) throw new Error("TailwindV4NativeSessionPool 已释放。");
|
|
845
|
+
const cached = this.sessions.get(target);
|
|
846
|
+
if (cached?.sourceKey === sourceKey) return cached;
|
|
847
|
+
if (cached) this.disposeEntry(cached);
|
|
848
|
+
const session = this.createSession(source);
|
|
849
|
+
const entry = {
|
|
850
|
+
pending: Promise.resolve(),
|
|
851
|
+
session,
|
|
852
|
+
sourceKey
|
|
853
|
+
};
|
|
854
|
+
this.sessions.set(target, entry);
|
|
855
|
+
return entry;
|
|
856
|
+
}
|
|
857
|
+
disposeEntry(entry) {
|
|
858
|
+
entry.pending.then(() => entry.session.dispose());
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
function createEngineSourceEntries(sources, sourceId) {
|
|
862
|
+
return sources.map((source, index) => ({
|
|
863
|
+
id: `${sourceId}:candidate-source:${index}`,
|
|
864
|
+
...source
|
|
865
|
+
}));
|
|
866
|
+
}
|
|
867
|
+
function serializeTailwindGenerationArtifact(artifact) {
|
|
868
|
+
return [...artifact.fragments].sort((left, right) => left.order - right.order).map((fragment) => fragment.root.toString()).join("\n");
|
|
869
|
+
}
|
|
870
|
+
//#endregion
|
|
820
871
|
//#region src/tailwindcss/source-scan.ts
|
|
821
872
|
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
822
873
|
"html",
|
|
@@ -1177,30 +1228,81 @@ async function resolveScanSources(source, scanSources) {
|
|
|
1177
1228
|
if (scanSources !== true) return scanSources;
|
|
1178
1229
|
return await resolveCssDefinedScanSources(source) ?? false;
|
|
1179
1230
|
}
|
|
1231
|
+
function resolveCompiledSourceRoot(source) {
|
|
1232
|
+
let root = null;
|
|
1233
|
+
try {
|
|
1234
|
+
postcss.parse(source.css).walkAtRules("import", (rule) => {
|
|
1235
|
+
if (!isTailwindCssImport(rule.params)) return;
|
|
1236
|
+
const sourceParam = parseImportSourceParam(rule.params);
|
|
1237
|
+
if (sourceParam?.none) {
|
|
1238
|
+
root = "none";
|
|
1239
|
+
return false;
|
|
1240
|
+
}
|
|
1241
|
+
if (sourceParam?.sourcePath) {
|
|
1242
|
+
root = {
|
|
1243
|
+
base: source.base,
|
|
1244
|
+
pattern: sourceParam.sourcePath
|
|
1245
|
+
};
|
|
1246
|
+
return false;
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
} catch {}
|
|
1250
|
+
return root;
|
|
1251
|
+
}
|
|
1180
1252
|
//#endregion
|
|
1181
1253
|
//#region src/tailwindcss/v4-engine/generator/engine.ts
|
|
1254
|
+
function isCssSyntaxError(error) {
|
|
1255
|
+
return error instanceof Error && error.name === "CssSyntaxError";
|
|
1256
|
+
}
|
|
1182
1257
|
function createTailwindV4Engine$1(source) {
|
|
1258
|
+
const generationSessions = new TailwindV4NativeSessionPool();
|
|
1259
|
+
const incrementalCacheKeys = /* @__PURE__ */ new Set();
|
|
1260
|
+
const validationEngine = createTailwindV4Engine(source);
|
|
1183
1261
|
async function generateOnce(generateSource, options = {}) {
|
|
1184
1262
|
const { scanSources = true, styleOptions, target = "weapp", ...patchOptions } = options;
|
|
1185
1263
|
const resolvedStyleOptions = resolveStyleOptions(generateSource, styleOptions);
|
|
1186
|
-
const
|
|
1264
|
+
const compatibleSource = createCompatibleSource(resolveCssMacroTailwindV4Source(generateSource), target);
|
|
1187
1265
|
const resolvedScanSources = await resolveScanSources(generateSource, scanSources);
|
|
1188
|
-
const
|
|
1189
|
-
const filesystemCandidates = !delegateSourceScan && Array.isArray(resolvedScanSources) ? new Set(await extractRawCandidates(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
|
|
1266
|
+
const filesystemCandidates = Array.isArray(resolvedScanSources) ? new Set(await extractRawCandidates(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
|
|
1190
1267
|
const normalizedCandidates = normalizeTargetRpxLengthCandidates(resolveTargetCandidates(/* @__PURE__ */ new Set([...collectCandidates(patchOptions.candidates), ...filesystemCandidates ?? []]), target), target, resolvedStyleOptions);
|
|
1191
|
-
const
|
|
1192
|
-
|
|
1193
|
-
...patchOptions,
|
|
1268
|
+
const sourceId = compatibleSource.dependencies[0] ?? compatibleSource.base;
|
|
1269
|
+
const generationRequest = {
|
|
1270
|
+
...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues },
|
|
1271
|
+
...patchOptions.sources === void 0 ? {} : { sourceEntries: createEngineSourceEntries(patchOptions.sources, sourceId) },
|
|
1194
1272
|
candidates: normalizedCandidates.candidates
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1273
|
+
};
|
|
1274
|
+
let generatedCss;
|
|
1275
|
+
let classSet;
|
|
1276
|
+
let rawCandidates;
|
|
1277
|
+
let dependencies;
|
|
1278
|
+
try {
|
|
1279
|
+
const artifact = await generationSessions.generate(target, createTailwindV4SourceCacheKey(compatibleSource), compatibleSource, generationRequest);
|
|
1280
|
+
generatedCss = serializeTailwindGenerationArtifact(artifact);
|
|
1281
|
+
classSet = artifact.classSet;
|
|
1282
|
+
rawCandidates = artifact.rawCandidates;
|
|
1283
|
+
dependencies = artifact.dependencies;
|
|
1284
|
+
} catch (error) {
|
|
1285
|
+
if (!isCssSyntaxError(error)) throw error;
|
|
1286
|
+
const legacyResult = await createTailwindV4Engine(compatibleSource).generate({
|
|
1287
|
+
...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues },
|
|
1288
|
+
...patchOptions.sources === void 0 ? {} : { sources: patchOptions.sources },
|
|
1289
|
+
candidates: normalizedCandidates.candidates,
|
|
1290
|
+
scanSources: false
|
|
1291
|
+
});
|
|
1292
|
+
generatedCss = legacyResult.css;
|
|
1293
|
+
classSet = legacyResult.classSet;
|
|
1294
|
+
rawCandidates = legacyResult.rawCandidates;
|
|
1295
|
+
dependencies = legacyResult.dependencies;
|
|
1296
|
+
}
|
|
1297
|
+
const sources = Array.isArray(resolvedScanSources) ? resolvedScanSources : [];
|
|
1298
|
+
const rawCss = restoreRpxLengthCssSelectors(generatedCss, normalizedCandidates.restoreCandidates);
|
|
1198
1299
|
const css = await transformTailwindV4CssByTarget(rawCss, target, resolvedStyleOptions);
|
|
1199
1300
|
return {
|
|
1200
|
-
|
|
1301
|
+
classSet: restoreRpxLengthCandidates(classSet, normalizedCandidates.restoreCandidates),
|
|
1302
|
+
rawCandidates: restoreRpxLengthCandidates(rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1303
|
+
dependencies,
|
|
1304
|
+
root: resolveCompiledSourceRoot(compatibleSource),
|
|
1201
1305
|
sources,
|
|
1202
|
-
classSet: restoreRpxLengthCandidates(result.classSet, normalizedCandidates.restoreCandidates),
|
|
1203
|
-
rawCandidates: restoreRpxLengthCandidates(result.rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1204
1306
|
css,
|
|
1205
1307
|
rawCss,
|
|
1206
1308
|
target
|
|
@@ -1214,6 +1316,7 @@ function createTailwindV4Engine$1(source) {
|
|
|
1214
1316
|
const styleOptions = resolveStyleOptions(source, options.styleOptions);
|
|
1215
1317
|
if ((options.sources?.length ?? 0) > 0 || options.bareArbitraryValues !== void 0 || Array.isArray(options.scanSources)) return generateOnce(cssMacroSource, options);
|
|
1216
1318
|
const cacheKey = createIncrementalGenerateCacheKey(compatibleSource, target, styleOptions);
|
|
1319
|
+
incrementalCacheKeys.add(cacheKey);
|
|
1217
1320
|
if (options.scanSources === true) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
1218
1321
|
const generated = await generateOnce(cssMacroSource, options);
|
|
1219
1322
|
if (!seedIncrementalGenerateCache({
|
|
@@ -1318,9 +1421,14 @@ function createTailwindV4Engine$1(source) {
|
|
|
1318
1421
|
}
|
|
1319
1422
|
return {
|
|
1320
1423
|
source,
|
|
1321
|
-
loadDesignSystem:
|
|
1322
|
-
validateCandidates:
|
|
1323
|
-
generate
|
|
1424
|
+
loadDesignSystem: validationEngine.loadDesignSystem,
|
|
1425
|
+
validateCandidates: validationEngine.validateCandidates,
|
|
1426
|
+
generate,
|
|
1427
|
+
dispose() {
|
|
1428
|
+
generationSessions.dispose();
|
|
1429
|
+
for (const cacheKey of incrementalCacheKeys) incrementalGenerateCache.delete(cacheKey);
|
|
1430
|
+
incrementalCacheKeys.clear();
|
|
1431
|
+
}
|
|
1324
1432
|
};
|
|
1325
1433
|
}
|
|
1326
1434
|
//#endregion
|
|
@@ -2689,6 +2797,23 @@ function upsertTailwindV4CssSource(opts, source) {
|
|
|
2689
2797
|
};
|
|
2690
2798
|
return true;
|
|
2691
2799
|
}
|
|
2800
|
+
function removeTailwindV4CssSource(opts, file) {
|
|
2801
|
+
const tailwindcss = opts.tailwindcss;
|
|
2802
|
+
const v4 = tailwindcss?.v4;
|
|
2803
|
+
const cssSources = v4?.cssSources;
|
|
2804
|
+
if (!cssSources || cssSources.length === 0) return false;
|
|
2805
|
+
const sourceFile = normalizeCssSourceFile(file);
|
|
2806
|
+
const nextCssSources = cssSources.filter((source) => normalizeCssSourceFile(source.file) !== sourceFile);
|
|
2807
|
+
if (nextCssSources.length === cssSources.length) return false;
|
|
2808
|
+
opts.tailwindcss = {
|
|
2809
|
+
...tailwindcss,
|
|
2810
|
+
v4: {
|
|
2811
|
+
...v4,
|
|
2812
|
+
cssSources: nextCssSources
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
return true;
|
|
2816
|
+
}
|
|
2692
2817
|
//#endregion
|
|
2693
2818
|
//#region src/tailwindcss/v4-engine/source.ts
|
|
2694
2819
|
const require = createRequire(import.meta.url);
|
|
@@ -3064,4 +3189,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
|
3064
3189
|
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3065
3190
|
}
|
|
3066
3191
|
//#endregion
|
|
3067
|
-
export {
|
|
3192
|
+
export { hasTailwindSourceDirectives as $, transformGeneratorUserCss as A, toPosixPath as At, stripMiniProgramCssSpecificityPlaceholders as B, findWorkspacePackageDir as C, expandTailwindSourceEntries as Ct, resolveTailwindcssOptions as D, resolveCssSourceEntries as Dt, normalizeTailwindcssRuntimeOptions as E, parseConfigParam as Et, stripUnmatchedTailwindSourceMediaCloseFragments as F, filterUnsupportedMiniProgramTailwindV4Candidates as Ft, extractGeneratedCssForUserLayerSelectors as G, filterApplyOnlyGeneratedCss as H, finalizeMiniProgramCss as I, loadTailwindV4DesignSystem as It, preferScopedGeneratedCssRules as J, hasUserCssLayerBlocks as K, hasMiniProgramCssSpecificityPlaceholders as L, resolveValidTailwindV4Candidates$1 as Lt, removeMiniProgramHoverSelectors as M, transformTailwindV4CssToWeapp as Mt, removeTailwindV4GeneratorAtRules as N, resolveCssMacroTailwindV4Source as Nt, normalizeStringListOption as O, resolveSourceScanPath as Ot, stripTailwindSourceMediaFragments as P, getTailwindV4IncrementalGenerateCacheStats as Pt, hasTailwindRootDirectives as Q, pruneMiniProgramGeneratedCss as R, findNearestPackageRoot as S, createTailwindSourceEntryMatcher as St, normalizeExtendLengthUnits as T, normalizeLegacyContentEntries as Tt, normalizeEmptyTailwindCustomVariants as U, removeTailwindV4GeneratedUserCssArtifacts as V, shouldFilterApplyOnlyGeneratedCss as W, hasTailwindApplyDirective as X, hasLocalCssImport as Y, hasTailwindNonRootGenerationDirectives as Z, upsertTailwindV4CssSource as _, normalizeConfigDirective as _t, resolveGeneratorRuntimeBranch as a, resolveCssEntrySource as at, isTailwindV4CssEntry as b, FULL_SOURCE_SCAN_EXTENSION_RE as bt, shouldUseNativeAppCssBranch as c, createCssAppend as ct, resolveTailwindV4SourceFromRuntime as d, splitGeneratorPlaceholderCssBySourceOrder as dt, normalizeTailwindConfigDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, splitTailwindGeneratedCssByBanner as ft, removeTailwindV4CssSource as g, stripTailwindBanners as gt, hasConfiguredTailwindV4CssRoots as h, stripTailwindBanner as ht, normalizeWeappTailwindcssGeneratorOptions as i, removeTailwindSourceDirectives as it, isCommentOnlyCss as j, transformTailwindV4CssByTarget as jt, resolveBooleanObjectOption as k, resolveTailwindV4CssSourceBase as kt, resolveUniUtsPlatform as l, hasTailwindGeneratedCss as lt, filterTailwindV4CssSourceRoots as m, stripGeneratorPlaceholderMarkers as mt, createWeappTailwindcssGeneratorFromRuntime as n, normalizeTailwindSourceForGenerator as nt, resolveRuntimeBranch as o, GENERATOR_PLACEHOLDER_MARKER_RE as ot, resolveTailwindV4SourceOptionsFromRuntime as p, splitTailwindV4GeneratedCssBySourceOrder as pt, splitUserCssLayerBlocks as q, resolveTailwindSourceFromRuntime as r, parseImportRequest as rt, shouldUseMiniProgramCssBranch as s, VITE_MARKER_RE as st, createWeappTailwindcssGenerator as t, normalizeTailwindSourceDirectives as tt, resolveTailwindV4Source$1 as u, hasTailwindGeneratedCssMarkers as ut, groupCssEntriesByBase as v, prependConfigDirective as vt, findWorkspaceRoot as w, isFileMatchedByTailwindSourceEntries as wt, normalizeCssEntries as x, FULL_SOURCE_SCAN_PATTERN as xt, guessBasedirFromEntries as y, createTailwindV4Engine$1 as yt, removeUnsupportedMiniProgramAtRules as z };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_generator = require("./generator-C8D5cnbe.cjs");
|
|
3
|
+
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
4
|
+
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
5
|
+
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|
|
6
|
+
exports.resolveTailwindSourceFromRuntime = require_generator.resolveTailwindSourceFromRuntime;
|
|
7
|
+
exports.resolveTailwindV4Source = require_generator.resolveTailwindV4Source;
|
|
8
|
+
exports.resolveTailwindV4SourceFromRuntime = require_generator.resolveTailwindV4SourceFromRuntime;
|
|
9
|
+
exports.resolveTailwindV4SourceFromRuntimeOptions = require_generator.resolveTailwindV4SourceFromRuntimeOptions;
|
|
10
|
+
exports.resolveTailwindV4SourceOptionsFromRuntime = require_generator.resolveTailwindV4SourceOptionsFromRuntime;
|
|
11
|
+
exports.transformTailwindV4CssByTarget = require_generator.transformTailwindV4CssByTarget;
|
|
12
|
+
exports.transformTailwindV4CssToWeapp = require_generator.transformTailwindV4CssToWeapp;
|
package/dist/generator.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './generator/index'
|
|
1
|
+
export * from './generator/index.js'
|
package/dist/generator.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
4
|
-
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
5
|
-
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|
|
6
|
-
exports.resolveTailwindSourceFromRuntime = require_generator.resolveTailwindSourceFromRuntime;
|
|
7
|
-
exports.resolveTailwindV4Source = require_generator.resolveTailwindV4Source;
|
|
8
|
-
exports.resolveTailwindV4SourceFromRuntime = require_generator.resolveTailwindV4SourceFromRuntime;
|
|
9
|
-
exports.resolveTailwindV4SourceFromRuntimeOptions = require_generator.resolveTailwindV4SourceFromRuntimeOptions;
|
|
10
|
-
exports.resolveTailwindV4SourceOptionsFromRuntime = require_generator.resolveTailwindV4SourceOptionsFromRuntime;
|
|
11
|
-
exports.transformTailwindV4CssByTarget = require_generator.transformTailwindV4CssByTarget;
|
|
12
|
-
exports.transformTailwindV4CssToWeapp = require_generator.transformTailwindV4CssToWeapp;
|
|
1
|
+
import { Mt as transformTailwindV4CssToWeapp, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, jt as transformTailwindV4CssByTarget, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-CDdzqf1S.js";
|
|
2
|
+
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|