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,4 +1,4 @@
|
|
|
1
|
-
import type { InternalUserDefinedOptions } from '../types';
|
|
2
|
-
import { resolveTailwindcssBasedir } from './tailwindcss/basedir';
|
|
3
|
-
export declare function createTailwindcssRuntimeFromContext(ctx: InternalUserDefinedOptions): import("
|
|
1
|
+
import type { InternalUserDefinedOptions } from '../types/index.js';
|
|
2
|
+
import { resolveTailwindcssBasedir } from './tailwindcss/basedir.js';
|
|
3
|
+
export declare function createTailwindcssRuntimeFromContext(ctx: InternalUserDefinedOptions): import("../types/index.js").TailwindcssRuntimeLike;
|
|
4
4
|
export { resolveTailwindcssBasedir };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_framework = require("./framework.
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const
|
|
5
|
-
require("./utils-CuKLf1Zv.
|
|
6
|
-
const require_wxml = require("./wxml-
|
|
7
|
-
const require_defaults = require("./defaults.
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
|
+
const require_framework = require("./framework.cjs");
|
|
3
|
+
const require_generator = require("./generator-C8D5cnbe.cjs");
|
|
4
|
+
const require_options = require("./options-DlvhQwWB.cjs");
|
|
5
|
+
require("./utils-CuKLf1Zv.cjs");
|
|
6
|
+
const require_wxml = require("./wxml-DSMNuUaP.cjs");
|
|
7
|
+
const require_defaults = require("./defaults.cjs");
|
|
8
|
+
const require_tailwindcss = require("./tailwindcss-Cs94gJgf.cjs");
|
|
9
|
+
const require_style_options = require("./style-options-CEfXwZzX.cjs");
|
|
8
10
|
let node_path = require("node:path");
|
|
9
|
-
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
11
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
10
12
|
let node_process = require("node:process");
|
|
11
|
-
node_process = require_rolldown_runtime.__toESM(node_process);
|
|
13
|
+
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
12
14
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
13
15
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
14
16
|
let lru_cache = require("lru-cache");
|
|
@@ -16,8 +18,6 @@ let node_module = require("node:module");
|
|
|
16
18
|
let node_fs_promises = require("node:fs/promises");
|
|
17
19
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
18
20
|
let node_buffer = require("node:buffer");
|
|
19
|
-
let magic_string = require("magic-string");
|
|
20
|
-
magic_string = require_rolldown_runtime.__toESM(magic_string);
|
|
21
21
|
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
22
22
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
23
23
|
//#region src/cache/index.ts
|
|
@@ -690,9 +690,9 @@ function hasUnsupportedSourceMarker(rawSource) {
|
|
|
690
690
|
function hasSupportedClassMatchSource(options) {
|
|
691
691
|
return options.alwaysEscape === true || Boolean(options.classNameSet && options.classNameSet.size > 0);
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function canAttemptOxcJsFastPath(options) {
|
|
694
694
|
if (options.experimentalJsFastPath !== true && options.experimentalJsFastPath !== "oxc") return false;
|
|
695
|
-
return !options.generateMap && !options.wrapExpression && !options.moduleGraph && !options.moduleSpecifierReplacements && hasSupportedClassMatchSource(options) && !require_wxml.shouldEnableArbitraryValueFallback(options) && !hasValues(options.ignoreCallExpressionIdentifiers)
|
|
695
|
+
return !options.generateMap && !options.wrapExpression && !options.moduleGraph && !options.moduleSpecifierReplacements && hasSupportedClassMatchSource(options) && !require_wxml.shouldEnableArbitraryValueFallback(options) && !hasValues(options.ignoreCallExpressionIdentifiers);
|
|
696
696
|
}
|
|
697
697
|
function getParserLang(filename) {
|
|
698
698
|
if (filename?.endsWith(".ts") || filename?.endsWith(".mts") || filename?.endsWith(".cts")) return "ts";
|
|
@@ -707,7 +707,7 @@ function isRangeValid(start, end) {
|
|
|
707
707
|
return typeof start === "number" && typeof end === "number" && start < end;
|
|
708
708
|
}
|
|
709
709
|
function getMagicString(rawSource, context) {
|
|
710
|
-
if (!context.ms) context.ms = new
|
|
710
|
+
if (!context.ms) context.ms = new require_wxml.MagicString(rawSource);
|
|
711
711
|
return context.ms;
|
|
712
712
|
}
|
|
713
713
|
function addStringLiteralReplacement(rawSource, node, transformOptions, context) {
|
|
@@ -747,8 +747,18 @@ function applyReplacements(rawSource, program, walker, stringLiteralOptions, tem
|
|
|
747
747
|
} });
|
|
748
748
|
return changed;
|
|
749
749
|
}
|
|
750
|
+
function hasTaggedTemplateExpression(program, walker) {
|
|
751
|
+
let found = false;
|
|
752
|
+
walker.walk(program, { enter(node) {
|
|
753
|
+
if (node.type === "TaggedTemplateExpression") {
|
|
754
|
+
found = true;
|
|
755
|
+
this.skip();
|
|
756
|
+
}
|
|
757
|
+
} });
|
|
758
|
+
return found;
|
|
759
|
+
}
|
|
750
760
|
function oxcJsHandler(rawSource, options) {
|
|
751
|
-
if (!
|
|
761
|
+
if (!canAttemptOxcJsFastPath(options)) return;
|
|
752
762
|
if (hasUnsupportedSourceMarker(rawSource)) return;
|
|
753
763
|
const parser = loadOxcParser();
|
|
754
764
|
const walker = loadOxcWalker();
|
|
@@ -763,6 +773,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
763
773
|
return;
|
|
764
774
|
}
|
|
765
775
|
if (!result.program || Array.isArray(result.errors) && result.errors.length > 0) return;
|
|
776
|
+
if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program, walker)) return;
|
|
766
777
|
const stringLiteralOptions = options.needEscaped === true ? options : {
|
|
767
778
|
...options,
|
|
768
779
|
needEscaped: true
|
|
@@ -780,7 +791,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
780
791
|
/** 用于检测源码中是否包含类名相关模式的正则表达式 */
|
|
781
792
|
const FAST_JS_TRANSFORM_HINT_RE = /className\b|class\s*=|classList\.|\b(?:twMerge|clsx|classnames|cn|cva)\b|\[["'`]class["'`]\]|text-\[|bg-\[|\b(?:[whpm]|px|py|mx|my|rounded|flex|grid|gap)-/;
|
|
782
793
|
/** 用于检测源码中是否包含 import/export/require 语句的正则表达式 */
|
|
783
|
-
const DEPENDENCY_HINT_RE = /\bimport\s*[
|
|
794
|
+
const DEPENDENCY_HINT_RE = /\bimport\s*(?:["'`{]|\*\s+as\b)|\brequire\s*\(|\bexport\s+\*\s+from\s+["'`]|\bexport\s*\{[^}]*\}\s*from\s+["'`]/;
|
|
784
795
|
/**
|
|
785
796
|
* 判断源码是否可能声明跨模块依赖。
|
|
786
797
|
*
|
|
@@ -982,72 +993,11 @@ function resolveRuntimePackageReplacements(option) {
|
|
|
982
993
|
return Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
983
994
|
}
|
|
984
995
|
//#endregion
|
|
985
|
-
//#region src/context/style-options.ts
|
|
986
|
-
function normalizeStyleHandlerMajorVersion(majorVersion) {
|
|
987
|
-
return majorVersion === 4 ? 4 : void 0;
|
|
988
|
-
}
|
|
989
|
-
function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
990
|
-
const resolvedUniAppXOptions = require_tailwindcss.resolveUniAppXOptions(ctx.uniAppX);
|
|
991
|
-
const branch = require_generator.resolveGeneratorRuntimeBranch(require_generator.normalizeWeappTailwindcssGeneratorOptions(ctx.generator, {
|
|
992
|
-
appType: ctx.appType,
|
|
993
|
-
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
994
|
-
tailwindcssMajorVersion,
|
|
995
|
-
uniAppX: resolvedUniAppXOptions
|
|
996
|
-
}), {
|
|
997
|
-
appType: ctx.appType,
|
|
998
|
-
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
999
|
-
tailwindcssMajorVersion,
|
|
1000
|
-
uniAppX: resolvedUniAppXOptions
|
|
1001
|
-
});
|
|
1002
|
-
const hasCssOptions = ctx.cssOptions !== void 0;
|
|
1003
|
-
const cssOptions = {
|
|
1004
|
-
cssPreflight: ctx.cssOptions?.cssPreflight ?? ctx.cssPreflight,
|
|
1005
|
-
cssPreflightRange: ctx.cssOptions?.cssPreflightRange ?? ctx.cssPreflightRange,
|
|
1006
|
-
cssChildCombinatorReplaceValue: ctx.cssOptions?.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue,
|
|
1007
|
-
cssSelectorReplacement: ctx.cssOptions?.cssSelectorReplacement ?? ctx.cssSelectorReplacement,
|
|
1008
|
-
rem2rpx: ctx.cssOptions?.rem2rpx ?? ctx.rem2rpx,
|
|
1009
|
-
cssRemoveProperty: ctx.cssOptions?.cssRemoveProperty ?? ctx.cssRemoveProperty,
|
|
1010
|
-
cssRemoveHoverPseudoClass: ctx.cssOptions?.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass,
|
|
1011
|
-
tailwindcssV4GradientFallback: ctx.cssOptions?.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback,
|
|
1012
|
-
cssPresetEnv: ctx.cssOptions?.cssPresetEnv ?? ctx.cssPresetEnv,
|
|
1013
|
-
atRules: ctx.cssOptions?.atRules ?? ctx.atRules,
|
|
1014
|
-
autoprefixer: ctx.cssOptions?.autoprefixer ?? ctx.autoprefixer,
|
|
1015
|
-
cssCalc: ctx.cssOptions?.cssCalc ?? ctx.cssCalc,
|
|
1016
|
-
platform: branch.platform ?? ctx.cssOptions?.platform ?? ctx.platform,
|
|
1017
|
-
px2rpx: ctx.cssOptions?.px2rpx ?? ctx.px2rpx,
|
|
1018
|
-
unitsToPx: ctx.cssOptions?.unitsToPx ?? ctx.unitsToPx,
|
|
1019
|
-
unitConversion: ctx.cssOptions?.unitConversion ?? ctx.unitConversion,
|
|
1020
|
-
injectAdditionalCssVarScope: ctx.cssOptions?.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope
|
|
1021
|
-
};
|
|
1022
|
-
return {
|
|
1023
|
-
appType: ctx.appType,
|
|
1024
|
-
postcssOptions: ctx.postcssOptions,
|
|
1025
|
-
cssPreflight: cssOptions.cssPreflight,
|
|
1026
|
-
cssPreflightRange: cssOptions.cssPreflightRange,
|
|
1027
|
-
cssChildCombinatorReplaceValue: cssOptions.cssChildCombinatorReplaceValue,
|
|
1028
|
-
cssSelectorReplacement: cssOptions.cssSelectorReplacement,
|
|
1029
|
-
rem2rpx: cssOptions.rem2rpx,
|
|
1030
|
-
...hasCssOptions ? { cssOptions } : {},
|
|
1031
|
-
cssRemoveProperty: cssOptions.cssRemoveProperty,
|
|
1032
|
-
cssRemoveHoverPseudoClass: cssOptions.cssRemoveHoverPseudoClass,
|
|
1033
|
-
tailwindcssV4GradientFallback: cssOptions.tailwindcssV4GradientFallback,
|
|
1034
|
-
cssPresetEnv: cssOptions.cssPresetEnv,
|
|
1035
|
-
atRules: cssOptions.atRules,
|
|
1036
|
-
autoprefixer: cssOptions.autoprefixer,
|
|
1037
|
-
cssCalc: cssOptions.cssCalc,
|
|
1038
|
-
uniAppX: branch.isNativeApp,
|
|
1039
|
-
platform: cssOptions.platform,
|
|
1040
|
-
px2rpx: cssOptions.px2rpx,
|
|
1041
|
-
unitsToPx: cssOptions.unitsToPx,
|
|
1042
|
-
unitConversion: cssOptions.unitConversion
|
|
1043
|
-
};
|
|
1044
|
-
}
|
|
1045
|
-
//#endregion
|
|
1046
996
|
//#region src/context/handlers.ts
|
|
1047
997
|
function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions, tailwindcssMajorVersion) {
|
|
1048
998
|
const { escapeMap, injectAdditionalCssVarScope, postcssOptions, uniAppX, arbitraryValues, jsPreserveClass, jsArbitraryValueFallback, babelParserOptions, experimentalJsFastPath, ignoreCallExpressionIdentifiers, ignoreTaggedTemplateExpressionIdentifiers, inlineWxs, disabledDefaultTemplateHandler, replaceRuntimePackages } = ctx;
|
|
1049
|
-
const resolvedUniAppXOptions =
|
|
1050
|
-
const styleOptions = resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion);
|
|
999
|
+
const resolvedUniAppXOptions = require_options.resolveUniAppXOptions(uniAppX);
|
|
1000
|
+
const styleOptions = require_style_options.resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion);
|
|
1051
1001
|
const resolvedInjectAdditionalCssVarScope = styleOptions.cssOptions?.injectAdditionalCssVarScope ?? injectAdditionalCssVarScope;
|
|
1052
1002
|
const uniAppXEnabled = styleOptions.uniAppX === true;
|
|
1053
1003
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
@@ -1058,7 +1008,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
1058
1008
|
postcssOptions,
|
|
1059
1009
|
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
1060
1010
|
cssCalc: cssCalcOptions,
|
|
1061
|
-
majorVersion: normalizeStyleHandlerMajorVersion(tailwindcssMajorVersion)
|
|
1011
|
+
majorVersion: require_style_options.normalizeStyleHandlerMajorVersion(tailwindcssMajorVersion)
|
|
1062
1012
|
});
|
|
1063
1013
|
const jsHandler = createJsHandler({
|
|
1064
1014
|
escapeMap,
|
|
@@ -1102,7 +1052,7 @@ function applyLoggerLevel(logLevel) {
|
|
|
1102
1052
|
function resolveContextCssPreflight(opts, ctx, majorVersion) {
|
|
1103
1053
|
const userCssPreflight = opts?.cssOptions?.cssPreflight ?? opts?.cssPreflight;
|
|
1104
1054
|
const cssPreflight = require_defaults.resolveDefaultCssPreflight(userCssPreflight, majorVersion);
|
|
1105
|
-
const shouldUseUniAppXPreflight = ctx.appType === "uni-app-x" ||
|
|
1055
|
+
const shouldUseUniAppXPreflight = ctx.appType === "uni-app-x" || require_options.resolveUniAppXOptions(ctx.uniAppX).enabled;
|
|
1106
1056
|
if (cssPreflight === false || !shouldUseUniAppXPreflight) return cssPreflight;
|
|
1107
1057
|
const userCssPreflightObject = userCssPreflight && typeof userCssPreflight === "object" ? userCssPreflight : void 0;
|
|
1108
1058
|
return {
|
|
@@ -1269,12 +1219,6 @@ Object.defineProperty(exports, "normalizeFrameworkStylePlatform", {
|
|
|
1269
1219
|
return normalizeFrameworkStylePlatform;
|
|
1270
1220
|
}
|
|
1271
1221
|
});
|
|
1272
|
-
Object.defineProperty(exports, "normalizeStyleHandlerMajorVersion", {
|
|
1273
|
-
enumerable: true,
|
|
1274
|
-
get: function() {
|
|
1275
|
-
return normalizeStyleHandlerMajorVersion;
|
|
1276
|
-
}
|
|
1277
|
-
});
|
|
1278
1222
|
Object.defineProperty(exports, "pluginName", {
|
|
1279
1223
|
enumerable: true,
|
|
1280
1224
|
get: function() {
|
|
@@ -1287,12 +1231,6 @@ Object.defineProperty(exports, "refreshTailwindRuntimeState", {
|
|
|
1287
1231
|
return refreshTailwindRuntimeState;
|
|
1288
1232
|
}
|
|
1289
1233
|
});
|
|
1290
|
-
Object.defineProperty(exports, "resolveStyleOptionsFromContext", {
|
|
1291
|
-
enumerable: true,
|
|
1292
|
-
get: function() {
|
|
1293
|
-
return resolveStyleOptionsFromContext;
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
1234
|
Object.defineProperty(exports, "shouldSkipJsTransform", {
|
|
1297
1235
|
enumerable: true,
|
|
1298
1236
|
get: function() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { resolveMpxPlatform } from "./framework.
|
|
2
|
-
import {
|
|
3
|
-
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-
|
|
4
|
-
import { i as isMap, n as defuOverrideArray } from "./utils-MVwpU07P.
|
|
5
|
-
import {
|
|
6
|
-
import { getDefaultOptions, resolveDefaultCssPreflight } from "./defaults.
|
|
1
|
+
import { resolveMpxPlatform } from "./framework.js";
|
|
2
|
+
import { It as loadTailwindV4DesignSystem, Lt as resolveValidTailwindV4Candidates$1, Nt as resolveCssMacroTailwindV4Source, a as resolveGeneratorRuntimeBranch, d as resolveTailwindV4SourceFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveBooleanObjectOption, yt as createTailwindV4Engine$1 } from "./generator-CDdzqf1S.js";
|
|
3
|
+
import { c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssRuntimeFromContext, u as getRuntimeClassSetSignatureWithSources } from "./tailwindcss-D7TGiZR2.js";
|
|
4
|
+
import { i as isMap, n as defuOverrideArray } from "./utils-MVwpU07P.js";
|
|
5
|
+
import { a as jsHandler, c as getReplacementCacheStore, d as decodeUnicode2, f as resolveClassNameTransformWithResult, h as createDebug, l as jsStringEscape, p as shouldEnableArbitraryValueFallback, s as getReplacement, t as createTemplateHandler, v as md5Hash } from "./wxml-IBzZSaQC.js";
|
|
6
|
+
import { getDefaultOptions, resolveDefaultCssPreflight } from "./defaults.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import process from "node:process";
|
|
@@ -11,9 +11,9 @@ import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
|
11
11
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
12
12
|
import { LRUCache } from "lru-cache";
|
|
13
13
|
import { rm } from "node:fs/promises";
|
|
14
|
+
import MagicString from "magic-string";
|
|
14
15
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
15
16
|
import { Buffer } from "node:buffer";
|
|
16
|
-
import MagicString from "magic-string";
|
|
17
17
|
//#region src/cache/index.ts
|
|
18
18
|
function isProcessResult(value) {
|
|
19
19
|
return typeof value === "object" && value !== null && "result" in value;
|
|
@@ -684,9 +684,9 @@ function hasUnsupportedSourceMarker(rawSource) {
|
|
|
684
684
|
function hasSupportedClassMatchSource(options) {
|
|
685
685
|
return options.alwaysEscape === true || Boolean(options.classNameSet && options.classNameSet.size > 0);
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function canAttemptOxcJsFastPath(options) {
|
|
688
688
|
if (options.experimentalJsFastPath !== true && options.experimentalJsFastPath !== "oxc") return false;
|
|
689
|
-
return !options.generateMap && !options.wrapExpression && !options.moduleGraph && !options.moduleSpecifierReplacements && hasSupportedClassMatchSource(options) && !shouldEnableArbitraryValueFallback(options) && !hasValues(options.ignoreCallExpressionIdentifiers)
|
|
689
|
+
return !options.generateMap && !options.wrapExpression && !options.moduleGraph && !options.moduleSpecifierReplacements && hasSupportedClassMatchSource(options) && !shouldEnableArbitraryValueFallback(options) && !hasValues(options.ignoreCallExpressionIdentifiers);
|
|
690
690
|
}
|
|
691
691
|
function getParserLang(filename) {
|
|
692
692
|
if (filename?.endsWith(".ts") || filename?.endsWith(".mts") || filename?.endsWith(".cts")) return "ts";
|
|
@@ -741,8 +741,18 @@ function applyReplacements(rawSource, program, walker, stringLiteralOptions, tem
|
|
|
741
741
|
} });
|
|
742
742
|
return changed;
|
|
743
743
|
}
|
|
744
|
+
function hasTaggedTemplateExpression(program, walker) {
|
|
745
|
+
let found = false;
|
|
746
|
+
walker.walk(program, { enter(node) {
|
|
747
|
+
if (node.type === "TaggedTemplateExpression") {
|
|
748
|
+
found = true;
|
|
749
|
+
this.skip();
|
|
750
|
+
}
|
|
751
|
+
} });
|
|
752
|
+
return found;
|
|
753
|
+
}
|
|
744
754
|
function oxcJsHandler(rawSource, options) {
|
|
745
|
-
if (!
|
|
755
|
+
if (!canAttemptOxcJsFastPath(options)) return;
|
|
746
756
|
if (hasUnsupportedSourceMarker(rawSource)) return;
|
|
747
757
|
const parser = loadOxcParser();
|
|
748
758
|
const walker = loadOxcWalker();
|
|
@@ -757,6 +767,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
757
767
|
return;
|
|
758
768
|
}
|
|
759
769
|
if (!result.program || Array.isArray(result.errors) && result.errors.length > 0) return;
|
|
770
|
+
if (hasValues(options.ignoreTaggedTemplateExpressionIdentifiers) && hasTaggedTemplateExpression(result.program, walker)) return;
|
|
760
771
|
const stringLiteralOptions = options.needEscaped === true ? options : {
|
|
761
772
|
...options,
|
|
762
773
|
needEscaped: true
|
|
@@ -774,7 +785,7 @@ function oxcJsHandler(rawSource, options) {
|
|
|
774
785
|
/** 用于检测源码中是否包含类名相关模式的正则表达式 */
|
|
775
786
|
const FAST_JS_TRANSFORM_HINT_RE = /className\b|class\s*=|classList\.|\b(?:twMerge|clsx|classnames|cn|cva)\b|\[["'`]class["'`]\]|text-\[|bg-\[|\b(?:[whpm]|px|py|mx|my|rounded|flex|grid|gap)-/;
|
|
776
787
|
/** 用于检测源码中是否包含 import/export/require 语句的正则表达式 */
|
|
777
|
-
const DEPENDENCY_HINT_RE = /\bimport\s*[
|
|
788
|
+
const DEPENDENCY_HINT_RE = /\bimport\s*(?:["'`{]|\*\s+as\b)|\brequire\s*\(|\bexport\s+\*\s+from\s+["'`]|\bexport\s*\{[^}]*\}\s*from\s+["'`]/;
|
|
778
789
|
/**
|
|
779
790
|
* 判断源码是否可能声明跨模块依赖。
|
|
780
791
|
*
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_context = require("./context-PZXBqrAJ.cjs");
|
|
3
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
3
4
|
//#region src/core.ts
|
|
4
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
5
6
|
function resolveTransformWxssOptions(options) {
|
|
6
7
|
if (!options) return DEFAULT_MAIN_CHUNK_STYLE_OPTIONS;
|
|
7
8
|
if (options.isMainChunk === true) return options;
|
|
8
|
-
return defuOverrideArray(options, DEFAULT_MAIN_CHUNK_STYLE_OPTIONS);
|
|
9
|
+
return (0, _weapp_tailwindcss_shared.defuOverrideArray)(options, DEFAULT_MAIN_CHUNK_STYLE_OPTIONS);
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* 创建一个上下文对象,用于处理小程序的模板、样式和脚本转换。
|
|
@@ -13,11 +14,11 @@ function resolveTransformWxssOptions(options) {
|
|
|
13
14
|
* @returns 返回一个包含 transformWxss、transformWxml 和 transformJs 方法的对象
|
|
14
15
|
*/
|
|
15
16
|
function createContext(options = {}) {
|
|
16
|
-
const opts = getCompilerContext(options);
|
|
17
|
+
const opts = require_context.getCompilerContext(options);
|
|
17
18
|
const { templateHandler, styleHandler, jsHandler } = opts;
|
|
18
19
|
const initialTailwindRuntime = opts.tailwindRuntime;
|
|
19
20
|
const refreshTailwindcssRuntime = opts.refreshTailwindcssRuntime;
|
|
20
|
-
const readyPromise = createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
21
|
+
const readyPromise = require_context.createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
21
22
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
22
23
|
const runtimeState = {
|
|
23
24
|
tailwindRuntime: initialTailwindRuntime,
|
|
@@ -100,7 +101,7 @@ function createContext(options = {}) {
|
|
|
100
101
|
}
|
|
101
102
|
return cachedRuntimeOnlyTemplateHandlerOptions;
|
|
102
103
|
}
|
|
103
|
-
return defuOverrideArray(options, {
|
|
104
|
+
return (0, _weapp_tailwindcss_shared.defuOverrideArray)(options, {
|
|
104
105
|
runtimeSet,
|
|
105
106
|
jsHandler: runtimeAwareTemplateJsHandler
|
|
106
107
|
});
|
|
@@ -108,25 +109,25 @@ function createContext(options = {}) {
|
|
|
108
109
|
async function transformWxss(rawCss, options) {
|
|
109
110
|
await runtimeState.readyPromise;
|
|
110
111
|
const result = await styleHandler(rawCss, resolveTransformWxssOptions(options));
|
|
111
|
-
runtimeSet = await ensureRuntimeClassSet(runtimeState);
|
|
112
|
+
runtimeSet = await require_context.ensureRuntimeClassSet(runtimeState);
|
|
112
113
|
return result;
|
|
113
114
|
}
|
|
114
115
|
async function getRuntimeSet(options) {
|
|
115
116
|
await runtimeState.readyPromise;
|
|
116
|
-
runtimeSet = await ensureRuntimeClassSet(runtimeState, options);
|
|
117
|
+
runtimeSet = await require_context.ensureRuntimeClassSet(runtimeState, options);
|
|
117
118
|
return runtimeSet;
|
|
118
119
|
}
|
|
119
120
|
async function transformJs(rawJs, options) {
|
|
120
121
|
await runtimeState.readyPromise;
|
|
121
122
|
if (options?.runtimeSet) runtimeSet = options.runtimeSet;
|
|
122
|
-
else if (runtimeSet.size === 0) runtimeSet = await ensureRuntimeClassSet(runtimeState, { forceCollect: true });
|
|
123
|
+
else if (runtimeSet.size === 0) runtimeSet = await require_context.ensureRuntimeClassSet(runtimeState, { forceCollect: true });
|
|
123
124
|
const resolvedOptions = resolveTransformJsOptions(options);
|
|
124
|
-
if (shouldSkipJsTransform(rawJs, resolvedOptions)) return { code: rawJs };
|
|
125
|
+
if (require_context.shouldSkipJsTransform(rawJs, resolvedOptions)) return { code: rawJs };
|
|
125
126
|
return await jsHandler(rawJs, runtimeSet, resolvedOptions);
|
|
126
127
|
}
|
|
127
128
|
async function transformWxml(rawWxml, options) {
|
|
128
129
|
await runtimeState.readyPromise;
|
|
129
|
-
if (!options?.runtimeSet && runtimeSet.size === 0) runtimeSet = await ensureRuntimeClassSet(runtimeState, { forceCollect: true });
|
|
130
|
+
if (!options?.runtimeSet && runtimeSet.size === 0) runtimeSet = await require_context.ensureRuntimeClassSet(runtimeState, { forceCollect: true });
|
|
130
131
|
return templateHandler(rawWxml, resolveTransformWxmlOptions(options));
|
|
131
132
|
}
|
|
132
133
|
return {
|
|
@@ -137,4 +138,4 @@ function createContext(options = {}) {
|
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
140
|
//#endregion
|
|
140
|
-
|
|
141
|
+
exports.createContext = createContext;
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from './types';
|
|
1
|
+
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from './types/index.js';
|
|
2
2
|
type RuntimeJsTransformOptions = {
|
|
3
3
|
runtimeSet?: Set<string>;
|
|
4
4
|
} & CreateJsHandlerOptions;
|
|
@@ -12,6 +12,6 @@ export declare function createContext(options?: UserDefinedOptions): {
|
|
|
12
12
|
getRuntimeSet: (options?: GetRuntimeSetOptions) => Promise<Set<string>>;
|
|
13
13
|
transformWxss: (rawCss: string, options?: Partial<IStyleHandlerOptions>) => Promise<import("postcss").Result<import("postcss").Document | import("postcss").Root>>;
|
|
14
14
|
transformWxml: (rawWxml: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
15
|
-
transformJs: (rawJs: string, options?: RuntimeJsTransformOptions) => Promise<import("./types").JsHandlerResult>;
|
|
15
|
+
transformJs: (rawJs: string, options?: RuntimeJsTransformOptions) => Promise<import("./types/index.js").JsHandlerResult>;
|
|
16
16
|
};
|
|
17
17
|
export {};
|
package/dist/core.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
1
|
+
import { l as createTailwindRuntimeReadyPromise, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-oTkxC5aZ.js";
|
|
2
|
+
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
4
3
|
//#region src/core.ts
|
|
5
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
6
5
|
function resolveTransformWxssOptions(options) {
|
|
7
6
|
if (!options) return DEFAULT_MAIN_CHUNK_STYLE_OPTIONS;
|
|
8
7
|
if (options.isMainChunk === true) return options;
|
|
9
|
-
return
|
|
8
|
+
return defuOverrideArray(options, DEFAULT_MAIN_CHUNK_STYLE_OPTIONS);
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* 创建一个上下文对象,用于处理小程序的模板、样式和脚本转换。
|
|
@@ -14,11 +13,11 @@ function resolveTransformWxssOptions(options) {
|
|
|
14
13
|
* @returns 返回一个包含 transformWxss、transformWxml 和 transformJs 方法的对象
|
|
15
14
|
*/
|
|
16
15
|
function createContext(options = {}) {
|
|
17
|
-
const opts =
|
|
16
|
+
const opts = getCompilerContext(options);
|
|
18
17
|
const { templateHandler, styleHandler, jsHandler } = opts;
|
|
19
18
|
const initialTailwindRuntime = opts.tailwindRuntime;
|
|
20
19
|
const refreshTailwindcssRuntime = opts.refreshTailwindcssRuntime;
|
|
21
|
-
const readyPromise =
|
|
20
|
+
const readyPromise = createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
22
21
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
23
22
|
const runtimeState = {
|
|
24
23
|
tailwindRuntime: initialTailwindRuntime,
|
|
@@ -101,7 +100,7 @@ function createContext(options = {}) {
|
|
|
101
100
|
}
|
|
102
101
|
return cachedRuntimeOnlyTemplateHandlerOptions;
|
|
103
102
|
}
|
|
104
|
-
return
|
|
103
|
+
return defuOverrideArray(options, {
|
|
105
104
|
runtimeSet,
|
|
106
105
|
jsHandler: runtimeAwareTemplateJsHandler
|
|
107
106
|
});
|
|
@@ -109,25 +108,25 @@ function createContext(options = {}) {
|
|
|
109
108
|
async function transformWxss(rawCss, options) {
|
|
110
109
|
await runtimeState.readyPromise;
|
|
111
110
|
const result = await styleHandler(rawCss, resolveTransformWxssOptions(options));
|
|
112
|
-
runtimeSet = await
|
|
111
|
+
runtimeSet = await ensureRuntimeClassSet(runtimeState);
|
|
113
112
|
return result;
|
|
114
113
|
}
|
|
115
114
|
async function getRuntimeSet(options) {
|
|
116
115
|
await runtimeState.readyPromise;
|
|
117
|
-
runtimeSet = await
|
|
116
|
+
runtimeSet = await ensureRuntimeClassSet(runtimeState, options);
|
|
118
117
|
return runtimeSet;
|
|
119
118
|
}
|
|
120
119
|
async function transformJs(rawJs, options) {
|
|
121
120
|
await runtimeState.readyPromise;
|
|
122
121
|
if (options?.runtimeSet) runtimeSet = options.runtimeSet;
|
|
123
|
-
else if (runtimeSet.size === 0) runtimeSet = await
|
|
122
|
+
else if (runtimeSet.size === 0) runtimeSet = await ensureRuntimeClassSet(runtimeState, { forceCollect: true });
|
|
124
123
|
const resolvedOptions = resolveTransformJsOptions(options);
|
|
125
|
-
if (
|
|
124
|
+
if (shouldSkipJsTransform(rawJs, resolvedOptions)) return { code: rawJs };
|
|
126
125
|
return await jsHandler(rawJs, runtimeSet, resolvedOptions);
|
|
127
126
|
}
|
|
128
127
|
async function transformWxml(rawWxml, options) {
|
|
129
128
|
await runtimeState.readyPromise;
|
|
130
|
-
if (!options?.runtimeSet && runtimeSet.size === 0) runtimeSet = await
|
|
129
|
+
if (!options?.runtimeSet && runtimeSet.size === 0) runtimeSet = await ensureRuntimeClassSet(runtimeState, { forceCollect: true });
|
|
131
130
|
return templateHandler(rawWxml, resolveTransformWxmlOptions(options));
|
|
132
131
|
}
|
|
133
132
|
return {
|
|
@@ -138,4 +137,4 @@ function createContext(options = {}) {
|
|
|
138
137
|
};
|
|
139
138
|
}
|
|
140
139
|
//#endregion
|
|
141
|
-
|
|
140
|
+
export { createContext };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
4
|
+
//#region src/bundlers/shared/css-imports.ts
|
|
5
|
+
const tailwindcssImportRE = /^(?:tailwindcss|weapp-tailwindcss)(?:\/.*)?$/;
|
|
6
|
+
const tailwindcssCssImportStatementRE = /(@import\s+(?:url\(\s*)?)(["'])((?:tailwindcss|weapp-tailwindcss)(?:\/[^"']*)?\$?)(\2\s*\)?)/gi;
|
|
7
|
+
function normalizeTailwindcssSpecifier(specifier) {
|
|
8
|
+
if (specifier === "tailwindcss$" || specifier === "weapp-tailwindcss$") return specifier.slice(0, -1);
|
|
9
|
+
return specifier;
|
|
10
|
+
}
|
|
11
|
+
function getTailwindcssSubpath(specifier) {
|
|
12
|
+
if (specifier === "tailwindcss" || specifier === "weapp-tailwindcss") return "index.css";
|
|
13
|
+
return specifier.replace(/^(?:tailwindcss|weapp-tailwindcss)\//, "");
|
|
14
|
+
}
|
|
15
|
+
function resolveTailwindcssImport(specifier, pkgDir, options) {
|
|
16
|
+
const normalized = normalizeTailwindcssSpecifier(specifier);
|
|
17
|
+
if (!tailwindcssImportRE.test(normalized)) return null;
|
|
18
|
+
if (normalized === "tailwindcss" || normalized === "weapp-tailwindcss") return options?.rootImport ?? (options?.join ?? node_path.default.join)(pkgDir, "index.css");
|
|
19
|
+
return (options?.join ?? node_path.default.join)(pkgDir, getTailwindcssSubpath(normalized));
|
|
20
|
+
}
|
|
21
|
+
function rewriteTailwindcssImportsInCode(code, pkgDir, options) {
|
|
22
|
+
let hasReplacements = false;
|
|
23
|
+
const rewritten = code.replace(tailwindcssCssImportStatementRE, (full, prefix, quote, specifier, suffix) => {
|
|
24
|
+
const replacement = resolveTailwindcssImport(specifier, pkgDir, options);
|
|
25
|
+
if (!replacement) return full;
|
|
26
|
+
hasReplacements = true;
|
|
27
|
+
return `${prefix}${quote}${replacement}${suffix}`;
|
|
28
|
+
});
|
|
29
|
+
return hasReplacements ? rewritten : void 0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
Object.defineProperty(exports, "resolveTailwindcssImport", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function() {
|
|
35
|
+
return resolveTailwindcssImport;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "rewriteTailwindcssImportsInCode", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function() {
|
|
41
|
+
return rewriteTailwindcssImportsInCode;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/bundlers/webpack/shared/css-loader-runtime.ts
|
|
2
|
+
function isWebpackCssLoaderRuntimeSource(source) {
|
|
3
|
+
return source.includes("___CSS_LOADER_EXPORT___") && source.includes("___CSS_LOADER_API_IMPORT___") && source.includes("module.exports = ___CSS_LOADER_EXPORT___");
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
Object.defineProperty(exports, "isWebpackCssLoaderRuntimeSource", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return isWebpackCssLoaderRuntimeSource;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_rolldown_runtime = require("../rolldown-runtime-CVvi-lCc.cjs");
|
|
6
|
+
let _weapp_tailwindcss_postcss_css_macro_postcss = require("@weapp-tailwindcss/postcss/css-macro/postcss");
|
|
7
|
+
_weapp_tailwindcss_postcss_css_macro_postcss = require_rolldown_runtime.__toESM(_weapp_tailwindcss_postcss_css_macro_postcss, 1);
|
|
8
|
+
Object.defineProperty(exports, "CSS_MACRO_POSTCSS_PLUGIN_NAME", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return _weapp_tailwindcss_postcss_css_macro_postcss.CSS_MACRO_POSTCSS_PLUGIN_NAME;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "default", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return _weapp_tailwindcss_postcss_css_macro_postcss.default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
const require_rolldown_runtime = require("../rolldown-runtime-emK7D4bc.js");
|
|
6
|
-
let _weapp_tailwindcss_postcss_css_macro_postcss = require("@weapp-tailwindcss/postcss/css-macro/postcss");
|
|
7
|
-
_weapp_tailwindcss_postcss_css_macro_postcss = require_rolldown_runtime.__toESM(_weapp_tailwindcss_postcss_css_macro_postcss);
|
|
8
|
-
Object.defineProperty(exports, "CSS_MACRO_POSTCSS_PLUGIN_NAME", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function() {
|
|
11
|
-
return _weapp_tailwindcss_postcss_css_macro_postcss.CSS_MACRO_POSTCSS_PLUGIN_NAME;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "default", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function() {
|
|
17
|
-
return _weapp_tailwindcss_postcss_css_macro_postcss.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
1
|
+
import postcss_default, { CSS_MACRO_POSTCSS_PLUGIN_NAME } from "@weapp-tailwindcss/postcss/css-macro/postcss";
|
|
2
|
+
export { CSS_MACRO_POSTCSS_PLUGIN_NAME, postcss_default as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
|
+
const require_auto = require("./auto-DtU6f3X6.cjs");
|
|
3
|
+
require("./utils-CuKLf1Zv.cjs");
|
|
4
|
+
let tailwindcss_plugin = require("tailwindcss/plugin");
|
|
5
|
+
tailwindcss_plugin = require_rolldown_runtime.__toESM(tailwindcss_plugin, 1);
|
|
6
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
4
7
|
//#region src/css-macro/constants.ts
|
|
5
8
|
const queryKey = "weapp-tw-platform";
|
|
6
9
|
const ifdefAtRule = "weapp-tw-ifdef";
|
|
@@ -21,8 +24,8 @@ const defaultOptions = {
|
|
|
21
24
|
dynamic: true,
|
|
22
25
|
variantsMap: {}
|
|
23
26
|
};
|
|
24
|
-
const cssMacroFactory =
|
|
25
|
-
const { dynamic, variantsMap } = defu(options ?? {}, defaultOptions);
|
|
27
|
+
const cssMacroFactory = tailwindcss_plugin.default.withOptions((options) => {
|
|
28
|
+
const { dynamic, variantsMap } = (0, _weapp_tailwindcss_shared.defu)(options ?? {}, defaultOptions);
|
|
26
29
|
const staticVariants = Object.entries(variantsMap).map(([name, config]) => {
|
|
27
30
|
if (typeof config === "string") return {
|
|
28
31
|
name,
|
|
@@ -47,8 +50,8 @@ const cssMacroFactory = plugin.withOptions((options) => {
|
|
|
47
50
|
}
|
|
48
51
|
};
|
|
49
52
|
});
|
|
50
|
-
const cssMacro = markCssMacroPlugin(((options) => {
|
|
51
|
-
return markCssMacroPlugin(cssMacroFactory(options));
|
|
53
|
+
const cssMacro = require_auto.markCssMacroPlugin(((options) => {
|
|
54
|
+
return require_auto.markCssMacroPlugin(cssMacroFactory(options));
|
|
52
55
|
}));
|
|
53
56
|
const cssMacroOptionsFunction = cssMacro;
|
|
54
57
|
const cssMacroFactoryOptionsFunction = cssMacroFactory;
|
|
@@ -56,4 +59,4 @@ cssMacroOptionsFunction.__isOptionsFunction = cssMacroFactoryOptionsFunction.__i
|
|
|
56
59
|
cssMacroOptionsFunction.__pluginFunction = cssMacroFactoryOptionsFunction.__pluginFunction;
|
|
57
60
|
cssMacroOptionsFunction.__configFunction = cssMacroFactoryOptionsFunction.__configFunction;
|
|
58
61
|
//#endregion
|
|
59
|
-
|
|
62
|
+
module.exports = cssMacro;
|
package/dist/css-macro.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './css-macro/index'
|
|
2
|
-
export * from './css-macro/index'
|
|
1
|
+
export { default } from './css-macro/index.js'
|
|
2
|
+
export * from './css-macro/index.js'
|