weapp-tailwindcss 5.5.6 → 5.5.7
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/dist/{auto-DtU6f3X6.cjs → auto-B1OyRrE8.cjs} +1 -1
- package/dist/{auto-2dg_uhEJ.js → auto-ENr4xzzw.js} +1 -1
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -5
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/framework-css-composition.d.ts +1 -1
- package/dist/bundlers/shared/framework-postcss.d.ts +1 -25
- package/dist/bundlers/shared/framework-user-css.d.ts +1 -4
- package/dist/bundlers/shared/generated-css-marker.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/candidates.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +1 -11
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -25
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +1 -19
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +1 -23
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +1 -30
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +1 -12
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/markers.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +1 -8
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +1 -60
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -21
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +1 -33
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -14
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -16
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +1 -22
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/types.d.ts +1 -64
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -7
- package/dist/bundlers/shared/generator-css.d.ts +1 -9
- package/dist/bundlers/shared/run-tasks.d.ts +1 -3
- package/dist/bundlers/shared/runtime-class-set.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/collector.d.ts +1 -8
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/snapshot.d.ts +1 -19
- package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/store.d.ts +1 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -75
- package/dist/bundlers/shared/source-candidates/views.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates.d.ts +1 -4
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +1 -18
- package/dist/bundlers/shared/source-scan/dependencies.d.ts +1 -2
- package/dist/bundlers/shared/source-scan.d.ts +1 -16
- package/dist/bundlers/shared/static-config-content.d.ts +1 -5
- package/dist/bundlers/shared/style-handler-options.d.ts +1 -7
- package/dist/bundlers/shared/style-requests.d.ts +1 -5
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -20
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +2 -2
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +1 -12
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +1 -4
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +4 -7
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -13
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -2
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +4 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +6 -0
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/source.d.ts +29 -0
- package/dist/{cache-CBJFB1HN.cjs → cache-CzvIGfwS.cjs} +1 -0
- package/dist/compiler/composition.d.ts +1 -1
- package/dist/compiler/runtime-affecting-signature/js.d.ts +1 -0
- package/dist/compiler/semantic-css.d.ts +1 -1
- package/dist/compiler/types.d.ts +1 -1
- package/dist/{compiler-D3GBwxoa.js → compiler-CThodfGH.js} +3098 -3067
- package/dist/{compiler-C8FqI-P3.cjs → compiler-DkGY5Nmh.cjs} +5011 -4980
- package/dist/core/compiler/generation-cache.d.ts +4 -2
- package/dist/core/compiler/types.d.ts +1 -1
- package/dist/core.cjs +7 -7
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{css-imports-XvtI1zCY.cjs → css-imports-R_RDMjPz.cjs} +7 -21
- package/dist/css-macro/auto.d.ts +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +2 -2
- package/dist/css-macro.js +1 -1
- package/dist/final-css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{final-css-cleanup-u_sI2p56.js → final-css-cleanup-BOzhuhGz.js} +3 -2
- package/dist/framework.cjs +1 -1
- package/dist/{v4-generation-core-Cz1D7wm1.cjs → generated-css-marker-jMNbQHpy.cjs} +638 -1546
- package/dist/generation/candidates.d.ts +1 -0
- package/dist/generation/class-selectors.d.ts +4 -0
- package/dist/generation/config-directive.d.ts +1 -0
- package/dist/generation/directives/fallback.d.ts +1 -0
- package/dist/generation/directives.d.ts +1 -0
- package/dist/generation/framework-css-composition.d.ts +1 -0
- package/dist/generation/framework-postcss.d.ts +25 -0
- package/dist/generation/framework-user-css.d.ts +5 -0
- package/dist/generation/generation-helpers/preflight.d.ts +19 -0
- package/dist/generation/generation-helpers/results.d.ts +23 -0
- package/dist/generation/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/generation/generation-helpers/source-order.d.ts +1 -0
- package/dist/generation/generation-helpers.d.ts +4 -0
- package/dist/generation/index.d.ts +9 -0
- package/dist/generation/legacy-compat.d.ts +12 -0
- package/dist/generation/legacy-selectors.d.ts +1 -0
- package/dist/generation/legacy-units.d.ts +1 -0
- package/dist/generation/local-imports.d.ts +1 -0
- package/dist/generation/markers.d.ts +1 -0
- package/dist/generation/output-import-shell.d.ts +1 -0
- package/dist/generation/pipeline/context.d.ts +60 -0
- package/dist/generation/pipeline/deferred-output.d.ts +3 -0
- package/dist/generation/pipeline/execution.d.ts +3 -0
- package/dist/generation/pipeline/fallback-output.d.ts +3 -0
- package/dist/generation/pipeline/ordered-output.d.ts +3 -0
- package/dist/generation/pipeline/preparation.d.ts +19 -0
- package/dist/generation/pipeline.d.ts +2 -0
- package/dist/generation/result-helpers.d.ts +6 -0
- package/dist/generation/scoped-rules.d.ts +1 -0
- package/dist/generation/service.d.ts +20 -0
- package/dist/generation/source-files.d.ts +21 -0
- package/dist/generation/source-resolver/apply-reference.d.ts +10 -0
- package/dist/generation/source-resolver/config.d.ts +7 -0
- package/dist/generation/source-resolver/configuration.d.ts +33 -0
- package/dist/generation/source-resolver/matching.d.ts +3 -0
- package/dist/generation/source-resolver/metadata.d.ts +28 -0
- package/dist/generation/source-resolver/postcss-source.d.ts +14 -0
- package/dist/generation/source-resolver/resolve-source.d.ts +4 -0
- package/dist/generation/source-resolver/resolve-sources.d.ts +5 -0
- package/dist/generation/source-resolver/single-source.d.ts +16 -0
- package/dist/generation/source-resolver/source-entries.d.ts +3 -0
- package/dist/generation/source-resolver/source-matching.d.ts +5 -0
- package/dist/generation/source-resolver/types.d.ts +22 -0
- package/dist/generation/source-resolver.d.ts +7 -0
- package/dist/generation/style-options.d.ts +8 -0
- package/dist/generation/style-requests.d.ts +5 -0
- package/dist/generation/types.d.ts +65 -0
- package/dist/generation/user-css/apply-only.d.ts +5 -0
- package/dist/generation/user-css/at-rules.d.ts +1 -0
- package/dist/generation/user-css/compile-functions.d.ts +3 -0
- package/dist/generation/user-css/generated-cleanup.d.ts +1 -0
- package/dist/generation/user-css/source-fragments.d.ts +1 -0
- package/dist/generation/user-css/transform.d.ts +1 -0
- package/dist/generation/user-css/user-layers.d.ts +1 -0
- package/dist/generation/user-css.d.ts +5 -0
- package/dist/generation/user-layer-order.d.ts +1 -0
- package/dist/generation/validate.d.ts +7 -0
- package/dist/generator-CxauQbx3.cjs +1868 -0
- package/dist/generator-oKZ5mCJ5.js +1637 -0
- package/dist/generator.cjs +10 -4
- package/dist/generator.js +1 -1
- package/dist/{gulp-BExe5RBF.cjs → gulp-CVvBpIlq.cjs} +27 -26
- package/dist/{gulp-BhkIIk7J.js → gulp-DhddVxGA.js} +6 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-CoiJIqDu.cjs → hmr-timing-DfMbbZ1E.cjs} +13 -13
- package/dist/{hmr-timing-B9Yt86-U.js → hmr-timing-xPpat-km.js} +518 -1360
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/js/ModuleGraph.d.ts +3 -1
- package/dist/js/babel/analyze.d.ts +6 -0
- package/dist/js/babel.d.ts +1 -2
- package/dist/js/fast-path/analysis.d.ts +14 -0
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/oxc-parser.d.ts +4 -0
- package/dist/pipeline-helpers-zMPmp5F3.cjs +516 -0
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +3 -2
- package/dist/postcss.d.ts +1 -1
- package/dist/postcss.js +3 -2
- package/dist/presets.cjs +3 -3
- package/dist/presets.js +2 -2
- package/dist/project-sources/candidates/collector.d.ts +8 -0
- package/dist/project-sources/candidates/scan-root.d.ts +12 -0
- package/dist/project-sources/candidates/script.d.ts +1 -0
- package/dist/project-sources/candidates/snapshot.d.ts +19 -0
- package/dist/project-sources/candidates/source-priority.d.ts +1 -0
- package/dist/project-sources/candidates/store.d.ts +2 -0
- package/dist/project-sources/candidates/types-and-cache.d.ts +75 -0
- package/dist/project-sources/candidates/views.d.ts +12 -0
- package/dist/project-sources/candidates.d.ts +4 -0
- package/dist/project-sources/css-entries.d.ts +18 -0
- package/dist/project-sources/dependencies.d.ts +2 -0
- package/dist/project-sources/index.d.ts +16 -0
- package/dist/project-sources/static-config-content.d.ts +5 -0
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-Ctb5zv51.cjs → rolldown-runtime-fg3euq-1.cjs} +7 -0
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.js +2 -2
- package/dist/{runtime-state-XYSycuGu.cjs → runtime-state-BOzuVoKl.cjs} +1 -1
- package/dist/{scoped-generator-BUBls_oM.cjs → scoped-generator-BIZ7N_J-.cjs} +9 -9
- package/dist/{scoped-generator-B6Y1bxzM.js → scoped-generator-DlQrVbuC.js} +7 -6
- package/dist/{source-candidate-scan-signature-DNuGKTqf.js → source-candidate-scan-signature-BjVQYL-C.js} +3 -3
- package/dist/{source-candidate-scan-signature-BtJZp28T.cjs → source-candidate-scan-signature-nG-rg809.cjs} +4 -4
- package/dist/style-injector/internal.d.ts +35 -35
- package/dist/style-injector/options.d.ts +1 -1
- package/dist/tailwindcss/miniprogram.d.ts +1 -1
- package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -1
- package/dist/tailwindcss/source-scan/inline-source.d.ts +1 -7
- package/dist/tailwindcss/source-scan.d.ts +3 -32
- package/dist/tailwindcss/v4/css-sources.d.ts +1 -1
- package/dist/tailwindcss/v4/preflight.d.ts +1 -3
- package/dist/tailwindcss/v4/rpx-theme-warning.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +2 -3
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +1 -6
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +5 -2
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +3 -7
- package/dist/tailwindcss/v4-engine/source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/types.d.ts +3 -1
- package/dist/{tailwindcss-CBYjzRmV.cjs → tailwindcss-U3KIUegn.cjs} +65 -264
- package/dist/{tailwindcss-B_4E52WF.js → tailwindcss-kSd0ykiX.js} +71 -243
- package/dist/{transform-CkEnJYIP.js → transform-BAon9ykq.js} +25 -16
- package/dist/{transform-FkqbTBJR.cjs → transform-D2KFdA3C.cjs} +32 -23
- package/dist/types/index.d.ts +2 -2
- package/dist/types/user-defined-options/general.d.ts +1 -1
- package/dist/uni-app-x/border-preflight.d.ts +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +3 -1
- package/dist/uni-app-x/vite/style-result.d.ts +1 -1
- package/dist/utils/run-tasks.d.ts +3 -0
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-DxuKPZlp.cjs → vite-BxW0qd7J.cjs} +217 -828
- package/dist/{vite-lP35OguX.js → vite-D-RGkmOE.js} +62 -674
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-GbC14Rlt.cjs → watch-dependencies-C1so1whD.cjs} +14 -1
- package/dist/weapp-tw-css-generation-loader.cjs +4 -3
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +33 -28
- package/dist/weapp-tw-runtime-classset-loader.cjs +5 -18
- package/dist/{web-Dfz_jpNj.js → web--kA4HUTm.js} +16 -115
- package/dist/{web-DhDxhlkq.cjs → web-Y-H6I1k6.cjs} +83 -192
- package/dist/{webpack-D6jp1o3m.js → webpack-BB-kw4Qr.js} +27 -440
- package/dist/{webpack-R2Sbggiy.cjs → webpack-DxrWatNB.cjs} +87 -87
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +10 -5
- package/dist/final-css-cleanup-CDTmVAye.cjs +0 -1
- package/dist/generator-Bvr4WmuF.cjs +0 -3891
- package/dist/generator-C0BJjyLM.js +0 -3343
- package/dist/pipeline-helpers-BOjTEmMi.cjs +0 -971
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-fg3euq-1.cjs");
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
9
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
10
|
-
const require_css_imports = require("./css-imports-
|
|
3
|
+
const require_generator = require("./generator-CxauQbx3.cjs");
|
|
4
|
+
const require_compiler = require("./compiler-DkGY5Nmh.cjs");
|
|
5
|
+
const require_runtime_state = require("./runtime-state-BOzuVoKl.cjs");
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-U3KIUegn.cjs");
|
|
7
|
+
const require_generated_css_marker = require("./generated-css-marker-jMNbQHpy.cjs");
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-DfMbbZ1E.cjs");
|
|
9
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-nG-rg809.cjs");
|
|
10
|
+
const require_css_imports = require("./css-imports-R_RDMjPz.cjs");
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
14
14
|
let node_process = require("node:process");
|
|
15
15
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
16
|
-
let
|
|
16
|
+
let _weapp_tailwindcss_postcss_transform = require("@weapp-tailwindcss/postcss/transform");
|
|
17
17
|
let lru_cache = require("lru-cache");
|
|
18
|
-
let node_fs_promises = require("node:fs/promises");
|
|
19
18
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
19
|
+
let node_fs_promises = require("node:fs/promises");
|
|
20
20
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
21
21
|
let node_url = require("node:url");
|
|
22
22
|
let weapp_style_injector_vite = require("weapp-style-injector/vite");
|
|
@@ -233,7 +233,7 @@ function createCssHandlerOptionsCache(options) {
|
|
|
233
233
|
const appType = options.getAppType();
|
|
234
234
|
const isMainChunk = options.mainCssChunkMatcher(file, appType);
|
|
235
235
|
const outputRoot = options.getOutputRoot?.();
|
|
236
|
-
const sourceFile =
|
|
236
|
+
const sourceFile = require_generated_css_marker.stripRequestQuery(file);
|
|
237
237
|
const from = node_path.default.isAbsolute(sourceFile) ? sourceFile : outputRoot ? node_path.default.resolve(outputRoot, sourceFile) : sourceFile;
|
|
238
238
|
const extraOptions = options.getExtraOptions?.(file) ?? {};
|
|
239
239
|
const dynamicCssOptions = options.getDynamicCssOptions?.() ?? {};
|
|
@@ -281,7 +281,7 @@ const isWindows = node_process.default.platform === "win32";
|
|
|
281
281
|
const cssLangRE = new RegExp(`\\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\\?)`);
|
|
282
282
|
const htmlLangRE = /\.html?(?:$|\?)/;
|
|
283
283
|
function isCSSRequest(request) {
|
|
284
|
-
return cssLangRE.test(request) ||
|
|
284
|
+
return cssLangRE.test(request) || require_generated_css_marker.isSourceStyleRequest(request);
|
|
285
285
|
}
|
|
286
286
|
function isWeappViteSidecarRequest(request) {
|
|
287
287
|
const queryIndex = request.indexOf("?");
|
|
@@ -319,7 +319,6 @@ async function formatPostcssSourceMap(rawMap, file) {
|
|
|
319
319
|
//#region src/bundlers/vite/css-output.ts
|
|
320
320
|
const SOURCE_STYLE_OUTPUT_EXT_RE = /\.(?:less|sass|scss|styl|stylus|pcss|postcss)$/i;
|
|
321
321
|
const CSS_SOURCE_OUTPUT_EXT_RE = /\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)$/i;
|
|
322
|
-
const SOURCE_STYLE_NON_CSS_SYNTAX_RE = /(?:^|\n)\s*(?:\/\/|\$[\w-]+\s*:|@(?:use|forward|mixin|include|function)\b)/;
|
|
323
322
|
const FALLBACK_STYLE_OUTPUT_EXTENSION = ".css";
|
|
324
323
|
const COMMON_MINI_PROGRAM_STYLE_OUTPUT_EXTENSIONS = [
|
|
325
324
|
".wxss",
|
|
@@ -470,13 +469,7 @@ function resolveViteCssPipelineOutputFileFromSourceFile(sourceFile, opts, rootDi
|
|
|
470
469
|
return cleanFile.replace(CSS_SOURCE_OUTPUT_EXT_RE, styleExtension);
|
|
471
470
|
}
|
|
472
471
|
function canProcessViteSourceStyleAsCss(source, file) {
|
|
473
|
-
|
|
474
|
-
try {
|
|
475
|
-
_weapp_tailwindcss_postcss.postcss.parse(source, { from: file });
|
|
476
|
-
return true;
|
|
477
|
-
} catch {
|
|
478
|
-
return false;
|
|
479
|
-
}
|
|
472
|
+
return (0, _weapp_tailwindcss_postcss_transform.canProcessSourceStyleAsCss)(source, file);
|
|
480
473
|
}
|
|
481
474
|
function normalizeCssSourceForCompare(css) {
|
|
482
475
|
return css.trim();
|
|
@@ -958,9 +951,6 @@ function appendCss(baseCss, css) {
|
|
|
958
951
|
function normalizeCssRecordIdentity(css) {
|
|
959
952
|
return css.trim();
|
|
960
953
|
}
|
|
961
|
-
function hasNonCommentCss(css) {
|
|
962
|
-
return css.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
|
|
963
|
-
}
|
|
964
954
|
function dedupeViteCssResults(records) {
|
|
965
955
|
const seen = /* @__PURE__ */ new Set();
|
|
966
956
|
return records.filter((record) => {
|
|
@@ -970,102 +960,24 @@ function dedupeViteCssResults(records) {
|
|
|
970
960
|
return true;
|
|
971
961
|
});
|
|
972
962
|
}
|
|
973
|
-
function removeTailwindSourceMediaWrappersRoot(root) {
|
|
974
|
-
let changed = false;
|
|
975
|
-
root.walkAtRules("media", (atRule) => {
|
|
976
|
-
if (!atRule.params.startsWith("source(")) return;
|
|
977
|
-
if (atRule.nodes && atRule.nodes.length > 0) atRule.replaceWith(...atRule.nodes);
|
|
978
|
-
else atRule.remove();
|
|
979
|
-
changed = true;
|
|
980
|
-
});
|
|
981
|
-
if (changed) root.walkAtRules((atRule) => {
|
|
982
|
-
if (atRule.nodes && atRule.nodes.length === 0) atRule.remove();
|
|
983
|
-
});
|
|
984
|
-
return changed;
|
|
985
|
-
}
|
|
986
|
-
function removeTailwindSourceMediaWrappersFallback(css) {
|
|
987
|
-
return css.replace(/@media\s+source\([^)]*\)\s*\{\s*\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\/?\s*\}/gi, "").replace(/@media\s+source\([^)]*\)\s*\{\s*\}/gi, "");
|
|
988
|
-
}
|
|
989
|
-
function removeTailwindEntryDirectivesFromCss(css, preserveCssLayers = false) {
|
|
990
|
-
try {
|
|
991
|
-
const source = require_generator.stripGeneratorPlaceholderMarkers(css);
|
|
992
|
-
const root = _weapp_tailwindcss_postcss.postcss.parse(source);
|
|
993
|
-
const removedMediaWrappers = removeTailwindSourceMediaWrappersRoot(root);
|
|
994
|
-
const removedTailwindDirectives = (0, _weapp_tailwindcss_postcss.removeTailwindSourceDirectivesRoot)(root, { preserveCssLayers });
|
|
995
|
-
return removedMediaWrappers || removedTailwindDirectives ? root.toString() : source;
|
|
996
|
-
} catch {
|
|
997
|
-
const source = removeTailwindSourceMediaWrappersFallback(css);
|
|
998
|
-
return preserveCssLayers ? source : require_generator.removeTailwindSourceDirectives(source);
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
function removeUnsupportedMiniProgramCssImportsFallback(css, file) {
|
|
1002
|
-
if (!isMiniProgramStyleOutputFile(file) || !css.includes("@import")) return css;
|
|
1003
|
-
return css.split(/\r?\n/).filter((line) => {
|
|
1004
|
-
const trimmed = line.trim();
|
|
1005
|
-
if (!trimmed.startsWith("@import")) return true;
|
|
1006
|
-
const params = trimmed.slice(7).trim().replace(/;$/, "").trim();
|
|
1007
|
-
const request = (0, _weapp_tailwindcss_postcss.parseTailwindCssDirectiveRequest)(params);
|
|
1008
|
-
return request === void 0 || (0, _weapp_tailwindcss_postcss.isMiniProgramLocalCssImportRequest)(request);
|
|
1009
|
-
}).join("\n");
|
|
1010
|
-
}
|
|
1011
963
|
function normalizeInjectableCssForTarget(css, file) {
|
|
1012
964
|
return normalizeInjectableCssForTargetWithImports(css, file).css;
|
|
1013
965
|
}
|
|
1014
966
|
function normalizeInjectableCssForTargetWithImports(css, file) {
|
|
1015
|
-
|
|
1016
|
-
css,
|
|
1017
|
-
importedStyleFiles: /* @__PURE__ */ new Set()
|
|
1018
|
-
};
|
|
1019
|
-
try {
|
|
1020
|
-
const root = _weapp_tailwindcss_postcss.postcss.parse(css);
|
|
1021
|
-
const changed = isMiniProgramStyleOutputFile(file) ? (0, _weapp_tailwindcss_postcss.removeUnsupportedMiniProgramCssImportsRoot)(root) : false;
|
|
1022
|
-
const importedStyleFiles = collectImportedStyleFilesRoot(root, file);
|
|
1023
|
-
return {
|
|
1024
|
-
css: changed ? root.toString() : css,
|
|
1025
|
-
importedStyleFiles: importedStyleFiles.size > 0 ? importedStyleFiles : collectImportedStyleFilesFallback(css, file)
|
|
1026
|
-
};
|
|
1027
|
-
} catch {
|
|
1028
|
-
const fallbackCss = removeUnsupportedMiniProgramCssImportsFallback(css, file);
|
|
1029
|
-
return {
|
|
1030
|
-
css: fallbackCss,
|
|
1031
|
-
importedStyleFiles: collectImportedStyleFiles(fallbackCss, file)
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
967
|
+
return (0, _weapp_tailwindcss_postcss_transform.normalizeInjectableCssWithImports)(css, isMiniProgramStyleOutputFile(file), (request) => resolveImportedStyleFile(file, request));
|
|
1034
968
|
}
|
|
1035
969
|
function stripStyleExtension(file) {
|
|
1036
970
|
return file.replace(/[?#].*$/, "").replace(/\.(?:css|wxss|acss|ttss|qss|jxss|tyss|scss|sass|less|styl|stylus|pcss|postcss)$/i, "");
|
|
1037
971
|
}
|
|
1038
|
-
function isStyleImportRequest(request) {
|
|
1039
|
-
return typeof request === "string" && request.length > 0 && !/^(?:https?:)?\/\//i.test(request) && /\.(?:css|wxss|acss|ttss|qss|jxss|tyss)(?:$|[?#])/i.test(request);
|
|
1040
|
-
}
|
|
1041
972
|
function resolveImportedStyleFile(targetFile, request) {
|
|
1042
|
-
if (!isStyleImportRequest(request)) return;
|
|
973
|
+
if (!(0, _weapp_tailwindcss_postcss_transform.isStyleImportRequest)(request)) return;
|
|
1043
974
|
const cleanRequest = request.replace(/[?#].*$/, "");
|
|
1044
975
|
if (cleanRequest.startsWith("/")) return require_source_candidate_scan_signature.normalizeOutputPathKey(cleanRequest.slice(1));
|
|
1045
976
|
const targetDir = posix.posix.dirname(require_source_candidate_scan_signature.normalizeOutputPathKey(targetFile));
|
|
1046
977
|
return require_source_candidate_scan_signature.normalizeOutputPathKey(posix.posix.join(targetDir === "." ? "" : targetDir, cleanRequest));
|
|
1047
978
|
}
|
|
1048
|
-
function collectImportedStyleFilesFromRequests(requests, targetFile) {
|
|
1049
|
-
const imports = /* @__PURE__ */ new Set();
|
|
1050
|
-
for (const request of requests) {
|
|
1051
|
-
const importedFile = resolveImportedStyleFile(targetFile, request);
|
|
1052
|
-
if (importedFile) imports.add(importedFile);
|
|
1053
|
-
}
|
|
1054
|
-
return imports;
|
|
1055
|
-
}
|
|
1056
|
-
function collectImportedStyleFilesRoot(root, targetFile) {
|
|
1057
|
-
return collectImportedStyleFilesFromRequests((0, _weapp_tailwindcss_postcss.collectCssImportRequestsRoot)(root), targetFile);
|
|
1058
|
-
}
|
|
1059
|
-
function collectImportedStyleFilesFallback(css, targetFile) {
|
|
1060
|
-
return collectImportedStyleFilesFromRequests([...css.matchAll(/@import\s+(?:url\(\s*)?(?:"([^"]+)"|'([^']+)'|([^\s;)]+))/g)].map((match) => match[1] ?? match[2] ?? match[3]).filter((request) => typeof request === "string" && request.length > 0), targetFile);
|
|
1061
|
-
}
|
|
1062
979
|
function collectImportedStyleFiles(css, targetFile) {
|
|
1063
|
-
|
|
1064
|
-
try {
|
|
1065
|
-
const imports = collectImportedStyleFilesRoot(_weapp_tailwindcss_postcss.postcss.parse(css), targetFile);
|
|
1066
|
-
return imports.size > 0 ? imports : collectImportedStyleFilesFallback(css, targetFile);
|
|
1067
|
-
} catch {}
|
|
1068
|
-
return collectImportedStyleFilesFallback(css, targetFile);
|
|
980
|
+
return (0, _weapp_tailwindcss_postcss_transform.collectImportedCssFiles)(css, (request) => resolveImportedStyleFile(targetFile, request));
|
|
1069
981
|
}
|
|
1070
982
|
function normalizeMarkerOutputFile(markerFile, resolveViteProcessedCssOutputFile) {
|
|
1071
983
|
return resolveViteProcessedCssOutputFile?.(markerFile) ?? markerFile;
|
|
@@ -1075,13 +987,13 @@ function isMatchingGeneratedCssMarkerFile(targetFile, markerFile, resolveVitePro
|
|
|
1075
987
|
return require_source_candidate_scan_signature.normalizeOutputPathKey(stripStyleExtension(targetFile)) === require_source_candidate_scan_signature.normalizeOutputPathKey(stripStyleExtension(normalizeMarkerOutputFile(markerFile, resolveViteProcessedCssOutputFile)));
|
|
1076
988
|
}
|
|
1077
989
|
function resolveViteProcessedCssAssetSource(file, rawSource, resolveViteProcessedCssOutputFile) {
|
|
1078
|
-
const blocks =
|
|
1079
|
-
if (blocks.length <= 1) return
|
|
990
|
+
const blocks = (0, _weapp_tailwindcss_postcss_transform.parseBundlerGeneratedCssMarkerBlocks)(rawSource).filter((block) => block.bundler === "vite");
|
|
991
|
+
if (blocks.length <= 1) return (0, _weapp_tailwindcss_postcss_transform.stripBundlerGeneratedCssMarkers)(rawSource);
|
|
1080
992
|
const matchedCss = blocks.filter((block) => isMatchingGeneratedCssMarkerFile(file, block.file, resolveViteProcessedCssOutputFile)).map((block) => block.css);
|
|
1081
|
-
return matchedCss.length > 0 ? matchedCss.join("\n") :
|
|
993
|
+
return matchedCss.length > 0 ? matchedCss.join("\n") : (0, _weapp_tailwindcss_postcss_transform.stripBundlerGeneratedCssMarkers)(rawSource);
|
|
1082
994
|
}
|
|
1083
995
|
function collectMatchingGeneratedCssMarkerFiles(file, rawSource, resolveViteProcessedCssOutputFile) {
|
|
1084
|
-
return
|
|
996
|
+
return (0, _weapp_tailwindcss_postcss_transform.parseBundlerGeneratedCssMarkerBlocks)(rawSource).filter((block) => block.bundler === "vite").filter((block) => isMatchingGeneratedCssMarkerFile(file, block.file, resolveViteProcessedCssOutputFile)).map((block) => block.file).filter((markerFile) => typeof markerFile === "string" && markerFile.length > 0);
|
|
1085
997
|
}
|
|
1086
998
|
function collectRootStyleBundleCssSources(bundle, excludedFile) {
|
|
1087
999
|
const sources = [];
|
|
@@ -1090,7 +1002,7 @@ function collectRootStyleBundleCssSources(bundle, excludedFile) {
|
|
|
1090
1002
|
if (output.type !== "asset") continue;
|
|
1091
1003
|
const file = require_source_candidate_scan_signature.normalizeOutputPathKey(getAssetFile(bundleFile, output));
|
|
1092
1004
|
if (file === excludedFileKey || !isRootStyleOutputFile(file)) continue;
|
|
1093
|
-
const source =
|
|
1005
|
+
const source = (0, _weapp_tailwindcss_postcss_transform.stripBundlerGeneratedCssMarkers)(readAssetSource$1(output)).trim();
|
|
1094
1006
|
if (source.length > 0) sources.push(source);
|
|
1095
1007
|
}
|
|
1096
1008
|
return sources;
|
|
@@ -1102,7 +1014,7 @@ function stripQueryAndHash(file) {
|
|
|
1102
1014
|
return file.replace(/[?#].*$/, "");
|
|
1103
1015
|
}
|
|
1104
1016
|
function resolveHtmlLinkedStyleFile(htmlFile, request) {
|
|
1105
|
-
if (!isStyleImportRequest(request)) return;
|
|
1017
|
+
if (!(0, _weapp_tailwindcss_postcss_transform.isStyleImportRequest)(request)) return;
|
|
1106
1018
|
const cleanRequest = stripQueryAndHash(request);
|
|
1107
1019
|
if (cleanRequest.startsWith("/")) return require_source_candidate_scan_signature.normalizeOutputPathKey(cleanRequest.slice(1));
|
|
1108
1020
|
const htmlDir = posix.posix.dirname(require_source_candidate_scan_signature.normalizeOutputPathKey(stripQueryAndHash(htmlFile)));
|
|
@@ -1143,7 +1055,7 @@ function removeDuplicateUnlinkedRootCssAssetsReferencedByHtml(bundle, options =
|
|
|
1143
1055
|
if (output.type !== "asset") continue;
|
|
1144
1056
|
const file = getAssetFile(bundleFile, output);
|
|
1145
1057
|
if (!isCssOutputFile(file) || isMiniProgramStyleOutputFile(file) || !isLinkedStyleFile(file, linked)) continue;
|
|
1146
|
-
const source =
|
|
1058
|
+
const source = (0, _weapp_tailwindcss_postcss_transform.stripBundlerGeneratedCssMarkers)(readAssetSource$1(output)).trim();
|
|
1147
1059
|
if (source.length > 0) linkedSources.add(source);
|
|
1148
1060
|
}
|
|
1149
1061
|
if (linkedSources.size === 0) return 0;
|
|
@@ -1152,7 +1064,7 @@ function removeDuplicateUnlinkedRootCssAssetsReferencedByHtml(bundle, options =
|
|
|
1152
1064
|
if (output.type !== "asset") continue;
|
|
1153
1065
|
const file = getAssetFile(bundleFile, output);
|
|
1154
1066
|
if (!isRootStyleOutputFile(file) || isMiniProgramStyleOutputFile(file) || isLinkedStyleFile(file, linked)) continue;
|
|
1155
|
-
const source =
|
|
1067
|
+
const source = (0, _weapp_tailwindcss_postcss_transform.stripBundlerGeneratedCssMarkers)(readAssetSource$1(output)).trim();
|
|
1156
1068
|
if (!linkedSources.has(source)) continue;
|
|
1157
1069
|
delete bundle[bundleFile];
|
|
1158
1070
|
options.debug?.("remove duplicate unlinked root css asset referenced by html: %s", file);
|
|
@@ -1298,7 +1210,7 @@ function resolveSfcStyleRequestFromKnownSource(sourceFile, sfcSource, styleSourc
|
|
|
1298
1210
|
}
|
|
1299
1211
|
function hasTailwindGenerationSource(source, options = {}) {
|
|
1300
1212
|
const allowRootDirectives = options.allowRootDirectives !== false;
|
|
1301
|
-
return
|
|
1213
|
+
return (0, _weapp_tailwindcss_postcss_transform.hasTailwindNonRootGenerationDirectives)(source, { importFallback: true }) || allowRootDirectives && (0, _weapp_tailwindcss_postcss_transform.hasTailwindSourceDirectives)(source, { importFallback: true }) || allowRootDirectives && (0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(source, { importFallback: true }) || (0, _weapp_tailwindcss_postcss_transform.hasTailwindApplyDirective)(source);
|
|
1302
1214
|
}
|
|
1303
1215
|
function hasTailwindGenerationSourceForFile(file, source) {
|
|
1304
1216
|
if (require_generator.isTailwindV4CssEntry(file)) return hasTailwindGenerationSource(source);
|
|
@@ -1432,7 +1344,7 @@ function resolveSourceStyleSourceFromOutputFile(outputFile, snapshot, outputRoot
|
|
|
1432
1344
|
const cachedSources = [...getSourceStyleSources?.() ?? []].filter(([file, source]) => CSS_SOURCE_OUTPUT_EXT_RE.test(file) && hasTailwindGenerationSourceForFile(file, source)).map(([file, source]) => ({
|
|
1433
1345
|
file,
|
|
1434
1346
|
source,
|
|
1435
|
-
score:
|
|
1347
|
+
score: require_generated_css_marker.scoreTailwindV4CssSourceFileMatch(outputFile, file, {
|
|
1436
1348
|
outputRoot,
|
|
1437
1349
|
projectRoot: sourceRoot
|
|
1438
1350
|
})
|
|
@@ -1440,7 +1352,7 @@ function resolveSourceStyleSourceFromOutputFile(outputFile, snapshot, outputRoot
|
|
|
1440
1352
|
const configuredSources = [...configuredSourceEntries ?? []].filter(([file, source]) => CSS_SOURCE_OUTPUT_EXT_RE.test(file) && hasTailwindGenerationSourceForFile(file, source)).map(([file, source]) => ({
|
|
1441
1353
|
file,
|
|
1442
1354
|
source,
|
|
1443
|
-
score:
|
|
1355
|
+
score: require_generated_css_marker.scoreTailwindV4CssSourceFileMatch(outputFile, file, {
|
|
1444
1356
|
outputRoot,
|
|
1445
1357
|
projectRoot: sourceRoot
|
|
1446
1358
|
})
|
|
@@ -1626,7 +1538,7 @@ async function resolveHotTailwindCssModules(ctx, tailwindRootCssModuleIds, selec
|
|
|
1626
1538
|
const root = ctx.server.config?.root ?? node_process.default.cwd();
|
|
1627
1539
|
const outDir = ctx.server.config?.build?.outDir ? resolveViteModuleIdentity(ctx.server.config.build.outDir, root) : void 0;
|
|
1628
1540
|
const isHotSourceStyleModule = (id) => {
|
|
1629
|
-
if (typeof id !== "string" || !
|
|
1541
|
+
if (typeof id !== "string" || !require_generated_css_marker.isSourceStyleRequest(id)) return false;
|
|
1630
1542
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
1631
1543
|
if (isRootMiniProgramStyleUrl(file) || !isAbsoluteFilePath(file) && !file.startsWith("/")) return false;
|
|
1632
1544
|
if (outDir) {
|
|
@@ -1661,7 +1573,7 @@ async function resolveHotSourceModulesByIds(ctx, ids) {
|
|
|
1661
1573
|
}
|
|
1662
1574
|
return resolveHotModulesByIds(ctx, sourceIds, (mod) => {
|
|
1663
1575
|
const modId = mod.id ?? mod.url;
|
|
1664
|
-
return !
|
|
1576
|
+
return !require_generated_css_marker.isSourceStyleRequest(modId);
|
|
1665
1577
|
});
|
|
1666
1578
|
}
|
|
1667
1579
|
async function resolveHotSourceModules(ctx) {
|
|
@@ -1670,7 +1582,7 @@ async function resolveHotSourceModules(ctx) {
|
|
|
1670
1582
|
const collectModule = (mod) => {
|
|
1671
1583
|
if (mod == null || seenModules.has(mod)) return;
|
|
1672
1584
|
const modId = mod.id ?? mod.url;
|
|
1673
|
-
if (
|
|
1585
|
+
if (require_generated_css_marker.isSourceStyleRequest(modId)) return;
|
|
1674
1586
|
seenModules.add(mod);
|
|
1675
1587
|
modules.push(mod);
|
|
1676
1588
|
};
|
|
@@ -1689,7 +1601,7 @@ function mergeHotModulesByIdentity(root, ...groups) {
|
|
|
1689
1601
|
mod.url,
|
|
1690
1602
|
mod.file
|
|
1691
1603
|
].filter((id) => typeof id === "string" && id.length > 0);
|
|
1692
|
-
const moduleKind = ids.some(
|
|
1604
|
+
const moduleKind = ids.some(require_generated_css_marker.isSourceStyleRequest) ? "style" : "source";
|
|
1693
1605
|
const keys = ids.map((id) => `${moduleKind}:${resolveViteModuleIdentity(id, root).key}`);
|
|
1694
1606
|
if (keys.some((key) => seenIdentities.has(key))) continue;
|
|
1695
1607
|
seenModules.add(mod);
|
|
@@ -1762,7 +1674,7 @@ function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
|
1762
1674
|
function hasSelfAcceptingNonStyleHotModule(modules) {
|
|
1763
1675
|
return modules.some((mod) => {
|
|
1764
1676
|
const modId = mod.id ?? mod.url;
|
|
1765
|
-
return !
|
|
1677
|
+
return !require_generated_css_marker.isSourceStyleRequest(modId) && mod.isSelfAccepting === true;
|
|
1766
1678
|
});
|
|
1767
1679
|
}
|
|
1768
1680
|
function sendSupplementalCssHotUpdates(ctx, cssModules, fallbackCssIds = [], fallbackSourceIds = [], handledModules = ctx.modules) {
|
|
@@ -1777,7 +1689,7 @@ function sendSupplementalCssHotUpdates(ctx, cssModules, fallbackCssIds = [], fal
|
|
|
1777
1689
|
updates.push(createSupplementalHotUpdate(hotUrl, ctx.timestamp));
|
|
1778
1690
|
}
|
|
1779
1691
|
for (const id of fallbackCssIds) {
|
|
1780
|
-
if (!
|
|
1692
|
+
if (!require_generated_css_marker.isSourceStyleRequest(id) || includesHotId(handledModules, id, root)) continue;
|
|
1781
1693
|
const hotUrl = resolveCssHotUrl(id, root);
|
|
1782
1694
|
if (!hotUrl || seenUrls.has(hotUrl)) continue;
|
|
1783
1695
|
seenUrls.add(hotUrl);
|
|
@@ -1848,10 +1760,10 @@ function shouldGenerateCssByGenerator(opts, majorVersion, file, rawSource, proce
|
|
|
1848
1760
|
uniAppX: opts.uniAppX
|
|
1849
1761
|
});
|
|
1850
1762
|
if (!generatorOptions.enabled) return false;
|
|
1851
|
-
if (
|
|
1852
|
-
if (
|
|
1853
|
-
if (
|
|
1854
|
-
return processed &&
|
|
1763
|
+
if ((0, _weapp_tailwindcss_postcss_transform.hasLocalCssImport)(rawSource)) return false;
|
|
1764
|
+
if ((0, _weapp_tailwindcss_postcss_transform.hasTailwindGeneratedCssMarkers)(rawSource)) return true;
|
|
1765
|
+
if ((0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(rawSource, { importFallback: generatorOptions.importFallback })) return true;
|
|
1766
|
+
return processed && (0, _weapp_tailwindcss_postcss_transform.hasTailwindApplyDirective)(rawSource) && shouldFinalizeProcessedCssAsset(opts, file);
|
|
1855
1767
|
}
|
|
1856
1768
|
function shouldFinalizeProcessedCssAsset(opts, file) {
|
|
1857
1769
|
return opts.mainCssChunkMatcher(file, opts.appType);
|
|
@@ -1861,7 +1773,7 @@ function collectViteProcessedCssSources(getViteProcessedCssAssetResults) {
|
|
|
1861
1773
|
}
|
|
1862
1774
|
function finalizeWebCss(css, context, cssPipelineStrategy) {
|
|
1863
1775
|
const shouldApplyWebCssCompat = shouldApplyViteWebCssCompat(context, cssPipelineStrategy);
|
|
1864
|
-
const defaultWebCssCompat = (value) => (0,
|
|
1776
|
+
const defaultWebCssCompat = (value) => (0, _weapp_tailwindcss_postcss_transform.transformWebCssCompat)(value, resolveViteWebCssCompatOptions(context));
|
|
1865
1777
|
return cssPipelineStrategy?.transformGeneratedCss?.(css, {
|
|
1866
1778
|
...context,
|
|
1867
1779
|
defaultWebCssCompat,
|
|
@@ -1883,7 +1795,7 @@ async function finalizeWebCssCalc(bundle, context) {
|
|
|
1883
1795
|
const sources = new Set(collectViteProcessedCssSources(context.getViteProcessedCssAssetResults));
|
|
1884
1796
|
const contextCss = sources.size === 1 ? sources.values().next().value : void 0;
|
|
1885
1797
|
for (const { asset, original } of pending) {
|
|
1886
|
-
const css = await (0,
|
|
1798
|
+
const css = await (0, _weapp_tailwindcss_postcss_transform.applyConfiguredCssCalc)(original, {
|
|
1887
1799
|
cssCalc,
|
|
1888
1800
|
contextCss
|
|
1889
1801
|
});
|
|
@@ -1992,7 +1904,7 @@ function resolveProcessedCssAssets(cssAssets, records, options, bundleFiles) {
|
|
|
1992
1904
|
}
|
|
1993
1905
|
if (!output && records.length === 1 && htmlOwnedAssets.length === 1 && htmlOwnedAssets[0]) {
|
|
1994
1906
|
output = htmlOwnedAssets[0];
|
|
1995
|
-
useAssetSource =
|
|
1907
|
+
useAssetSource = (0, _weapp_tailwindcss_postcss_transform.hasTailwindGeneratedCss)(output.original) || (0, _weapp_tailwindcss_postcss_transform.hasTailwindGeneratedCssMarkers)(output.original);
|
|
1996
1908
|
}
|
|
1997
1909
|
if (!output) return;
|
|
1998
1910
|
const existing = processedAssets.get(output);
|
|
@@ -2033,7 +1945,7 @@ function tryFinalizeGenericWebCss(options) {
|
|
|
2033
1945
|
for (const [{ asset, file, original }, processed] of processedAssets) {
|
|
2034
1946
|
const finalizeStartedAt = performance.now();
|
|
2035
1947
|
const finalCssSource = processed.useAssetSource ? original : processed.css;
|
|
2036
|
-
const generated = finalizeWebCss(
|
|
1948
|
+
const generated = finalizeWebCss((0, _weapp_tailwindcss_postcss_transform.stripBundlerGeneratedCssMarkers)(finalCssSource), {
|
|
2037
1949
|
...options.createCssPipelineContext(file),
|
|
2038
1950
|
file
|
|
2039
1951
|
}, context.cssPipelineStrategy);
|
|
@@ -2159,7 +2071,7 @@ function normalizeCssSourceIdentity(sourceFile) {
|
|
|
2159
2071
|
const { filename, query } = parseVueRequest(cleanSourceFile);
|
|
2160
2072
|
const normalizedFile = require_source_candidate_scan_signature.normalizeOutputPathKey(filename);
|
|
2161
2073
|
if (query.type === "style") return `${normalizedFile}?type=style&index=${query.index ?? 0}`;
|
|
2162
|
-
return require_source_candidate_scan_signature.normalizeOutputPathKey(
|
|
2074
|
+
return require_source_candidate_scan_signature.normalizeOutputPathKey(require_generated_css_marker.stripRequestQuery(cleanSourceFile));
|
|
2163
2075
|
}
|
|
2164
2076
|
function hasSfcStyleBlocks(source) {
|
|
2165
2077
|
SFC_STYLE_BLOCK_RE.lastIndex = 0;
|
|
@@ -2264,14 +2176,14 @@ function createViteCssMemory(options) {
|
|
|
2264
2176
|
for (const [rememberedKey, remembered] of relatedRememberedEntries) refreshRememberedCssSourceEntry(rememberedKey, remembered, sourceFile, rawSource);
|
|
2265
2177
|
};
|
|
2266
2178
|
const resolveCachedStyleSource = (sourceFile) => {
|
|
2267
|
-
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(
|
|
2179
|
+
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(require_generated_css_marker.stripRequestQuery(sourceFile));
|
|
2268
2180
|
if (SFC_COMPONENT_FILE_RE.test(file)) return getKnownSfcSource(file);
|
|
2269
|
-
if (
|
|
2181
|
+
if (require_generated_css_marker.isSourceStyleRequest(file)) return options.getSourceCandidateSource(file);
|
|
2270
2182
|
};
|
|
2271
2183
|
const resolveCurrentStyleSource = (sourceFile) => {
|
|
2272
2184
|
const cached = resolveCachedStyleSource(sourceFile);
|
|
2273
2185
|
if (cached != null) return cached;
|
|
2274
|
-
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(
|
|
2186
|
+
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(require_generated_css_marker.stripRequestQuery(sourceFile));
|
|
2275
2187
|
const knownSource = knownCssSources.get(normalizeCssSourceIdentity(sourceFile));
|
|
2276
2188
|
if (knownSource != null) return knownSource;
|
|
2277
2189
|
const candidateSource = options.getSourceCandidateSource(file);
|
|
@@ -2280,7 +2192,7 @@ function createViteCssMemory(options) {
|
|
|
2280
2192
|
const refreshRememberedCssSourceByCurrentFile = async (sourceFile) => {
|
|
2281
2193
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(sourceFile);
|
|
2282
2194
|
const normalizedSourceFile = require_source_candidate_scan_signature.normalizeOutputPathKey(file);
|
|
2283
|
-
const matchedRememberedSources = [...rememberedCssSources.values()].filter((remembered) => require_source_candidate_scan_signature.normalizeOutputPathKey(
|
|
2195
|
+
const matchedRememberedSources = [...rememberedCssSources.values()].filter((remembered) => require_source_candidate_scan_signature.normalizeOutputPathKey(require_generated_css_marker.stripRequestQuery((0, _weapp_tailwindcss_shared.cleanUrl)(remembered.sourceFile))) === normalizedSourceFile);
|
|
2284
2196
|
if (matchedRememberedSources.length === 0) return;
|
|
2285
2197
|
const source = await resolveCurrentStyleSource(file);
|
|
2286
2198
|
if (source == null) {
|
|
@@ -2295,7 +2207,7 @@ function createViteCssMemory(options) {
|
|
|
2295
2207
|
}
|
|
2296
2208
|
return;
|
|
2297
2209
|
}
|
|
2298
|
-
if (
|
|
2210
|
+
if (require_generated_css_marker.isSourceStyleRequest(file)) refreshRememberedCssSourceBySourceFile(file, source);
|
|
2299
2211
|
};
|
|
2300
2212
|
const prune = (pruneOptions) => {
|
|
2301
2213
|
const activeFiles = new Set([...pruneOptions.activeFiles].map(require_source_candidate_scan_signature.normalizeOutputPathKey));
|
|
@@ -2380,10 +2292,7 @@ function joinPosixPath(base, subpath) {
|
|
|
2380
2292
|
function isCssLikeImporter(importer) {
|
|
2381
2293
|
if (!importer) return false;
|
|
2382
2294
|
const normalized = (0, _weapp_tailwindcss_shared.cleanUrl)(importer);
|
|
2383
|
-
return
|
|
2384
|
-
}
|
|
2385
|
-
function stripTailwindConfigDirectives(code) {
|
|
2386
|
-
return code.replace(/^\s*@config\s+(?:"[^"]+"|'[^']+')[^;\n]*;\s*$/gm, "");
|
|
2295
|
+
return require_generated_css_marker.isSourceStyleRequest(importer) || isCSSRequest(normalized) || normalized.endsWith("/*");
|
|
2387
2296
|
}
|
|
2388
2297
|
function createRewriteCssImportsPlugins(options) {
|
|
2389
2298
|
if (!options.shouldRewrite && !options.shouldOwnTailwindGeneration) return [];
|
|
@@ -2406,9 +2315,9 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
2406
2315
|
async transform(code, id) {
|
|
2407
2316
|
if (!isCSSRequest(id)) return null;
|
|
2408
2317
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
2409
|
-
const normalizedCode = !isSfcStyleSourceFile(file) && (
|
|
2318
|
+
const normalizedCode = !isSfcStyleSourceFile(file) && ((0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(code) || code.includes("@config")) ? (0, _weapp_tailwindcss_postcss_transform.normalizeTailwindConfigDirectives)(code, node_path.default.dirname(file)) : code;
|
|
2410
2319
|
await options.onCssSourceTransform?.(id, normalizedCode);
|
|
2411
|
-
const hasTailwindRoot =
|
|
2320
|
+
const hasTailwindRoot = (0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(normalizedCode, { importFallback: true });
|
|
2412
2321
|
if (hasTailwindRoot) await options.onTailwindRootCss?.(id, normalizedCode);
|
|
2413
2322
|
const shouldGenerateInPreTransform = !options.shouldDeferGeneration?.(id, normalizedCode) && (hasTailwindRoot || options.shouldGenerateCss?.(id, normalizedCode));
|
|
2414
2323
|
if (options.shouldOwnTailwindGeneration && shouldGenerateInPreTransform) {
|
|
@@ -2434,7 +2343,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
2434
2343
|
appType: resolveAppType(),
|
|
2435
2344
|
rootImport
|
|
2436
2345
|
});
|
|
2437
|
-
const nextCode = shouldOwnTailwindGeneration ? stripTailwindConfigDirectives(rewritten ?? normalizedCode) : rewritten;
|
|
2346
|
+
const nextCode = shouldOwnTailwindGeneration ? (0, _weapp_tailwindcss_postcss_transform.stripTailwindConfigDirectives)(rewritten ?? normalizedCode) : rewritten;
|
|
2438
2347
|
if (!nextCode || nextCode === code) return null;
|
|
2439
2348
|
return {
|
|
2440
2349
|
code: nextCode,
|
|
@@ -2444,7 +2353,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
2444
2353
|
}];
|
|
2445
2354
|
}
|
|
2446
2355
|
function hasVitePipelineTailwindGenerationDirective(code) {
|
|
2447
|
-
return
|
|
2356
|
+
return (0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(code) || (0, _weapp_tailwindcss_postcss_transform.hasTailwindApplyDirective)(code);
|
|
2448
2357
|
}
|
|
2449
2358
|
//#endregion
|
|
2450
2359
|
//#region src/bundlers/vite/runtime-class-set.ts
|
|
@@ -2641,22 +2550,22 @@ function replaceViteCssHmrModuleCss(code, css) {
|
|
|
2641
2550
|
return `${code.slice(0, extracted.start)}${encodeJsStringLiteral(css)}${code.slice(extracted.end)}`;
|
|
2642
2551
|
}
|
|
2643
2552
|
function isViteServeStyleRequest(id, command) {
|
|
2644
|
-
return command === "serve" &&
|
|
2553
|
+
return command === "serve" && require_generated_css_marker.isSourceStyleRequest(id) && !SPECIAL_QUERY_RE.test(id) && !COMMON_JS_PROXY_RE.test(id);
|
|
2645
2554
|
}
|
|
2646
2555
|
function isViteServeCssRootRequest(id, command) {
|
|
2647
|
-
return command === "serve" &&
|
|
2556
|
+
return command === "serve" && require_generated_css_marker.isSourceStyleRequest(id) && !SPECIAL_QUERY_RE.test(id) && !COMMON_JS_PROXY_RE.test(id);
|
|
2648
2557
|
}
|
|
2649
2558
|
function isViteBuildStyleRequest(id, command) {
|
|
2650
|
-
return command === "build" &&
|
|
2559
|
+
return command === "build" && require_generated_css_marker.isSourceStyleRequest(id) && !SPECIAL_QUERY_RE.test(id) && !COMMON_JS_PROXY_RE.test(id);
|
|
2651
2560
|
}
|
|
2652
2561
|
function isViteCssHmrModule(code, id, command) {
|
|
2653
2562
|
return isViteServeStyleRequest(id, command) && VITE_CSS_HMR_MODULE_RE.test(code) && (/[?&](?:direct|vue)(?:&|$)/.test(id) || DEFERRED_CSS_HMR_QUERY_RE.test(id));
|
|
2654
2563
|
}
|
|
2655
2564
|
function hasViteCssGenerationDirective(code) {
|
|
2656
|
-
return
|
|
2565
|
+
return (0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(code) || (0, _weapp_tailwindcss_postcss_transform.hasTailwindSourceDirectives)(code, { importFallback: true }) || (0, _weapp_tailwindcss_postcss_transform.hasTailwindApplyDirective)(code);
|
|
2657
2566
|
}
|
|
2658
2567
|
function hasViteServeCssRootDirective(code) {
|
|
2659
|
-
return
|
|
2568
|
+
return (0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(code);
|
|
2660
2569
|
}
|
|
2661
2570
|
function createViteCssGenerationPlugins(options) {
|
|
2662
2571
|
return [
|
|
@@ -2666,7 +2575,7 @@ function createViteCssGenerationPlugins(options) {
|
|
|
2666
2575
|
enforce: "pre",
|
|
2667
2576
|
async transform(code, id) {
|
|
2668
2577
|
if (!options.shouldGenerate() || !isViteServeCssRootRequest(id, options.getCommand())) return;
|
|
2669
|
-
if (!
|
|
2578
|
+
if (!(0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(code)) return;
|
|
2670
2579
|
if (DEFERRED_CSS_HMR_QUERY_RE.test(id)) return;
|
|
2671
2580
|
await options.onTailwindRootCss?.(id, code);
|
|
2672
2581
|
const generatedCss = await options.generateCss(id, code, {
|
|
@@ -2788,10 +2697,10 @@ function createViteHmrCandidateState(options) {
|
|
|
2788
2697
|
const createChange = (file, change, changeOptions = {}) => ({
|
|
2789
2698
|
...change,
|
|
2790
2699
|
file,
|
|
2791
|
-
runtimeAffecting: changeOptions.runtimeAffecting === true || options.isRuntimeAffectingSource?.(file) === true ||
|
|
2700
|
+
runtimeAffecting: changeOptions.runtimeAffecting === true || options.isRuntimeAffectingSource?.(file) === true || require_generated_css_marker.isSourceStyleRequest(file)
|
|
2792
2701
|
});
|
|
2793
2702
|
const apply = (change) => {
|
|
2794
|
-
if (
|
|
2703
|
+
if (require_generated_css_marker.isSourceStyleRequest(change.file)) {
|
|
2795
2704
|
clear();
|
|
2796
2705
|
return change;
|
|
2797
2706
|
}
|
|
@@ -2811,7 +2720,7 @@ function createViteHmrCandidateState(options) {
|
|
|
2811
2720
|
};
|
|
2812
2721
|
const resolve = (generatorCode, file) => {
|
|
2813
2722
|
const fileKey = normalizeCssTargetFile(file);
|
|
2814
|
-
if (options.getCommand() !== "serve" || !pendingChange || pendingChange.runtimeAffecting || pendingChange.addedCandidates.size === 0 || options.getGeneratorOptions().target === "weapp" &&
|
|
2723
|
+
if (options.getCommand() !== "serve" || !pendingChange || pendingChange.runtimeAffecting || pendingChange.addedCandidates.size === 0 || options.getGeneratorOptions().target === "weapp" && (0, _weapp_tailwindcss_postcss_transform.hasUserCssLayerBlocks)(generatorCode) || !options.cleanGeneratedCssByFile.has(fileKey) || !options.generatedClassSetByFile.has(fileKey) || pendingTargetsArmed && !pendingCssTargetFiles?.has(fileKey)) return;
|
|
2815
2724
|
return pendingChange;
|
|
2816
2725
|
};
|
|
2817
2726
|
const finishTarget = (file) => {
|
|
@@ -2930,7 +2839,7 @@ function createViteHmrCssModuleVersionFilterPlugin(tracker) {
|
|
|
2930
2839
|
handler(ctx) {
|
|
2931
2840
|
const styleModules = ctx.modules.filter((mod) => {
|
|
2932
2841
|
const request = mod.id ?? mod.url;
|
|
2933
|
-
return
|
|
2842
|
+
return require_generated_css_marker.isSourceStyleRequest(request);
|
|
2934
2843
|
});
|
|
2935
2844
|
if (styleModules.length === 0) return;
|
|
2936
2845
|
const root = ctx.server.config?.root ?? node_process.default.cwd();
|
|
@@ -3032,10 +2941,10 @@ function createFrameworkPostPlugin(options) {
|
|
|
3032
2941
|
replacement: options.generatorPlaceholderCssFile
|
|
3033
2942
|
}] } };
|
|
3034
2943
|
if (config.css?.postcss !== void 0) return baseConfig;
|
|
3035
|
-
return (0,
|
|
2944
|
+
return (0, _weapp_tailwindcss_postcss_transform.resolvePostcssConfig)(root).then((postcssConfig) => {
|
|
3036
2945
|
if (!postcssConfig) return baseConfig;
|
|
3037
2946
|
const plugins = [...postcssConfig.plugins];
|
|
3038
|
-
const removed = (0,
|
|
2947
|
+
const removed = (0, _weapp_tailwindcss_postcss_transform.removeTailwindPostcssPlugins)(plugins);
|
|
3039
2948
|
if (removed > 0) options.debug("inline filtered postcss config without official tailwind plugins in generator mode: %d", removed);
|
|
3040
2949
|
return {
|
|
3041
2950
|
...baseConfig,
|
|
@@ -3089,14 +2998,14 @@ function createFrameworkPostPlugin(options) {
|
|
|
3089
2998
|
if (typeof config.css.postcss === "object" && Array.isArray(config.css.postcss.plugins)) {
|
|
3090
2999
|
const postcssPlugins = config.css.postcss.plugins;
|
|
3091
3000
|
if (options.shouldOwnTailwindGeneration) {
|
|
3092
|
-
const removed = (0,
|
|
3001
|
+
const removed = (0, _weapp_tailwindcss_postcss_transform.removeTailwindPostcssPlugins)(postcssPlugins);
|
|
3093
3002
|
if (removed > 0) {
|
|
3094
3003
|
_weapp_tailwindcss_logger.logger.warn("检测到 @tailwindcss/postcss,生成模式下已移除该插件以避免 Tailwind CSS 重复生成。");
|
|
3095
3004
|
options.debug("remove official tailwind postcss plugins in generator mode: %d", removed);
|
|
3096
3005
|
}
|
|
3097
3006
|
}
|
|
3098
3007
|
}
|
|
3099
|
-
|
|
3008
|
+
require_generated_css_marker.captureFrameworkPostcssOptions(options.opts, config.css?.postcss && typeof config.css.postcss === "object" ? config.css.postcss : void 0);
|
|
3100
3009
|
}, { emit: false });
|
|
3101
3010
|
}
|
|
3102
3011
|
};
|
|
@@ -3256,8 +3165,8 @@ function createFrameworkSourceScanSession(options) {
|
|
|
3256
3165
|
...scanRoot,
|
|
3257
3166
|
outDir: sourceScanOutDir
|
|
3258
3167
|
}));
|
|
3259
|
-
sourceScanBoundaryMatcher =
|
|
3260
|
-
sourceScanMatcher =
|
|
3168
|
+
sourceScanBoundaryMatcher = require_generated_css_marker.createSourceCandidateEligibilityMatcher(matcherRoots);
|
|
3169
|
+
sourceScanMatcher = require_generated_css_marker.createSourceCandidateEligibilityMatcher(matcherRoots, sourceScanEligibleFiles);
|
|
3261
3170
|
};
|
|
3262
3171
|
const refreshSourceScanEligibleFiles = async () => {
|
|
3263
3172
|
sourceScanEligibleFilesRefresh ?? (sourceScanEligibleFilesRefresh = Promise.all(sourceScanRoots.map((scanRoot) => options.sourceCandidateCollector.resolveScanFiles({
|
|
@@ -3366,7 +3275,7 @@ function createFrameworkSourceScanSession(options) {
|
|
|
3366
3275
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
3367
3276
|
const runtimeAffectingByDependency = isDependency(file);
|
|
3368
3277
|
if (runtimeAffectingByDependency) invalidate();
|
|
3369
|
-
const resolvedFile =
|
|
3278
|
+
const resolvedFile = (0, require_tailwindcss.source_scan_exports.resolveSourceScanPath)(file);
|
|
3370
3279
|
if (sourceScanMatcher && !sourceScanMatcher(file) && sourceScanBoundaryMatcher?.(file) && !sourceScanIneligibleFiles.has(resolvedFile)) {
|
|
3371
3280
|
await refreshSourceScanEligibleFiles();
|
|
3372
3281
|
if (!sourceScanMatcher(file)) sourceScanIneligibleFiles.add(resolvedFile);
|
|
@@ -3374,7 +3283,7 @@ function createFrameworkSourceScanSession(options) {
|
|
|
3374
3283
|
if (sourceScanMatcher && !sourceScanMatcher(file)) {
|
|
3375
3284
|
const change = options.sourceCandidateCollector.remove(file);
|
|
3376
3285
|
cacheCurrent();
|
|
3377
|
-
return (
|
|
3286
|
+
return (require_generated_css_marker.isSourceStyleRequest(file) ? (0, node_fs_promises.readFile)(file, "utf8").then((source) => options.cssMemory.refreshRememberedCssSourceBySourceFile(file, source)).catch((error) => {
|
|
3378
3287
|
if ((typeof error === "object" && error !== null && "code" in error ? error.code : void 0) !== "ENOENT") options.debug("remembered css source watch refresh failed: %s %O", file, error);
|
|
3379
3288
|
}) : Promise.resolve()).then(() => options.cssMemory.refreshRememberedCssSourceByCurrentFile(file)).then(() => rememberHotUpdateChange(options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: true }))));
|
|
3380
3289
|
}
|
|
@@ -3478,7 +3387,7 @@ function createFrameworkTailwindRootCss(options) {
|
|
|
3478
3387
|
if (!options.shouldOwnTailwindGeneration || typeof id !== "string" || id.length === 0) return;
|
|
3479
3388
|
moduleIds.add(id);
|
|
3480
3389
|
const identity = resolveViteModuleIdentity(id);
|
|
3481
|
-
if (
|
|
3390
|
+
if (require_generated_css_marker.isSourceStyleRequest(identity.cleanId)) for (const moduleId of identity.lookupIds) moduleIds.add(moduleId);
|
|
3482
3391
|
};
|
|
3483
3392
|
const register = async (id, code) => {
|
|
3484
3393
|
rememberModule(id);
|
|
@@ -3487,7 +3396,7 @@ function createFrameworkTailwindRootCss(options) {
|
|
|
3487
3396
|
};
|
|
3488
3397
|
const refreshSource = async (id, code) => {
|
|
3489
3398
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
3490
|
-
if (!moduleIds.has(id) && !moduleIds.has(file) && !
|
|
3399
|
+
if (!moduleIds.has(id) && !moduleIds.has(file) && !(0, _weapp_tailwindcss_postcss_transform.hasTailwindRootDirectives)(code, { importFallback: options.getImportFallback() })) return;
|
|
3491
3400
|
hotSourceByFile.set(normalizeSourceFile(id), code);
|
|
3492
3401
|
await register(id, code);
|
|
3493
3402
|
options.sourceScanSession.invalidate();
|
|
@@ -3562,7 +3471,7 @@ function createCssOnlyVitePlugins(options = {}) {
|
|
|
3562
3471
|
});
|
|
3563
3472
|
const disabled = opts.disabled === true || typeof opts.disabled === "object" && opts.disabled.plugin === true;
|
|
3564
3473
|
const shouldGenerate = !disabled && resolveWebGeneratorOptions(opts).enabled;
|
|
3565
|
-
const sourceCandidateCollector =
|
|
3474
|
+
const sourceCandidateCollector = require_generated_css_marker.createSourceCandidateCollector({
|
|
3566
3475
|
bareArbitraryValues: opts.arbitraryValues?.bareArbitraryValues,
|
|
3567
3476
|
customAttributesEntities: opts.customAttributesEntities,
|
|
3568
3477
|
disabledDefaultTemplateHandler: opts.disabledDefaultTemplateHandler
|
|
@@ -3598,7 +3507,7 @@ function createCssOnlyVitePlugins(options = {}) {
|
|
|
3598
3507
|
debug,
|
|
3599
3508
|
getResolvedConfig: () => resolvedConfig,
|
|
3600
3509
|
hmrCandidateState,
|
|
3601
|
-
isCandidateRequest:
|
|
3510
|
+
isCandidateRequest: require_generated_css_marker.isSourceCandidateRequest,
|
|
3602
3511
|
isWatchLikeBuild: () => resolvedConfig?.command === "serve" || resolvedConfig?.build.watch != null,
|
|
3603
3512
|
opts,
|
|
3604
3513
|
runtimeState,
|
|
@@ -3616,7 +3525,7 @@ function createCssOnlyVitePlugins(options = {}) {
|
|
|
3616
3525
|
await refreshRuntimeState(true);
|
|
3617
3526
|
},
|
|
3618
3527
|
registerAutoCssSource: async (id, css) => {
|
|
3619
|
-
cssMemory.refreshRememberedCssSourceBySourceFile(id,
|
|
3528
|
+
cssMemory.refreshRememberedCssSourceBySourceFile(id, (0, _weapp_tailwindcss_postcss_transform.normalizeTailwindSourceForGenerator)((0, _weapp_tailwindcss_postcss_transform.normalizeTailwindConfigDirectives)(css, node_path.default.dirname((0, _weapp_tailwindcss_shared.cleanUrl)(id))), { importFallback: true }));
|
|
3620
3529
|
},
|
|
3621
3530
|
shouldOwnTailwindGeneration: shouldGenerate,
|
|
3622
3531
|
sourceScanSession
|
|
@@ -3635,12 +3544,12 @@ function createCssOnlyVitePlugins(options = {}) {
|
|
|
3635
3544
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
3636
3545
|
const outputFile = resolveViteCssPipelineOutputFile(file, opts, resolvedConfig?.root ?? node_process.default.cwd(), true, false, void 0);
|
|
3637
3546
|
const runtime = hookContext?.sourceCandidates ? new Set(hookContext.sourceCandidates) : await collectCssSourceCandidates();
|
|
3638
|
-
const generated = await
|
|
3547
|
+
const generated = await require_generated_css_marker.generateTailwindV4Css({
|
|
3639
3548
|
opts,
|
|
3640
3549
|
runtimeState,
|
|
3641
3550
|
runtime,
|
|
3642
3551
|
compilerMode: "legacy",
|
|
3643
|
-
rawSource:
|
|
3552
|
+
rawSource: (0, _weapp_tailwindcss_postcss_transform.normalizeEmptyTailwindCustomVariants)(code),
|
|
3644
3553
|
file,
|
|
3645
3554
|
outputFile,
|
|
3646
3555
|
cssHandlerOptions: cssHandlerOptions.getCssHandlerOptions(file),
|
|
@@ -3652,9 +3561,9 @@ function createCssOnlyVitePlugins(options = {}) {
|
|
|
3652
3561
|
cssStage: hookContext?.cssStage
|
|
3653
3562
|
});
|
|
3654
3563
|
if (!generated) return;
|
|
3655
|
-
const tracedCss =
|
|
3564
|
+
const tracedCss = require_generated_css_marker.annotateCssSourceTrace(generated.css, {
|
|
3656
3565
|
opts,
|
|
3657
|
-
tokenSources:
|
|
3566
|
+
tokenSources: require_generated_css_marker.isCssSourceTraceEnabled(opts) ? require_generated_css_marker.createCssTokenSourceMap(sourceCandidateCollector.sourcesForEntries(void 0), opts) : void 0
|
|
3658
3567
|
});
|
|
3659
3568
|
generatedCssByFile.set(file, tracedCss);
|
|
3660
3569
|
processedCssRegistry.record(file, tracedCss, {
|
|
@@ -3664,7 +3573,7 @@ function createCssOnlyVitePlugins(options = {}) {
|
|
|
3664
3573
|
processedCssRegistry.markSource(file);
|
|
3665
3574
|
recordedCandidates = new Set(runtime);
|
|
3666
3575
|
for (const dependency of generated.dependencies) hookContext?.addWatchFile?.(dependency);
|
|
3667
|
-
return `${
|
|
3576
|
+
return `${(0, _weapp_tailwindcss_postcss_transform.createBundlerGeneratedCssMarker)("vite", file)}\n${tracedCss}`;
|
|
3668
3577
|
});
|
|
3669
3578
|
const rewritePlugins = createRewriteCssImportsPlugins({
|
|
3670
3579
|
getAppType: () => void 0,
|
|
@@ -3777,9 +3686,9 @@ function createFrameworkSourceCandidatesPluginForCssOnly(options) {
|
|
|
3777
3686
|
name: `${require_compiler.vitePluginName}:source-candidates`,
|
|
3778
3687
|
enforce: "pre",
|
|
3779
3688
|
async transform(code, id) {
|
|
3780
|
-
if (!options.sourceCandidateCollector || !
|
|
3689
|
+
if (!options.sourceCandidateCollector || !require_generated_css_marker.isSourceCandidateRequest(id)) return;
|
|
3781
3690
|
options.cssMemory.rememberKnownSfcSource(id, code);
|
|
3782
|
-
if (isCSSRequest(id) &&
|
|
3691
|
+
if (isCSSRequest(id) && (0, _weapp_tailwindcss_postcss_transform.hasUserCssLayerBlocks)(code)) options.rememberTailwindRootCssModule(id);
|
|
3783
3692
|
await options.sourceCandidateCollector.merge(id, code);
|
|
3784
3693
|
},
|
|
3785
3694
|
async watchChange(id) {
|
|
@@ -4092,12 +4001,6 @@ Object.defineProperty(exports, "hasMatchingStyleFileBase", {
|
|
|
4092
4001
|
return hasMatchingStyleFileBase;
|
|
4093
4002
|
}
|
|
4094
4003
|
});
|
|
4095
|
-
Object.defineProperty(exports, "hasNonCommentCss", {
|
|
4096
|
-
enumerable: true,
|
|
4097
|
-
get: function() {
|
|
4098
|
-
return hasNonCommentCss;
|
|
4099
|
-
}
|
|
4100
|
-
});
|
|
4101
4004
|
Object.defineProperty(exports, "hasSelfAcceptingNonStyleHotModule", {
|
|
4102
4005
|
enumerable: true,
|
|
4103
4006
|
get: function() {
|
|
@@ -4182,12 +4085,6 @@ Object.defineProperty(exports, "isSfcStyleSourceFile", {
|
|
|
4182
4085
|
return isSfcStyleSourceFile;
|
|
4183
4086
|
}
|
|
4184
4087
|
});
|
|
4185
|
-
Object.defineProperty(exports, "isStyleImportRequest", {
|
|
4186
|
-
enumerable: true,
|
|
4187
|
-
get: function() {
|
|
4188
|
-
return isStyleImportRequest;
|
|
4189
|
-
}
|
|
4190
|
-
});
|
|
4191
4088
|
Object.defineProperty(exports, "mergeHotModulesByIdentity", {
|
|
4192
4089
|
enumerable: true,
|
|
4193
4090
|
get: function() {
|
|
@@ -4272,12 +4169,6 @@ Object.defineProperty(exports, "removeDuplicateUnlinkedRootCssAssetsReferencedBy
|
|
|
4272
4169
|
return removeDuplicateUnlinkedRootCssAssetsReferencedByHtml;
|
|
4273
4170
|
}
|
|
4274
4171
|
});
|
|
4275
|
-
Object.defineProperty(exports, "removeTailwindEntryDirectivesFromCss", {
|
|
4276
|
-
enumerable: true,
|
|
4277
|
-
get: function() {
|
|
4278
|
-
return removeTailwindEntryDirectivesFromCss;
|
|
4279
|
-
}
|
|
4280
|
-
});
|
|
4281
4172
|
Object.defineProperty(exports, "resolveHotSourceModules", {
|
|
4282
4173
|
enumerable: true,
|
|
4283
4174
|
get: function() {
|