weapp-tailwindcss 5.0.5 → 5.0.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.
Files changed (103) hide show
  1. package/dist/{bundle-state-Cso_ceUo.js → bundle-state-BzwPS-UI.js} +2 -1
  2. package/dist/{bundle-state-DEyxCR4f.mjs → bundle-state-ChcOKb9w.mjs} +2 -1
  3. package/dist/bundlers/gulp/index.d.ts +3 -4
  4. package/dist/bundlers/gulp/module-graph.d.ts +2 -0
  5. package/dist/bundlers/gulp/runtime-snapshot.d.ts +5 -0
  6. package/dist/bundlers/gulp/vinyl-transform.d.ts +3 -0
  7. package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
  8. package/dist/bundlers/shared/css-source-trace.d.ts +20 -0
  9. package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +11 -0
  10. package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +56 -0
  11. package/dist/bundlers/shared/generator-css/local-imports.d.ts +7 -0
  12. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -1
  13. package/dist/bundlers/shared/generator-css/types.d.ts +27 -0
  14. package/dist/bundlers/shared/generator-css/user-css.d.ts +26 -0
  15. package/dist/bundlers/shared/generator-css/validate.d.ts +5 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +4 -32
  17. package/dist/bundlers/vite/css-finalizer.d.ts +3 -0
  18. package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +2 -0
  19. package/dist/bundlers/vite/generate-bundle/css-output.d.ts +14 -0
  20. package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +11 -0
  21. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +9 -0
  22. package/dist/bundlers/vite/generate-bundle/style-matching.d.ts +5 -0
  23. package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +7 -0
  24. package/dist/bundlers/vite/generate-bundle/types.d.ts +68 -0
  25. package/dist/bundlers/vite/generate-bundle.d.ts +4 -62
  26. package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +4 -0
  27. package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +2 -0
  28. package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +13 -0
  29. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +1 -0
  30. package/dist/bundlers/vite/processed-css-assets/css-rules.d.ts +17 -0
  31. package/dist/bundlers/vite/processed-css-assets.d.ts +2 -0
  32. package/dist/bundlers/vite/source-candidates/scan-root.d.ts +10 -0
  33. package/dist/bundlers/vite/source-candidates/script.d.ts +7 -0
  34. package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +1 -0
  35. package/dist/bundlers/vite/source-candidates.d.ts +8 -3
  36. package/dist/bundlers/vite/source-scan/css-entries.d.ts +20 -0
  37. package/dist/bundlers/vite/source-scan/dependencies.d.ts +2 -0
  38. package/dist/bundlers/vite/source-scan.d.ts +2 -12
  39. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -0
  40. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -20
  41. package/dist/cli.js +69 -69
  42. package/dist/cli.mjs +69 -69
  43. package/dist/core.js +1 -1
  44. package/dist/core.mjs +1 -1
  45. package/dist/{defaults-BPUuNYcD.js → defaults-Boc26eel.js} +1 -0
  46. package/dist/{defaults-8xrgzxFY.mjs → defaults-DH0ZQRhy.mjs} +1 -0
  47. package/dist/defaults.js +1 -1
  48. package/dist/defaults.mjs +1 -1
  49. package/dist/{generator-AD-eX8Tr.js → generator-6yF8wjxR.js} +1 -1
  50. package/dist/{generator-DVWLNO0n.mjs → generator-BON6M1bL.mjs} +1 -1
  51. package/dist/generator.js +2 -2
  52. package/dist/generator.mjs +2 -2
  53. package/dist/gulp-_7p1Z2vc.js +473 -0
  54. package/dist/gulp-oE-Byqk6.mjs +463 -0
  55. package/dist/gulp.js +4 -414
  56. package/dist/gulp.mjs +1 -406
  57. package/dist/{incremental-runtime-class-set-vOetpdWs.js → hmr-timing-BKQNRxHr.js} +1257 -459
  58. package/dist/{incremental-runtime-class-set-xf49kky6.mjs → hmr-timing-BVTGf5ch.mjs} +1221 -477
  59. package/dist/index.js +5 -5
  60. package/dist/index.mjs +5 -5
  61. package/dist/{postcss-Cbi6RFpf.js → postcss-BTIunhWl.js} +7 -7
  62. package/dist/{postcss-hSUxK7oR.mjs → postcss-BtmrrZ31.mjs} +4 -4
  63. package/dist/postcss.js +1 -1
  64. package/dist/postcss.mjs +1 -1
  65. package/dist/{precheck-Bsn_LMmo.mjs → precheck-CZjr87m_.mjs} +19 -5
  66. package/dist/{precheck-b8Y8qZg0.js → precheck-fhIkzCSU.js} +19 -5
  67. package/dist/presets.js +2 -2
  68. package/dist/presets.mjs +2 -2
  69. package/dist/tailwindcss/source-scan/inline-source.d.ts +7 -0
  70. package/dist/tailwindcss/source-scan.d.ts +2 -7
  71. package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +3 -0
  72. package/dist/tailwindcss/v3-engine/generator/content.d.ts +10 -0
  73. package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +2 -0
  74. package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +2 -0
  75. package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +6 -0
  76. package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -0
  77. package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
  78. package/dist/{tailwindcss-AWaPVF2B.mjs → tailwindcss-bbQUg25J.mjs} +2 -2
  79. package/dist/{tailwindcss-CpQ6X4l6.js → tailwindcss-vswd1gc3.js} +2 -2
  80. package/dist/{transform-BkGtbxb1.js → transform-CReJxxh_.js} +11 -2
  81. package/dist/{transform-DumSZmTh.mjs → transform-DEsFlG9k.mjs} +11 -2
  82. package/dist/types/typedoc-tailwindcss-patch.d.ts +4 -2
  83. package/dist/types/user-defined-options/general.d.ts +5 -0
  84. package/dist/uni-app-x/component-local-style.d.ts +1 -0
  85. package/dist/uni-app-x/harmony.d.ts +1 -0
  86. package/dist/uni-app-x/style-asset/style-value.d.ts +16 -0
  87. package/dist/uni-app-x/style-asset.d.ts +20 -0
  88. package/dist/uni-app-x/transform.d.ts +1 -0
  89. package/dist/uni-app-x/vite.d.ts +1 -0
  90. package/dist/{v3-engine-CM0TRa8V.js → v3-engine-CEMXFegG.js} +714 -663
  91. package/dist/{v3-engine-Cczrkzqt.mjs → v3-engine-CdIwmHuc.mjs} +758 -707
  92. package/dist/{vite-CTuHPC91.js → vite-0jFbh9hx.js} +1797 -386
  93. package/dist/{vite-DLXDMHON.mjs → vite-C7BGAlCE.mjs} +1779 -369
  94. package/dist/vite.js +1 -1
  95. package/dist/vite.mjs +1 -1
  96. package/dist/weapp-tw-css-import-rewrite-loader.js +1169 -1002
  97. package/dist/{webpack-DJFw08SK.mjs → webpack-Dx6_eg5k.mjs} +96 -36
  98. package/dist/{webpack-BBHJYKqB.js → webpack-aEuDoYfQ.js} +105 -44
  99. package/dist/webpack.js +1 -1
  100. package/dist/webpack.mjs +1 -1
  101. package/package.json +6 -5
  102. package/dist/source-candidates-BsWYoIPN.mjs +0 -355
  103. package/dist/source-candidates-o2ZrKWzu.js +0 -374
@@ -1,19 +1,182 @@
1
1
  import { a as transformCssMacroCss, n as hasCssMacroTailwindPlugin, o as withCssMacroStyleOptions, r as hasCssMacroTailwindV4Directive, t as hasCssMacroStyleOptions } from "./auto-DEHRmEAx.mjs";
2
2
  import { createRequire } from "node:module";
3
- import fs, { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
4
3
  import postcss from "postcss";
5
4
  import { TailwindcssPatcher, createTailwindV4Engine, extractRawCandidates, extractSourceCandidates, isBareArbitraryValuesEnabled, loadTailwindV4DesignSystem, resolveBareArbitraryValueCandidate, resolveProjectSourceFiles, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions } from "tailwindcss-patch";
6
5
  import process from "node:process";
6
+ import fs, { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
7
7
  import path from "node:path";
8
8
  import { logger } from "@weapp-tailwindcss/logger";
9
9
  import { defuOverrideArray } from "@weapp-tailwindcss/shared";
10
10
  import { fileURLToPath } from "node:url";
11
11
  import _createDebug from "debug";
12
12
  import { stat } from "node:fs/promises";
13
- import fg from "fast-glob";
14
- import { loadConfig } from "tailwindcss-config";
15
13
  import micromatch from "micromatch";
16
14
  import { createStyleHandler, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss } from "@weapp-tailwindcss/postcss";
15
+ import fg from "fast-glob";
16
+ import { loadConfig } from "tailwindcss-config";
17
+ //#region src/utils/object.ts
18
+ function definedEntries(value) {
19
+ return Object.entries(value).filter(([, item]) => item !== void 0);
20
+ }
21
+ function omitUndefined(value) {
22
+ return Object.fromEntries(definedEntries(value));
23
+ }
24
+ //#endregion
25
+ //#region src/tailwindcss/v3-engine/generator/content.ts
26
+ function isLegacyContentObject$1(value) {
27
+ return typeof value === "object" && value !== null && "files" in value;
28
+ }
29
+ function createRawContentEntries(candidates, sources) {
30
+ const entries = [];
31
+ const candidateContent = [...candidates].join(" ");
32
+ if (candidateContent.length > 0) entries.push({
33
+ raw: candidateContent,
34
+ extension: "html"
35
+ });
36
+ for (const source of sources) entries.push({
37
+ raw: source.content,
38
+ extension: source.extension ?? "html"
39
+ });
40
+ return entries;
41
+ }
42
+ function createChangedContentEntries(candidates, sources) {
43
+ return createRawContentEntries(candidates, sources).map((entry) => ({
44
+ content: entry.raw,
45
+ extension: entry.extension
46
+ }));
47
+ }
48
+ function collectCandidates$1(candidates) {
49
+ return new Set(candidates ?? []);
50
+ }
51
+ function collectApplyCandidatesFromCss(css) {
52
+ if (!css.includes("@apply")) return [];
53
+ const candidates = /* @__PURE__ */ new Set();
54
+ try {
55
+ postcss.parse(css).walkAtRules("apply", (rule) => {
56
+ for (const candidate of rule.params.split(/\s+/)) {
57
+ const normalized = candidate.replace(/!important$/, "").trim();
58
+ if (normalized) candidates.add(normalized);
59
+ }
60
+ });
61
+ } catch {}
62
+ return [...candidates];
63
+ }
64
+ function isTailwindCandidateLayer(params) {
65
+ return params.split(/[,\s]+/).some((layer) => layer === "components" || layer === "utilities");
66
+ }
67
+ function extractClassCandidatesFromSelector(selector, candidates) {
68
+ for (let index = 0; index < selector.length; index++) {
69
+ if (selector[index] !== ".") continue;
70
+ let candidate = "";
71
+ let escaped = false;
72
+ for (let tokenIndex = index + 1; tokenIndex < selector.length; tokenIndex++) {
73
+ const char = selector[tokenIndex];
74
+ if (escaped) {
75
+ candidate += char;
76
+ escaped = false;
77
+ continue;
78
+ }
79
+ if (char === "\\") {
80
+ escaped = true;
81
+ continue;
82
+ }
83
+ if (char && /[\w-]/.test(char)) {
84
+ candidate += char;
85
+ continue;
86
+ }
87
+ break;
88
+ }
89
+ if (candidate) candidates.add(candidate);
90
+ }
91
+ }
92
+ function collectLayerCandidatesFromCss(css) {
93
+ if (!css.includes("@layer")) return [];
94
+ const candidates = /* @__PURE__ */ new Set();
95
+ try {
96
+ postcss.parse(css).walkAtRules("layer", (layer) => {
97
+ if (!isTailwindCandidateLayer(layer.params)) return;
98
+ layer.walkRules((rule) => {
99
+ extractClassCandidatesFromSelector(rule.selector, candidates);
100
+ });
101
+ });
102
+ } catch {}
103
+ return [...candidates];
104
+ }
105
+ function mergeGenerateCandidates(source, options) {
106
+ return collectCandidates$1([
107
+ ...collectLayerCandidatesFromCss(source.css),
108
+ ...collectApplyCandidatesFromCss(source.css),
109
+ ...collectCandidates$1(options.candidates)
110
+ ]);
111
+ }
112
+ function mergeContent(content, rawEntries) {
113
+ if (isLegacyContentObject$1(content)) return {
114
+ ...content,
115
+ relative: content.relative ?? true,
116
+ files: [...[].concat(content.files ?? []), ...rawEntries]
117
+ };
118
+ return {
119
+ relative: true,
120
+ files: [...[].concat(content ?? []), ...rawEntries]
121
+ };
122
+ }
123
+ function normalizeConfigObject(config) {
124
+ if (!config || typeof config !== "object") return config;
125
+ const maybeDefault = config.default;
126
+ if (maybeDefault && typeof maybeDefault === "object") return maybeDefault;
127
+ return config;
128
+ }
129
+ function hasExplicitContentInput(options) {
130
+ return options.candidates !== void 0 || options.sources !== void 0;
131
+ }
132
+ function createExplicitContentConfig(rawEntries) {
133
+ return {
134
+ relative: true,
135
+ files: rawEntries
136
+ };
137
+ }
138
+ function createTailwindConfig(source, options) {
139
+ const config = { ...normalizeConfigObject(source.configObject) ?? {} };
140
+ const rawEntries = createRawContentEntries(mergeGenerateCandidates(source, options), options.sources ?? []);
141
+ config.content = hasExplicitContentInput(options) ? createExplicitContentConfig(rawEntries) : mergeContent(config.content, rawEntries);
142
+ return config;
143
+ }
144
+ //#endregion
145
+ //#region src/tailwindcss/v3-engine/generator/cache-key.ts
146
+ function createStableJson$1(value) {
147
+ if (value === void 0) return "undefined";
148
+ if (value === null || typeof value !== "object") return JSON.stringify(value);
149
+ if (Array.isArray(value)) return `[${value.map((item) => createStableJson$1(item)).join(",")}]`;
150
+ return `{${Object.keys(value).sort().map((key) => {
151
+ const record = value;
152
+ return `${JSON.stringify(key)}:${createStableJson$1(record[key])}`;
153
+ }).join(",")}}`;
154
+ }
155
+ function createDependencyFingerprint$1(files) {
156
+ return files.map((file) => {
157
+ try {
158
+ const stat = fs.statSync(file);
159
+ return `${file}:${stat.size}:${stat.mtimeMs}`;
160
+ } catch {
161
+ return `${file}:missing`;
162
+ }
163
+ }).join("|");
164
+ }
165
+ function createIncrementalGenerateCacheKey$1(source, target, styleOptions, bareArbitraryValues) {
166
+ return [
167
+ source.packageName,
168
+ source.postcssPlugin,
169
+ source.cwd,
170
+ source.config ?? "config:missing",
171
+ createDependencyFingerprint$1(source.dependencies),
172
+ source.css,
173
+ createStableJson$1(normalizeConfigObject(source.configObject)?.content),
174
+ target,
175
+ createStableJson$1(styleOptions),
176
+ createStableJson$1(bareArbitraryValues)
177
+ ].join("\0");
178
+ }
179
+ //#endregion
17
180
  //#region src/context/workspace.ts
18
181
  const IGNORED_WORKSPACE_DIRS = new Set([
19
182
  "node_modules",
@@ -73,14 +236,6 @@ function findWorkspacePackageDir(rootDir, packageName) {
73
236
  }
74
237
  }
75
238
  //#endregion
76
- //#region src/utils/object.ts
77
- function definedEntries(value) {
78
- return Object.entries(value).filter(([, item]) => item !== void 0);
79
- }
80
- function omitUndefined(value) {
81
- return Object.fromEntries(definedEntries(value));
82
- }
83
- //#endregion
84
239
  //#region src/utils/options.ts
85
240
  function resolveBooleanObjectOption(value, enabledValue) {
86
241
  if (!value) return false;
@@ -303,7 +458,7 @@ function createTailwindcssPatcher(options) {
303
458
  const resolvedTailwindOptions = resolvedOptions.tailwindcss;
304
459
  if (resolvedTailwindOptions) {
305
460
  const existingResolve = resolvedTailwindOptions.resolve ?? {};
306
- const sourcePaths = Array.isArray(existingResolve.paths) && existingResolve.paths.length > 0 ? [...existingResolve.paths, ...resolvePaths] : resolvePaths;
461
+ const sourcePaths = Array.isArray(existingResolve.paths) && existingResolve.paths.length > 0 ? [...existingResolve.paths ?? [], ...resolvePaths] : resolvePaths;
307
462
  resolvedTailwindOptions.resolve = {
308
463
  ...existingResolve,
309
464
  paths: [...new Set(sourcePaths)]
@@ -365,140 +520,8 @@ function createDebug(prefix) {
365
520
  return debug;
366
521
  }
367
522
  //#endregion
368
- //#region src/tailwindcss/source-scan.ts
369
- const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
370
- "html",
371
- "wxml",
372
- "axml",
373
- "jxml",
374
- "ksml",
375
- "ttml",
376
- "qml",
377
- "tyml",
378
- "xhsml",
379
- "swan",
380
- "vue",
381
- "mpx",
382
- "js",
383
- "jsx",
384
- "ts",
385
- "tsx"
386
- ];
387
- const FULL_SOURCE_SCAN_EXTENSIONS = [
388
- "js",
389
- "jsx",
390
- "mjs",
391
- "cjs",
392
- "ts",
393
- "tsx",
394
- "mts",
395
- "cts",
396
- "vue",
397
- "uvue",
398
- "nvue",
399
- "svelte",
400
- "mpx",
401
- "html",
402
- "wxml",
403
- "axml",
404
- "jxml",
405
- "ksml",
406
- "ttml",
407
- "qml",
408
- "tyml",
409
- "xhsml",
410
- "swan",
411
- "css",
412
- "wxss",
413
- "acss",
414
- "jxss",
415
- "ttss",
416
- "qss",
417
- "tyss",
418
- "scss",
419
- "sass",
420
- "less",
421
- "styl",
422
- "stylus"
423
- ];
424
- function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
425
- return `**/*.{${extensions.join(",")}}`;
426
- }
427
- const FULL_SOURCE_SCAN_PATTERN = createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
428
- const FULL_SOURCE_SCAN_EXTENSION_RE = new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
429
- function toPosixPath(value) {
430
- return value.split(path.sep).join("/");
431
- }
432
- function resolveSourceScanPath(value) {
433
- const resolved = path.resolve(value);
434
- try {
435
- return realpathSync.native(resolved);
436
- } catch {
437
- return resolved;
438
- }
439
- }
440
- function normalizeEntryPattern(entry) {
441
- return path.isAbsolute(entry.pattern) ? toPosixPath(path.relative(resolveSourceScanPath(entry.base), entry.pattern)) : entry.pattern;
442
- }
443
- function isFileMatchedByTailwindSourceEntry(file, entry) {
444
- const relative = toPosixPath(path.relative(resolveSourceScanPath(entry.base), file));
445
- return relative && !relative.startsWith("../") && !path.isAbsolute(relative) && micromatch.isMatch(relative, normalizeEntryPattern(entry));
446
- }
447
- function isFileExcludedByTailwindSourceEntries(file, entries) {
448
- if (!entries?.length) return false;
449
- const resolvedFile = resolveSourceScanPath(file);
450
- return entries.some((entry) => entry.negated && isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
451
- }
452
- function isFileMatchedByTailwindSourceEntries(file, entries) {
453
- if (!entries?.length) return true;
454
- const positiveEntries = entries.filter((entry) => !entry.negated);
455
- const negativeEntries = entries.filter((entry) => entry.negated);
456
- const resolvedFile = resolveSourceScanPath(file);
457
- if (positiveEntries.length === 0) return !negativeEntries.some((entry) => isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
458
- if (!positiveEntries.some((entry) => isFileMatchedByTailwindSourceEntry(resolvedFile, entry))) return false;
459
- return !negativeEntries.some((entry) => isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
460
- }
461
- function createTailwindSourceEntryMatcher(entries) {
462
- if (!entries?.length) return;
463
- return (file) => isFileMatchedByTailwindSourceEntries(file, entries);
464
- }
465
- function resolveTailwindV4CssSourceBase(source, fallbackBase) {
466
- if (typeof source.base === "string" && source.base.length > 0) return source.base;
467
- if (typeof source.file === "string" && source.file.length > 0) return path.dirname(source.file);
468
- return fallbackBase;
469
- }
523
+ //#region src/tailwindcss/source-scan/inline-source.ts
470
524
  const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
471
- function parseConfigParam$1(params) {
472
- const value = params.trim();
473
- return /^(['"])(.+)\1$/.exec(value)?.[2];
474
- }
475
- function isLegacyContentObject$1(value) {
476
- return typeof value === "object" && value !== null && "files" in value;
477
- }
478
- function normalizeGlobPattern(pattern) {
479
- return pattern.startsWith("./") ? pattern.slice(2) : pattern;
480
- }
481
- function hasGlobMagic(value) {
482
- return /[*?[\]{}()!+@]/.test(value);
483
- }
484
- function splitStaticGlobPrefix(pattern) {
485
- const segments = normalizeGlobPattern(pattern).split(/[\\/]+/);
486
- const prefix = [];
487
- const rest = [];
488
- let reachedGlob = false;
489
- for (const segment of segments) {
490
- if (!reachedGlob && segment && !hasGlobMagic(segment)) {
491
- prefix.push(segment);
492
- continue;
493
- }
494
- reachedGlob = true;
495
- rest.push(segment);
496
- }
497
- return {
498
- prefix,
499
- rest
500
- };
501
- }
502
525
  function segmentTopLevel(input, separator, options = {}) {
503
526
  const parts = [];
504
527
  const stack = [];
@@ -625,6 +648,140 @@ function collectCssInlineSourceCandidates(root) {
625
648
  excluded
626
649
  };
627
650
  }
651
+ //#endregion
652
+ //#region src/tailwindcss/source-scan.ts
653
+ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
654
+ "html",
655
+ "wxml",
656
+ "axml",
657
+ "jxml",
658
+ "ksml",
659
+ "ttml",
660
+ "qml",
661
+ "tyml",
662
+ "xhsml",
663
+ "swan",
664
+ "vue",
665
+ "mpx",
666
+ "js",
667
+ "jsx",
668
+ "ts",
669
+ "tsx"
670
+ ];
671
+ const FULL_SOURCE_SCAN_EXTENSIONS = [
672
+ "js",
673
+ "jsx",
674
+ "mjs",
675
+ "cjs",
676
+ "ts",
677
+ "tsx",
678
+ "mts",
679
+ "cts",
680
+ "vue",
681
+ "uvue",
682
+ "nvue",
683
+ "svelte",
684
+ "mpx",
685
+ "html",
686
+ "wxml",
687
+ "axml",
688
+ "jxml",
689
+ "ksml",
690
+ "ttml",
691
+ "qml",
692
+ "tyml",
693
+ "xhsml",
694
+ "swan",
695
+ "css",
696
+ "wxss",
697
+ "acss",
698
+ "jxss",
699
+ "ttss",
700
+ "qss",
701
+ "tyss",
702
+ "scss",
703
+ "sass",
704
+ "less",
705
+ "styl",
706
+ "stylus"
707
+ ];
708
+ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
709
+ return `**/*.{${extensions.join(",")}}`;
710
+ }
711
+ const FULL_SOURCE_SCAN_PATTERN = createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
712
+ const FULL_SOURCE_SCAN_EXTENSION_RE = new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
713
+ function toPosixPath(value) {
714
+ return value.split(path.sep).join("/");
715
+ }
716
+ function resolveSourceScanPath(value) {
717
+ const resolved = path.resolve(value);
718
+ try {
719
+ return realpathSync.native(resolved);
720
+ } catch {
721
+ return resolved;
722
+ }
723
+ }
724
+ function normalizeEntryPattern(entry) {
725
+ return path.isAbsolute(entry.pattern) ? toPosixPath(path.relative(resolveSourceScanPath(entry.base), entry.pattern)) : entry.pattern;
726
+ }
727
+ function isFileMatchedByTailwindSourceEntry(file, entry) {
728
+ const relative = toPosixPath(path.relative(resolveSourceScanPath(entry.base), file));
729
+ return relative && !relative.startsWith("../") && !path.isAbsolute(relative) && micromatch.isMatch(relative, normalizeEntryPattern(entry));
730
+ }
731
+ function isFileExcludedByTailwindSourceEntries(file, entries) {
732
+ if (!entries?.length) return false;
733
+ const resolvedFile = resolveSourceScanPath(file);
734
+ return entries.some((entry) => entry.negated && isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
735
+ }
736
+ function isFileMatchedByTailwindSourceEntries(file, entries) {
737
+ if (!entries?.length) return true;
738
+ const positiveEntries = entries.filter((entry) => !entry.negated);
739
+ const negativeEntries = entries.filter((entry) => entry.negated);
740
+ const resolvedFile = resolveSourceScanPath(file);
741
+ if (positiveEntries.length === 0) return !negativeEntries.some((entry) => isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
742
+ if (!positiveEntries.some((entry) => isFileMatchedByTailwindSourceEntry(resolvedFile, entry))) return false;
743
+ return !negativeEntries.some((entry) => isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
744
+ }
745
+ function createTailwindSourceEntryMatcher(entries) {
746
+ if (!entries?.length) return;
747
+ return (file) => isFileMatchedByTailwindSourceEntries(file, entries);
748
+ }
749
+ function resolveTailwindV4CssSourceBase(source, fallbackBase) {
750
+ if (typeof source.base === "string" && source.base.length > 0) return source.base;
751
+ if (typeof source.file === "string" && source.file.length > 0) return path.dirname(source.file);
752
+ return fallbackBase;
753
+ }
754
+ function parseConfigParam$1(params) {
755
+ const value = params.trim();
756
+ return /^(['"])(.+)\1$/.exec(value)?.[2];
757
+ }
758
+ function isLegacyContentObject(value) {
759
+ return typeof value === "object" && value !== null && "files" in value;
760
+ }
761
+ function normalizeGlobPattern(pattern) {
762
+ return pattern.startsWith("./") ? pattern.slice(2) : pattern;
763
+ }
764
+ function hasGlobMagic(value) {
765
+ return /[*?[\]{}()!+@]/.test(value);
766
+ }
767
+ function splitStaticGlobPrefix(pattern) {
768
+ const segments = normalizeGlobPattern(pattern).split(/[\\/]+/);
769
+ const prefix = [];
770
+ const rest = [];
771
+ let reachedGlob = false;
772
+ for (const segment of segments) {
773
+ if (!reachedGlob && segment && !hasGlobMagic(segment)) {
774
+ prefix.push(segment);
775
+ continue;
776
+ }
777
+ reachedGlob = true;
778
+ rest.push(segment);
779
+ }
780
+ return {
781
+ prefix,
782
+ rest
783
+ };
784
+ }
628
785
  function normalizeLegacyContentEntries(content, base, options = {}) {
629
786
  if (typeof content === "string") {
630
787
  const negated = content.startsWith("!");
@@ -635,7 +792,7 @@ function normalizeLegacyContentEntries(content, base, options = {}) {
635
792
  }];
636
793
  }
637
794
  if (Array.isArray(content)) return content.flatMap((item) => normalizeLegacyContentEntries(item, base, options));
638
- if (isLegacyContentObject$1(content)) return normalizeLegacyContentEntries(content.files, content.relative && options.relativeBase ? options.relativeBase : base, options);
795
+ if (isLegacyContentObject(content)) return normalizeLegacyContentEntries(content.files, content.relative && options.relativeBase ? options.relativeBase : base, options);
639
796
  return [];
640
797
  }
641
798
  async function pathExistsAsDirectory(file) {
@@ -731,40 +888,6 @@ function filterUnsupportedMiniProgramTailwindV4Candidates(candidates) {
731
888
  return new Set([...candidates].filter((candidate) => !isUnsupportedMiniProgramTailwindV4Candidate(candidate)));
732
889
  }
733
890
  //#endregion
734
- //#region src/tailwindcss/v4-engine/miniprogram.ts
735
- const defaultStyleHandler$1 = createStyleHandler({
736
- cssChildCombinatorReplaceValue: ["view", "text"],
737
- cssRemoveHoverPseudoClass: true,
738
- isMainChunk: true,
739
- majorVersion: 4
740
- });
741
- const CSS_DECLARATION_URL_RE = /(:\s*)url\(([^\n\r"';[\]{}]*[[\]{}][^\n\r;]*)\)(?=\s*;)/g;
742
- function normalizeTailwindV4GeneratedUrlValues(css) {
743
- return css.replace(CSS_DECLARATION_URL_RE, (match, prefix, urlValue) => {
744
- try {
745
- return `${prefix}url("${urlValue.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}")`;
746
- } catch {
747
- return match;
748
- }
749
- });
750
- }
751
- async function transformTailwindV4CssToWeapp(css, options) {
752
- const protectedCss = protectDynamicColorMixAlpha(normalizeTailwindV4GeneratedUrlValues(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
753
- const result = await defaultStyleHandler$1(protectedCss.css, {
754
- cssChildCombinatorReplaceValue: ["view", "text"],
755
- cssRemoveHoverPseudoClass: true,
756
- isMainChunk: true,
757
- majorVersion: 4,
758
- ...options
759
- });
760
- const pruneOptions = { preserveConditionalComments: hasCssMacroStyleOptions(options) };
761
- return pruneMiniProgramGeneratedCss(protectedCss.restore(result.css), pruneOptions);
762
- }
763
- async function transformTailwindV4CssByTarget(css, target, options) {
764
- if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
765
- return hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css;
766
- }
767
- //#endregion
768
891
  //#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
769
892
  const TAILWIND_V3_COLOR_STEPS = [
770
893
  "50",
@@ -1496,40 +1619,7 @@ function createTailwindV4DefaultColorThemeCss() {
1496
1619
  ].join("\n");
1497
1620
  }
1498
1621
  //#endregion
1499
- //#region src/tailwindcss/v4-engine/generator.ts
1500
- const incrementalGenerateCache$1 = /* @__PURE__ */ new Map();
1501
- const incrementalGenerateTaskCache = /* @__PURE__ */ new Map();
1502
- const BARE_RPX_TEXT_CANDIDATE_RE = /(^|:)text-\[([-+]?(?:\d+|\d*\.\d+)rpx)\](.*)$/u;
1503
- const RPX_TEXT_LENGTH_SELECTOR_RE = /text-\\\[length\\:((?:\\[.+-]|[+\-.\d])+rpx)\\\]/g;
1504
- const TAILWIND_V4_DEFAULT_IGNORED_SOURCE_PATTERNS = [
1505
- "**/.git/**",
1506
- "**/.hg/**",
1507
- "**/.jj/**",
1508
- "**/.next/**",
1509
- "**/.parcel-cache/**",
1510
- "**/.pnpm-store/**",
1511
- "**/.svelte-kit/**",
1512
- "**/.svn/**",
1513
- "**/.turbo/**",
1514
- "**/.venv/**",
1515
- "**/.vercel/**",
1516
- "**/.yarn/**",
1517
- "**/__pycache__/**",
1518
- "**/node_modules/**",
1519
- "**/venv/**",
1520
- "**/*.less",
1521
- "**/*.lock",
1522
- "**/*.sass",
1523
- "**/*.scss",
1524
- "**/*.styl",
1525
- "**/*.log",
1526
- "**/package-lock.json",
1527
- "**/pnpm-lock.yaml",
1528
- "**/bun.lockb",
1529
- "**/.gitignore",
1530
- "**/.env",
1531
- "**/.env.*"
1532
- ];
1622
+ //#region src/tailwindcss/v4-engine/generator/css-compat.ts
1533
1623
  function findLeadingImportInsertionIndex(css) {
1534
1624
  const importPattern = /(?:^|\n)\s*@import\b[^;]*;/g;
1535
1625
  let insertionIndex = 0;
@@ -1546,13 +1636,78 @@ function applyMiniProgramTailwindV4DefaultColorCss(css) {
1546
1636
  if (insertionIndex === 0) return `${themeCss}\n${css}`;
1547
1637
  return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
1548
1638
  }
1549
- function collectCandidates$1(candidates) {
1550
- return new Set(candidates ?? []);
1639
+ function parseCssImportSpecifier$3(params) {
1640
+ const value = params.trim();
1641
+ const quoted = /^(['"])(.*?)\1/.exec(value);
1642
+ if (quoted) return quoted[2];
1643
+ const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
1644
+ return url?.[2] ?? url?.[3];
1551
1645
  }
1552
- function hasRemovedCandidates$1(previousCandidates, nextCandidates) {
1553
- for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
1646
+ function isTailwindCssPreflightImport(params) {
1647
+ const specifier = parseCssImportSpecifier$3(params);
1648
+ return specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss/preflight";
1649
+ }
1650
+ function hasImportLayerOption(params) {
1651
+ return /\blayer(?:\s*\(|\s*$)/.test(params);
1652
+ }
1653
+ function removeUnlayeredTailwindV4PreflightImports(css) {
1654
+ if (!css.includes("preflight")) return css;
1655
+ let root;
1656
+ try {
1657
+ root = postcss.parse(css);
1658
+ } catch {
1659
+ return css;
1660
+ }
1661
+ let changed = false;
1662
+ root.walkAtRules("import", (rule) => {
1663
+ if (isTailwindCssPreflightImport(rule.params) && !hasImportLayerOption(rule.params)) {
1664
+ rule.remove();
1665
+ changed = true;
1666
+ }
1667
+ });
1668
+ return changed ? root.toString() : css;
1669
+ }
1670
+ function hasThemeParent(rule) {
1671
+ let parent = rule.parent;
1672
+ while (parent) {
1673
+ if (parent.type === "atrule" && parent.name === "theme") return true;
1674
+ parent = parent.parent;
1675
+ }
1554
1676
  return false;
1555
1677
  }
1678
+ function isVendorPrefixedKeyframes(rule) {
1679
+ return rule.name.startsWith("-") && rule.name.endsWith("keyframes");
1680
+ }
1681
+ function removeUnsupportedThemeVendorKeyframes(css) {
1682
+ if (!css.includes("@theme") || !css.includes("@-")) return css;
1683
+ let root;
1684
+ try {
1685
+ root = postcss.parse(css);
1686
+ } catch {
1687
+ return css;
1688
+ }
1689
+ let changed = false;
1690
+ root.walkAtRules((rule) => {
1691
+ if (isVendorPrefixedKeyframes(rule) && hasThemeParent(rule)) {
1692
+ rule.remove();
1693
+ changed = true;
1694
+ }
1695
+ });
1696
+ return changed ? root.toString() : css;
1697
+ }
1698
+ function createCompatibleSource(source, target, tailwindcssV3Compatibility) {
1699
+ const shouldApplyTailwindV3Compatibility = tailwindcssV3Compatibility ?? target === "weapp";
1700
+ const filteredSourceCss = target === "weapp" ? removeUnlayeredTailwindV4PreflightImports(source.css) : source.css;
1701
+ const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(shouldApplyTailwindV3Compatibility ? applyTailwindV3CompatibilityCss(filteredSourceCss) : target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss) : filteredSourceCss);
1702
+ return compatibleSourceCss === source.css ? source : {
1703
+ ...source,
1704
+ css: compatibleSourceCss
1705
+ };
1706
+ }
1707
+ //#endregion
1708
+ //#region src/tailwindcss/v4-engine/generator/rpx-candidates.ts
1709
+ const BARE_RPX_TEXT_CANDIDATE_RE = /(^|:)text-\[([-+]?(?:\d+|\d*\.\d+)rpx)\](.*)$/u;
1710
+ const RPX_TEXT_LENGTH_SELECTOR_RE = /text-\\\[length\\:((?:\\[.+-]|[+\-.\d])+rpx)\\\]/g;
1556
1711
  function normalizeRpxTextCandidate(candidate) {
1557
1712
  return candidate.replace(BARE_RPX_TEXT_CANDIDATE_RE, "$1text-[length:$2]$3");
1558
1713
  }
@@ -1585,16 +1740,162 @@ function restoreRpxTextCssSelectors(css, restoreCandidates) {
1585
1740
  return restoredValues.has(normalizeCssEscapedRpxSelectorValue(value)) ? `text-\\[${value}\\]` : match;
1586
1741
  });
1587
1742
  }
1588
- function createStableJson$1(value) {
1743
+ //#endregion
1744
+ //#region src/tailwindcss/v4-engine/generator/scan-sources.ts
1745
+ const TAILWIND_V4_DEFAULT_IGNORED_SOURCE_PATTERNS = [
1746
+ "**/.git/**",
1747
+ "**/.hg/**",
1748
+ "**/.jj/**",
1749
+ "**/.next/**",
1750
+ "**/.parcel-cache/**",
1751
+ "**/.pnpm-store/**",
1752
+ "**/.svelte-kit/**",
1753
+ "**/.svn/**",
1754
+ "**/.turbo/**",
1755
+ "**/.venv/**",
1756
+ "**/.vercel/**",
1757
+ "**/.yarn/**",
1758
+ "**/__pycache__/**",
1759
+ "**/node_modules/**",
1760
+ "**/venv/**",
1761
+ "**/*.less",
1762
+ "**/*.lock",
1763
+ "**/*.sass",
1764
+ "**/*.scss",
1765
+ "**/*.styl",
1766
+ "**/*.log",
1767
+ "**/package-lock.json",
1768
+ "**/pnpm-lock.yaml",
1769
+ "**/bun.lockb",
1770
+ "**/.gitignore",
1771
+ "**/.env",
1772
+ "**/.env.*"
1773
+ ];
1774
+ function parseImportSourceParam$1(params) {
1775
+ const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
1776
+ if (!match) return;
1777
+ return {
1778
+ none: match[1] === "none",
1779
+ sourcePath: match[3]
1780
+ };
1781
+ }
1782
+ function parseCssImportSpecifier$2(params) {
1783
+ const value = params.trim();
1784
+ const quoted = /^(['"])(.*?)\1/.exec(value);
1785
+ if (quoted) return quoted[2];
1786
+ const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
1787
+ return url?.[2] ?? url?.[3];
1788
+ }
1789
+ function isTailwindCssImport$1(params) {
1790
+ const specifier = parseCssImportSpecifier$2(params);
1791
+ return specifier === "tailwindcss" || specifier?.startsWith("tailwindcss/") || specifier?.replaceAll("\\", "/").endsWith("/tailwindcss/index.css");
1792
+ }
1793
+ function resolveSourceBase$1(base, sourcePath) {
1794
+ return path.isAbsolute(sourcePath) ? sourcePath : path.resolve(base, sourcePath);
1795
+ }
1796
+ function createDefaultIgnoredScanSources(base) {
1797
+ return TAILWIND_V4_DEFAULT_IGNORED_SOURCE_PATTERNS.map((pattern) => ({
1798
+ base,
1799
+ pattern,
1800
+ negated: true
1801
+ }));
1802
+ }
1803
+ function normalizeCssDefinedScanSources(base, entries) {
1804
+ return entries.length > 0 && entries.every((entry) => entry.negated) ? [{
1805
+ base,
1806
+ pattern: "**/*",
1807
+ negated: false
1808
+ }, ...entries] : entries;
1809
+ }
1810
+ async function resolveCssDefinedScanSources(source) {
1811
+ let importSourceBase;
1812
+ let hasSourceNone = false;
1813
+ const from = source.dependencies[0];
1814
+ let root;
1815
+ try {
1816
+ root = postcss.parse(source.css, { from });
1817
+ } catch {
1818
+ return;
1819
+ }
1820
+ root.walkAtRules((rule) => {
1821
+ if (rule.name === "import") {
1822
+ if (!isTailwindCssImport$1(rule.params)) return;
1823
+ const sourceParam = parseImportSourceParam$1(rule.params);
1824
+ if (sourceParam?.none) hasSourceNone = true;
1825
+ if (sourceParam?.sourcePath) importSourceBase = resolveSourceBase$1(source.base, sourceParam.sourcePath);
1826
+ }
1827
+ });
1828
+ const sourcePatterns = await resolveCssSourceEntries(root, source.base, "**/*");
1829
+ if (!importSourceBase) {
1830
+ if (sourcePatterns.length > 0) return [...normalizeCssDefinedScanSources(source.base, sourcePatterns), ...createDefaultIgnoredScanSources(source.base)];
1831
+ if (hasSourceNone) return false;
1832
+ return;
1833
+ }
1834
+ return [
1835
+ await resolveTailwindSourceEntry(".", importSourceBase, false, "**/*"),
1836
+ ...sourcePatterns,
1837
+ ...createDefaultIgnoredScanSources(importSourceBase)
1838
+ ];
1839
+ }
1840
+ async function resolveScanSources(source, scanSources) {
1841
+ if (scanSources !== true) return scanSources;
1842
+ return await resolveCssDefinedScanSources(source) ?? false;
1843
+ }
1844
+ //#endregion
1845
+ //#region src/tailwindcss/v4-engine/miniprogram.ts
1846
+ const defaultStyleHandler$1 = createStyleHandler({
1847
+ cssChildCombinatorReplaceValue: ["view", "text"],
1848
+ cssRemoveHoverPseudoClass: true,
1849
+ isMainChunk: true,
1850
+ majorVersion: 4
1851
+ });
1852
+ const CSS_DECLARATION_URL_RE = /(:\s*)url\(([^\n\r"';[\]{}]*[[\]{}][^\n\r;]*)\)(?=\s*;)/g;
1853
+ function normalizeTailwindV4GeneratedUrlValues(css) {
1854
+ return css.replace(CSS_DECLARATION_URL_RE, (match, prefix, urlValue) => {
1855
+ try {
1856
+ return `${prefix}url("${urlValue.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}")`;
1857
+ } catch {
1858
+ return match;
1859
+ }
1860
+ });
1861
+ }
1862
+ async function transformTailwindV4CssToWeapp(css, options) {
1863
+ const protectedCss = protectDynamicColorMixAlpha(normalizeTailwindV4GeneratedUrlValues(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
1864
+ const result = await defaultStyleHandler$1(protectedCss.css, {
1865
+ cssChildCombinatorReplaceValue: ["view", "text"],
1866
+ cssRemoveHoverPseudoClass: true,
1867
+ isMainChunk: true,
1868
+ majorVersion: 4,
1869
+ ...options
1870
+ });
1871
+ const pruneOptions = { preserveConditionalComments: hasCssMacroStyleOptions(options) };
1872
+ return pruneMiniProgramGeneratedCss(protectedCss.restore(result.css), pruneOptions);
1873
+ }
1874
+ async function transformTailwindV4CssByTarget(css, target, options) {
1875
+ if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
1876
+ return hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css;
1877
+ }
1878
+ //#endregion
1879
+ //#region src/tailwindcss/v4-engine/generator.ts
1880
+ const incrementalGenerateCache$1 = /* @__PURE__ */ new Map();
1881
+ const incrementalGenerateTaskCache = /* @__PURE__ */ new Map();
1882
+ function collectCandidates(candidates) {
1883
+ return new Set(candidates ?? []);
1884
+ }
1885
+ function hasRemovedCandidates$1(previousCandidates, nextCandidates) {
1886
+ for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
1887
+ return false;
1888
+ }
1889
+ function createStableJson(value) {
1589
1890
  if (value === void 0) return "undefined";
1590
1891
  if (value === null || typeof value !== "object") return JSON.stringify(value);
1591
- if (Array.isArray(value)) return `[${value.map((item) => createStableJson$1(item)).join(",")}]`;
1892
+ if (Array.isArray(value)) return `[${value.map((item) => createStableJson(item)).join(",")}]`;
1592
1893
  return `{${Object.keys(value).sort().map((key) => {
1593
1894
  const record = value;
1594
- return `${JSON.stringify(key)}:${createStableJson$1(record[key])}`;
1895
+ return `${JSON.stringify(key)}:${createStableJson(record[key])}`;
1595
1896
  }).join(",")}}`;
1596
1897
  }
1597
- function createDependencyFingerprint$1(files) {
1898
+ function createDependencyFingerprint(files) {
1598
1899
  return files.map((file) => {
1599
1900
  try {
1600
1901
  const stat = fs.statSync(file);
@@ -1604,16 +1905,16 @@ function createDependencyFingerprint$1(files) {
1604
1905
  }
1605
1906
  }).join("|");
1606
1907
  }
1607
- function createIncrementalGenerateCacheKey$1(source, target, styleOptions, tailwindcssV3Compatibility) {
1908
+ function createIncrementalGenerateCacheKey(source, target, styleOptions, tailwindcssV3Compatibility) {
1608
1909
  return [
1609
1910
  source.projectRoot,
1610
1911
  source.base,
1611
- createStableJson$1(source.baseFallbacks),
1912
+ createStableJson(source.baseFallbacks),
1612
1913
  source.css,
1613
- createDependencyFingerprint$1(source.dependencies),
1914
+ createDependencyFingerprint(source.dependencies),
1614
1915
  target,
1615
- createStableJson$1(styleOptions),
1616
- createStableJson$1(tailwindcssV3Compatibility)
1916
+ createStableJson(styleOptions),
1917
+ createStableJson(tailwindcssV3Compatibility)
1617
1918
  ].join("\0");
1618
1919
  }
1619
1920
  function createIncrementalGenerateTaskCacheKey(cacheKey, requestedCandidates, scanSources) {
@@ -1634,192 +1935,61 @@ function runIncrementalGenerateTask(cacheKey, requestedCandidates, scanSources,
1634
1935
  });
1635
1936
  return promise;
1636
1937
  }
1637
- function createIncrementalDesignSystemPromise(source, cacheKey) {
1638
- const promise = loadTailwindV4DesignSystem(source);
1639
- promise.catch(() => {
1640
- if (incrementalGenerateCache$1.get(cacheKey)?.designSystemPromise === promise) incrementalGenerateCache$1.delete(cacheKey);
1641
- });
1642
- return promise;
1643
- }
1644
- function createCompatibleSource(source, target, tailwindcssV3Compatibility) {
1645
- const shouldApplyTailwindV3Compatibility = tailwindcssV3Compatibility ?? target === "weapp";
1646
- const filteredSourceCss = target === "weapp" ? removeUnlayeredTailwindV4PreflightImports(source.css) : source.css;
1647
- const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(shouldApplyTailwindV3Compatibility ? applyTailwindV3CompatibilityCss(filteredSourceCss) : target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss) : filteredSourceCss);
1648
- return compatibleSourceCss === source.css ? source : {
1649
- ...source,
1650
- css: compatibleSourceCss
1651
- };
1652
- }
1653
- function resolveTargetCandidates(candidates, target) {
1654
- const collected = collectCandidates$1(candidates);
1655
- return target === "weapp" ? filterUnsupportedMiniProgramTailwindV4Candidates(collected) : collected;
1656
- }
1657
- function collectSeenCandidates(generated, requestedCandidates) {
1658
- return new Set([
1659
- ...requestedCandidates,
1660
- ...generated.rawCandidates,
1661
- ...generated.classSet
1662
- ]);
1663
- }
1664
- function createIncrementalStyleOptions(styleOptions) {
1665
- return {
1666
- ...styleOptions,
1667
- isMainChunk: false
1668
- };
1669
- }
1670
- function resolveStyleOptions$1(source, options) {
1671
- return hasCssMacroTailwindV4Directive(source.css) ? withCssMacroStyleOptions(options) : options;
1672
- }
1673
- function collectCustomPropertyValues(css) {
1674
- const values = /* @__PURE__ */ new Map();
1675
- try {
1676
- postcss.parse(css).walkDecls((decl) => {
1677
- if (decl.prop.startsWith("--")) values.set(decl.prop, decl.value.trim());
1678
- });
1679
- } catch {}
1680
- return values;
1681
- }
1682
- function mergeCustomPropertyValues(target, css) {
1683
- for (const [prop, value] of collectCustomPropertyValues(css)) target.set(prop, value);
1684
- }
1685
- function seedIncrementalGenerateCache(options) {
1686
- const cacheKey = createIncrementalGenerateCacheKey$1(options.compatibleSource, options.target, options.styleOptions, options.tailwindcssV3Compatibility);
1687
- const customPropertyValues = collectCustomPropertyValues(options.compatibleSource.css);
1688
- mergeCustomPropertyValues(customPropertyValues, options.generated.css);
1689
- incrementalGenerateCache$1.set(cacheKey, {
1690
- seenCandidates: collectSeenCandidates(options.generated, options.requestedCandidates),
1691
- classSet: new Set(options.generated.classSet),
1692
- css: options.generated.css,
1693
- rawCss: options.generated.rawCss,
1694
- customPropertyValues,
1695
- designSystemPromise: createIncrementalDesignSystemPromise(options.compatibleSource, cacheKey),
1696
- dependencies: options.generated.dependencies,
1697
- sources: options.generated.sources,
1698
- root: options.generated.root,
1699
- target: options.generated.target
1700
- });
1701
- }
1702
- function parseImportSourceParam$1(params) {
1703
- const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
1704
- if (!match) return;
1705
- return {
1706
- none: match[1] === "none",
1707
- sourcePath: match[3]
1708
- };
1709
- }
1710
- function isTailwindCssImport$1(params) {
1711
- const specifier = parseCssImportSpecifier$2(params);
1712
- return specifier === "tailwindcss" || specifier?.startsWith("tailwindcss/") || specifier?.replaceAll("\\", "/").endsWith("/tailwindcss/index.css");
1713
- }
1714
- function parseCssImportSpecifier$2(params) {
1715
- const value = params.trim();
1716
- const quoted = /^(['"])(.*?)\1/.exec(value);
1717
- if (quoted) return quoted[2];
1718
- const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
1719
- return url?.[2] ?? url?.[3];
1720
- }
1721
- function isTailwindCssPreflightImport(params) {
1722
- const specifier = parseCssImportSpecifier$2(params);
1723
- return specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss/preflight";
1724
- }
1725
- function hasImportLayerOption(params) {
1726
- return /\blayer(?:\s*\(|\s*$)/.test(params);
1727
- }
1728
- function removeUnlayeredTailwindV4PreflightImports(css) {
1729
- if (!css.includes("preflight")) return css;
1730
- let root;
1731
- try {
1732
- root = postcss.parse(css);
1733
- } catch {
1734
- return css;
1735
- }
1736
- let changed = false;
1737
- root.walkAtRules("import", (rule) => {
1738
- if (isTailwindCssPreflightImport(rule.params) && !hasImportLayerOption(rule.params)) {
1739
- rule.remove();
1740
- changed = true;
1741
- }
1742
- });
1743
- return changed ? root.toString() : css;
1744
- }
1745
- function resolveSourceBase$1(base, sourcePath) {
1746
- return path.isAbsolute(sourcePath) ? sourcePath : path.resolve(base, sourcePath);
1747
- }
1748
- function createDefaultIgnoredScanSources(base) {
1749
- return TAILWIND_V4_DEFAULT_IGNORED_SOURCE_PATTERNS.map((pattern) => ({
1750
- base,
1751
- pattern,
1752
- negated: true
1753
- }));
1754
- }
1755
- function normalizeCssDefinedScanSources(base, entries) {
1756
- return entries.length > 0 && entries.every((entry) => entry.negated) ? [{
1757
- base,
1758
- pattern: "**/*",
1759
- negated: false
1760
- }, ...entries] : entries;
1761
- }
1762
- async function resolveCssDefinedScanSources(source) {
1763
- let importSourceBase;
1764
- let hasSourceNone = false;
1765
- const from = source.dependencies[0];
1766
- let root;
1767
- try {
1768
- root = postcss.parse(source.css, { from });
1769
- } catch {
1770
- return;
1771
- }
1772
- root.walkAtRules((rule) => {
1773
- if (rule.name === "import") {
1774
- if (!isTailwindCssImport$1(rule.params)) return;
1775
- const sourceParam = parseImportSourceParam$1(rule.params);
1776
- if (sourceParam?.none) hasSourceNone = true;
1777
- if (sourceParam?.sourcePath) importSourceBase = resolveSourceBase$1(source.base, sourceParam.sourcePath);
1778
- }
1938
+ function createIncrementalDesignSystemPromise(source, cacheKey) {
1939
+ const promise = loadTailwindV4DesignSystem(source);
1940
+ promise.catch(() => {
1941
+ if (incrementalGenerateCache$1.get(cacheKey)?.designSystemPromise === promise) incrementalGenerateCache$1.delete(cacheKey);
1779
1942
  });
1780
- const sourcePatterns = await resolveCssSourceEntries(root, source.base, "**/*");
1781
- if (!importSourceBase) {
1782
- if (sourcePatterns.length > 0) return [...normalizeCssDefinedScanSources(source.base, sourcePatterns), ...createDefaultIgnoredScanSources(source.base)];
1783
- if (hasSourceNone) return false;
1784
- return;
1785
- }
1786
- return [
1787
- await resolveTailwindSourceEntry(".", importSourceBase, false, "**/*"),
1788
- ...sourcePatterns,
1789
- ...createDefaultIgnoredScanSources(importSourceBase)
1790
- ];
1943
+ return promise;
1791
1944
  }
1792
- async function resolveScanSources(source, scanSources) {
1793
- if (scanSources !== true) return scanSources;
1794
- return await resolveCssDefinedScanSources(source) ?? false;
1945
+ function resolveTargetCandidates(candidates, target) {
1946
+ const collected = collectCandidates(candidates);
1947
+ return target === "weapp" ? filterUnsupportedMiniProgramTailwindV4Candidates(collected) : collected;
1795
1948
  }
1796
- function hasThemeParent(rule) {
1797
- let parent = rule.parent;
1798
- while (parent) {
1799
- if (parent.type === "atrule" && parent.name === "theme") return true;
1800
- parent = parent.parent;
1801
- }
1802
- return false;
1949
+ function collectSeenCandidates(generated, requestedCandidates) {
1950
+ return new Set([
1951
+ ...requestedCandidates,
1952
+ ...generated.rawCandidates,
1953
+ ...generated.classSet
1954
+ ]);
1803
1955
  }
1804
- function isVendorPrefixedKeyframes(rule) {
1805
- return rule.name.startsWith("-") && rule.name.endsWith("keyframes");
1956
+ function createIncrementalStyleOptions(styleOptions) {
1957
+ return {
1958
+ ...styleOptions,
1959
+ isMainChunk: false
1960
+ };
1806
1961
  }
1807
- function removeUnsupportedThemeVendorKeyframes(css) {
1808
- if (!css.includes("@theme") || !css.includes("@-")) return css;
1809
- let root;
1962
+ function resolveStyleOptions$1(source, options) {
1963
+ return hasCssMacroTailwindV4Directive(source.css) ? withCssMacroStyleOptions(options) : options;
1964
+ }
1965
+ function collectCustomPropertyValues(css) {
1966
+ const values = /* @__PURE__ */ new Map();
1810
1967
  try {
1811
- root = postcss.parse(css);
1812
- } catch {
1813
- return css;
1814
- }
1815
- let changed = false;
1816
- root.walkAtRules((rule) => {
1817
- if (isVendorPrefixedKeyframes(rule) && hasThemeParent(rule)) {
1818
- rule.remove();
1819
- changed = true;
1820
- }
1968
+ postcss.parse(css).walkDecls((decl) => {
1969
+ if (decl.prop.startsWith("--")) values.set(decl.prop, decl.value.trim());
1970
+ });
1971
+ } catch {}
1972
+ return values;
1973
+ }
1974
+ function mergeCustomPropertyValues(target, css) {
1975
+ for (const [prop, value] of collectCustomPropertyValues(css)) target.set(prop, value);
1976
+ }
1977
+ function seedIncrementalGenerateCache(options) {
1978
+ const cacheKey = createIncrementalGenerateCacheKey(options.compatibleSource, options.target, options.styleOptions, options.tailwindcssV3Compatibility);
1979
+ const customPropertyValues = collectCustomPropertyValues(options.compatibleSource.css);
1980
+ mergeCustomPropertyValues(customPropertyValues, options.generated.css);
1981
+ incrementalGenerateCache$1.set(cacheKey, {
1982
+ seenCandidates: collectSeenCandidates(options.generated, options.requestedCandidates),
1983
+ classSet: new Set(options.generated.classSet),
1984
+ css: options.generated.css,
1985
+ rawCss: options.generated.rawCss,
1986
+ customPropertyValues,
1987
+ designSystemPromise: createIncrementalDesignSystemPromise(options.compatibleSource, cacheKey),
1988
+ dependencies: options.generated.dependencies,
1989
+ sources: options.generated.sources,
1990
+ root: options.generated.root,
1991
+ target: options.generated.target
1821
1992
  });
1822
- return changed ? root.toString() : css;
1823
1993
  }
1824
1994
  function createTailwindV4Engine$1(source) {
1825
1995
  async function generateOnce(generateSource, options = {}) {
@@ -1827,8 +1997,8 @@ function createTailwindV4Engine$1(source) {
1827
1997
  const resolvedStyleOptions = resolveStyleOptions$1(generateSource, styleOptions);
1828
1998
  const engine = createTailwindV4Engine(createCompatibleSource(generateSource, target, tailwindcssV3Compatibility));
1829
1999
  const resolvedScanSources = await resolveScanSources(generateSource, scanSources);
1830
- const filesystemCandidates = Array.isArray(resolvedScanSources) ? new Set(await extractRawCandidates(resolvedScanSources, { bareArbitraryValues: patchOptions.bareArbitraryValues })) : void 0;
1831
- const normalizedCandidates = normalizeRpxTextCandidates(resolveTargetCandidates(new Set([...collectCandidates$1(patchOptions.candidates), ...filesystemCandidates ?? []]), target));
2000
+ const filesystemCandidates = Array.isArray(resolvedScanSources) ? new Set(await extractRawCandidates(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
2001
+ const normalizedCandidates = normalizeRpxTextCandidates(resolveTargetCandidates(new Set([...collectCandidates(patchOptions.candidates), ...filesystemCandidates ?? []]), target));
1832
2002
  const result = await engine.generate(omitUndefined({
1833
2003
  scanSources: false,
1834
2004
  ...patchOptions,
@@ -1851,7 +2021,7 @@ function createTailwindV4Engine$1(source) {
1851
2021
  const requestedCandidates = resolveTargetCandidates(options.candidates, target);
1852
2022
  const styleOptions = resolveStyleOptions$1(source, options.styleOptions);
1853
2023
  if ((options.sources?.length ?? 0) > 0 || options.bareArbitraryValues !== void 0 || Array.isArray(options.scanSources)) return generateOnce(source, options);
1854
- const cacheKey = createIncrementalGenerateCacheKey$1(compatibleSource, target, styleOptions, options.tailwindcssV3Compatibility);
2024
+ const cacheKey = createIncrementalGenerateCacheKey(compatibleSource, target, styleOptions, options.tailwindcssV3Compatibility);
1855
2025
  if (options.scanSources === true) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
1856
2026
  const generated = await generateOnce(source, options);
1857
2027
  seedIncrementalGenerateCache({
@@ -2040,109 +2210,48 @@ function hasTailwindGeneratedCssMarkers(rawSource) {
2040
2210
  return TAILWIND_GENERATED_CSS_MARKER_RE.test(rawSource) || GENERATOR_PLACEHOLDER_MARKER_RE.test(rawSource);
2041
2211
  }
2042
2212
  //#endregion
2043
- //#region src/bundlers/shared/generator-css/directives.ts
2044
- const TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES = new Set([
2045
- "config",
2046
- "custom-variant",
2047
- "layer",
2048
- "plugin",
2049
- "reference",
2050
- "source",
2051
- "tailwind",
2052
- "theme",
2053
- "utility",
2054
- "variant"
2055
- ]);
2056
- const TAILWIND_ROOT_DIRECTIVE_NAMES = new Set([
2057
- "config",
2058
- "custom-variant",
2059
- "plugin",
2060
- "source",
2061
- "tailwind",
2062
- "theme",
2063
- "utility",
2064
- "variant"
2065
- ]);
2066
- const TAILWIND_ROOT_DIRECTIVE_RE = /@(?:import\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|(?:use|forward)\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|tailwind|config|custom-variant|plugin|source|theme|utility|variant)\b/;
2213
+ //#region src/bundlers/shared/generator-css/directives/fallback.ts
2067
2214
  const TAILWIND_EXTRACTABLE_DIRECTIVE_RE = /^\s*@(?:import|use|forward|tailwind|config|source|reference|plugin)\b[\s\S]*?(?:;|$)/;
2068
2215
  const TAILWIND_EXTRACTABLE_LAYER_STATEMENT_RE = /^\s*@layer\s[^;{]+;\s*$/;
2069
- const TAILWIND_EXTRACTABLE_BLOCK_START_RE = /^\s*@(?:layer|theme|utility|variant|custom-variant)\b[\s\S]*\{/;
2070
- const TAILWIND_V3_SUBPATH_IMPORT_LAYERS = new Map([
2071
- ["tailwindcss/base", "base"],
2072
- ["tailwindcss/components", "components"],
2073
- ["tailwindcss/utilities", "utilities"]
2074
- ]);
2075
- function parseImportRequest(params) {
2216
+ const TAILWIND_EXTRACTABLE_BLOCK_START_RE = /^\s*@(?:layer|theme|utility|variant|custom-variant|plugin)\b[\s\S]*\{/;
2217
+ function parseImportRequest$1(params) {
2076
2218
  return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
2077
2219
  }
2078
- function hasLocalCssImport(rawSource) {
2079
- let found = false;
2080
- try {
2081
- postcss.parse(rawSource).walkAtRules("import", (rule) => {
2082
- const request = parseImportRequest(rule.params);
2083
- if (request?.startsWith(".") === true || request?.startsWith("/") === true) {
2084
- found = true;
2085
- return false;
2086
- }
2087
- });
2088
- } catch {}
2089
- return found;
2090
- }
2091
- function parseConfigRequest(params) {
2220
+ function parseConfigRequest$1(params) {
2092
2221
  return /^(["'])(.+)\1\s*;?$/.exec(params.trim())?.[2];
2093
2222
  }
2094
- function isPackageJsonImportRequest(request) {
2223
+ function isPackageJsonImportRequest$1(request) {
2095
2224
  return typeof request === "string" && request.startsWith("#");
2096
2225
  }
2097
- function isWeappTailwindcssImportRequest(request) {
2226
+ function isWeappTailwindcssImportRequest$1(request) {
2098
2227
  return request === "weapp-tailwindcss" || request?.startsWith("weapp-tailwindcss/");
2099
2228
  }
2100
- function normalizeTailwindImportRequest(request, options = {}) {
2101
- if (options.importFallback && isWeappTailwindcssImportRequest(request)) return request.replace(/^weapp-tailwindcss/, "tailwindcss");
2229
+ function isTailwindImportRequest$1(request) {
2230
+ return request === "tailwindcss" || request === "tailwindcss4" || request?.startsWith("tailwindcss/") || request?.startsWith("tailwindcss4/");
2231
+ }
2232
+ function normalizeTailwindImportRequest$1(request, options = {}) {
2233
+ if (options.importFallback && isWeappTailwindcssImportRequest$1(request)) return request.replace(/^weapp-tailwindcss/, "tailwindcss");
2102
2234
  return request;
2103
2235
  }
2104
- function replaceImportRequest(params, request, replacement) {
2236
+ function replaceImportRequest$1(params, request, replacement) {
2105
2237
  const index = params.indexOf(request);
2106
2238
  if (index === -1) return params;
2107
2239
  return `${params.slice(0, index)}${replacement}${params.slice(index + request.length)}`;
2108
2240
  }
2109
- function normalizeTailwindImportAtRules(root, options = {}) {
2110
- if (!options.importFallback) return false;
2111
- let changed = false;
2112
- const seenCanonicalImports = /* @__PURE__ */ new Set();
2113
- root.walkAtRules("import", (node) => {
2114
- const request = parseImportRequest(node.params);
2115
- const normalizedRequest = normalizeTailwindImportRequest(request, options);
2116
- if (!normalizedRequest || !isTailwindImportRequest(normalizedRequest)) return;
2117
- const normalizedParams = request && normalizedRequest !== request ? replaceImportRequest(node.params, request, normalizedRequest) : node.params;
2118
- const normalizedKey = normalizedParams.trim();
2119
- if (seenCanonicalImports.has(normalizedKey)) {
2120
- node.remove();
2121
- changed = true;
2122
- return;
2123
- }
2124
- seenCanonicalImports.add(normalizedKey);
2125
- if (normalizedParams !== node.params) {
2126
- node.params = normalizedParams;
2127
- changed = true;
2128
- }
2129
- });
2130
- return changed;
2131
- }
2132
2241
  function normalizeTailwindDirectiveLine(line, options = {}) {
2133
2242
  const trimmed = line.trimStart();
2134
2243
  if (/^@(?:use|forward)\b/.test(trimmed)) {
2135
- const request = parseImportRequest(trimmed.replace(/^@(?:use|forward)\b/, ""));
2136
- if (isTailwindImportRequest(request) || options.importFallback && isWeappTailwindcssImportRequest(request)) {
2137
- const normalizedRequest = normalizeTailwindImportRequest(request, options);
2138
- return replaceImportRequest(line.replace(/^(\s*)@(?:use|forward)\b/, "$1@import"), request, normalizedRequest);
2244
+ const request = parseImportRequest$1(trimmed.replace(/^@(?:use|forward)\b/, ""));
2245
+ if (isTailwindImportRequest$1(request) || options.importFallback && isWeappTailwindcssImportRequest$1(request)) {
2246
+ const normalizedRequest = normalizeTailwindImportRequest$1(request, options);
2247
+ return replaceImportRequest$1(line.replace(/^(\s*)@(?:use|forward)\b/, "$1@import"), request, normalizedRequest);
2139
2248
  }
2140
2249
  return line;
2141
2250
  }
2142
2251
  if (!options.importFallback || !trimmed.startsWith("@import")) return line;
2143
- const request = parseImportRequest(trimmed.replace(/^@import\b/, ""));
2144
- if (!request || !isWeappTailwindcssImportRequest(request)) return line;
2145
- return replaceImportRequest(line, request, request.replace(/^weapp-tailwindcss/, "tailwindcss"));
2252
+ const request = parseImportRequest$1(trimmed.replace(/^@import\b/, ""));
2253
+ if (!request || !isWeappTailwindcssImportRequest$1(request)) return line;
2254
+ return replaceImportRequest$1(line, request, request.replace(/^weapp-tailwindcss/, "tailwindcss"));
2146
2255
  }
2147
2256
  function extractTailwindDirectiveLines(rawSource, options = {}) {
2148
2257
  const directives = [];
@@ -2152,13 +2261,14 @@ function extractTailwindDirectiveLines(rawSource, options = {}) {
2152
2261
  if (!trimmed || trimmed.startsWith("//")) continue;
2153
2262
  const directive = TAILWIND_EXTRACTABLE_DIRECTIVE_RE.exec(line)?.[0] ?? TAILWIND_EXTRACTABLE_LAYER_STATEMENT_RE.exec(line)?.[0];
2154
2263
  if (!directive) continue;
2264
+ if (TAILWIND_EXTRACTABLE_BLOCK_START_RE.test(directive)) continue;
2155
2265
  const normalized = normalizeTailwindDirectiveLine(directive.trimEnd(), options);
2156
2266
  const normalizedTrimmed = normalized.trim();
2157
2267
  if (options.removeConfig && normalizedTrimmed.startsWith("@config")) continue;
2158
- const request = /^@(?:import|use|forward)\b/.test(normalizedTrimmed) ? parseImportRequest(normalizedTrimmed.replace(/^@(?:import|use|forward)\b/, "")) : void 0;
2159
- if (request && !isTailwindImportRequest(request) && !isPackageJsonImportRequest(request)) continue;
2268
+ const request = /^@(?:import|use|forward)\b/.test(normalizedTrimmed) ? parseImportRequest$1(normalizedTrimmed.replace(/^@(?:import|use|forward)\b/, "")) : void 0;
2269
+ if (request && !isTailwindImportRequest$1(request) && !isPackageJsonImportRequest$1(request)) continue;
2160
2270
  if (/^@(?:import|use|forward)\b/.test(normalizedTrimmed) && !request) continue;
2161
- if (request && isTailwindImportRequest(request)) {
2271
+ if (request && isTailwindImportRequest$1(request)) {
2162
2272
  const key = normalizedTrimmed;
2163
2273
  if (seenImports.has(key)) continue;
2164
2274
  seenImports.add(key);
@@ -2254,10 +2364,97 @@ function extractTailwindSourceForPostcssFallback(rawSource, options = {}) {
2254
2364
  function extractConfigRequestFromSource(rawSource) {
2255
2365
  for (const line of rawSource.split(/\r?\n/)) {
2256
2366
  const match = /^\s*@config\b([\s\S]*?)(?:;|$)/.exec(line);
2257
- const request = match ? parseConfigRequest(match[1] ?? "") : void 0;
2367
+ const request = match ? parseConfigRequest$1(match[1] ?? "") : void 0;
2258
2368
  if (request) return request;
2259
2369
  }
2260
2370
  }
2371
+ //#endregion
2372
+ //#region src/bundlers/shared/generator-css/directives.ts
2373
+ const TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES = new Set([
2374
+ "config",
2375
+ "custom-variant",
2376
+ "layer",
2377
+ "plugin",
2378
+ "reference",
2379
+ "source",
2380
+ "tailwind",
2381
+ "theme",
2382
+ "utility",
2383
+ "variant"
2384
+ ]);
2385
+ const TAILWIND_ROOT_DIRECTIVE_NAMES = new Set([
2386
+ "config",
2387
+ "custom-variant",
2388
+ "plugin",
2389
+ "source",
2390
+ "tailwind",
2391
+ "theme",
2392
+ "utility",
2393
+ "variant"
2394
+ ]);
2395
+ const TAILWIND_ROOT_DIRECTIVE_RE = /@(?:import\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|(?:use|forward)\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/[^"')\s]*)?|tailwind|config|custom-variant|plugin|source|theme|utility|variant)\b/;
2396
+ const TAILWIND_V3_SUBPATH_IMPORT_LAYERS = new Map([
2397
+ ["tailwindcss/base", "base"],
2398
+ ["tailwindcss/components", "components"],
2399
+ ["tailwindcss/utilities", "utilities"]
2400
+ ]);
2401
+ function parseImportRequest(params) {
2402
+ return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
2403
+ }
2404
+ function hasLocalCssImport(rawSource) {
2405
+ let found = false;
2406
+ try {
2407
+ postcss.parse(rawSource).walkAtRules("import", (rule) => {
2408
+ const request = parseImportRequest(rule.params);
2409
+ if (request?.startsWith(".") === true || request?.startsWith("/") === true) {
2410
+ found = true;
2411
+ return false;
2412
+ }
2413
+ });
2414
+ } catch {}
2415
+ return found;
2416
+ }
2417
+ function parseConfigRequest(params) {
2418
+ return /^(["'])(.+)\1\s*;?$/.exec(params.trim())?.[2];
2419
+ }
2420
+ function isPackageJsonImportRequest(request) {
2421
+ return typeof request === "string" && request.startsWith("#");
2422
+ }
2423
+ function isWeappTailwindcssImportRequest(request) {
2424
+ return request === "weapp-tailwindcss" || request?.startsWith("weapp-tailwindcss/");
2425
+ }
2426
+ function normalizeTailwindImportRequest(request, options = {}) {
2427
+ if (options.importFallback && isWeappTailwindcssImportRequest(request)) return request.replace(/^weapp-tailwindcss/, "tailwindcss");
2428
+ return request;
2429
+ }
2430
+ function replaceImportRequest(params, request, replacement) {
2431
+ const index = params.indexOf(request);
2432
+ if (index === -1) return params;
2433
+ return `${params.slice(0, index)}${replacement}${params.slice(index + request.length)}`;
2434
+ }
2435
+ function normalizeTailwindImportAtRules(root, options = {}) {
2436
+ if (!options.importFallback) return false;
2437
+ let changed = false;
2438
+ const seenCanonicalImports = /* @__PURE__ */ new Set();
2439
+ root.walkAtRules("import", (node) => {
2440
+ const request = parseImportRequest(node.params);
2441
+ const normalizedRequest = normalizeTailwindImportRequest(request, options);
2442
+ if (!normalizedRequest || !isTailwindImportRequest(normalizedRequest)) return;
2443
+ const normalizedParams = request && normalizedRequest !== request ? replaceImportRequest(node.params, request, normalizedRequest) : node.params;
2444
+ const normalizedKey = normalizedParams.trim();
2445
+ if (seenCanonicalImports.has(normalizedKey)) {
2446
+ node.remove();
2447
+ changed = true;
2448
+ return;
2449
+ }
2450
+ seenCanonicalImports.add(normalizedKey);
2451
+ if (normalizedParams !== node.params) {
2452
+ node.params = normalizedParams;
2453
+ changed = true;
2454
+ }
2455
+ });
2456
+ return changed;
2457
+ }
2261
2458
  function resolveConfigPath$1(base, configPath) {
2262
2459
  if (path.isAbsolute(configPath) || isPackageJsonImportRequest(configPath)) return path.isAbsolute(configPath) ? configPath : void 0;
2263
2460
  return path.resolve(base, configPath);
@@ -2837,7 +3034,15 @@ function readStaticConfigContent(configPath) {
2837
3034
  return parseStaticContentValue(source, contentProperty.start)?.value;
2838
3035
  }
2839
3036
  //#endregion
2840
- //#region src/bundlers/vite/source-scan.ts
3037
+ //#region src/bundlers/vite/source-scan/dependencies.ts
3038
+ function addSourceScanDependency(dependencies, file) {
3039
+ if (typeof file === "string" && file.length > 0) dependencies.add(path.resolve(file));
3040
+ }
3041
+ function addSourceScanDependencies(dependencies, files) {
3042
+ for (const file of files ?? []) addSourceScanDependency(dependencies, file);
3043
+ }
3044
+ //#endregion
3045
+ //#region src/bundlers/vite/source-scan/css-entries.ts
2841
3046
  const VITE_SOURCE_CANDIDATE_PATTERN = FULL_SOURCE_SCAN_PATTERN;
2842
3047
  const VITE_TAILWIND_CSS_ENTRY_PATTERN = "**/*.{css,less,sass,scss,styl,stylus,pcss,postcss}";
2843
3048
  const tailwindV4CssEntriesCache = /* @__PURE__ */ new Map();
@@ -2874,23 +3079,6 @@ function createCssEntriesCacheKey(css, base, dependencies) {
2874
3079
  dependencies
2875
3080
  });
2876
3081
  }
2877
- function addSourceScanDependency(dependencies, file) {
2878
- if (typeof file === "string" && file.length > 0) dependencies.add(path.resolve(file));
2879
- }
2880
- function addSourceScanDependencies(dependencies, files) {
2881
- for (const file of files ?? []) addSourceScanDependency(dependencies, file);
2882
- }
2883
- function createResolvedViteSourceScan(input, dependencies) {
2884
- return {
2885
- ...input,
2886
- ...dependencies.size > 0 ? { dependencies: [...dependencies].sort() } : {}
2887
- };
2888
- }
2889
- function createMergedCssEntrySourceScanEntries(entries, options) {
2890
- if (options.sourceCount <= 1) return entries;
2891
- const positiveEntries = entries.filter((entry) => !entry.negated);
2892
- return positiveEntries.length > 0 ? positiveEntries : entries;
2893
- }
2894
3082
  async function statConfigDependency(file) {
2895
3083
  try {
2896
3084
  const stats = await stat(file);
@@ -3104,6 +3292,26 @@ async function discoverTailwindV4CssEntries(root, outDir) {
3104
3292
  function collectConfiguredCssSources(options) {
3105
3293
  return [...options.tailwindcss?.v4?.cssSources ?? [], ...options.tailwindcssPatcherOptions?.tailwindcss?.v4?.cssSources ?? []];
3106
3294
  }
3295
+ //#endregion
3296
+ //#region src/bundlers/vite/source-scan.ts
3297
+ function createResolvedViteSourceScan(input, dependencies) {
3298
+ return {
3299
+ ...input,
3300
+ ...dependencies.size > 0 ? { dependencies: [...dependencies].sort() } : {}
3301
+ };
3302
+ }
3303
+ function createMergedCssEntrySourceScanEntries(entries, options) {
3304
+ if (options.sourceCount <= 1) return entries;
3305
+ const positiveEntries = entries.filter((entry) => !entry.negated);
3306
+ return positiveEntries.length > 0 ? positiveEntries : entries;
3307
+ }
3308
+ function createResolvedV4CssScanInput(entries, inlineCandidates, explicit) {
3309
+ return {
3310
+ entries: explicit ? entries : entries.length > 0 ? entries : void 0,
3311
+ explicit,
3312
+ inlineCandidates
3313
+ };
3314
+ }
3107
3315
  async function resolveViteSourceScanEntries(options, patcher, scanOptions = {}) {
3108
3316
  if (patcher.majorVersion === 3) {
3109
3317
  const [source, cssEntryScan] = await Promise.all([resolveTailwindV3SourceFromPatcher(patcher), resolveTailwindV3CssEntryScan(options, patcher)]);
@@ -3155,11 +3363,7 @@ async function resolveViteSourceScanEntries(options, patcher, scanOptions = {})
3155
3363
  }, dependencies);
3156
3364
  if (typeof sourceOptions.css === "string" && sourceOptions.css.length > 0) {
3157
3365
  const resolved = await resolveTailwindV4EntriesFromCssCached(sourceOptions.css, sourceOptions.base ?? sourceOptions.projectRoot ?? process.cwd());
3158
- return resolved ? createResolvedViteSourceScan({
3159
- entries: resolved.explicit ? resolved.entries : resolved.entries.length > 0 ? resolved.entries : void 0,
3160
- explicit: resolved.explicit,
3161
- inlineCandidates: resolved.inlineCandidates
3162
- }, new Set(resolved.dependencies)) : void 0;
3366
+ return resolved ? createResolvedViteSourceScan(createResolvedV4CssScanInput(resolved.entries, resolved.inlineCandidates, resolved.explicit), new Set(resolved.dependencies)) : void 0;
3163
3367
  }
3164
3368
  const sourceOptionBase = sourceOptions.base ?? sourceOptions.projectRoot ?? process.cwd();
3165
3369
  const configuredCssSources = collectConfiguredCssSources(options);
@@ -3186,11 +3390,7 @@ async function resolveViteSourceScanEntries(options, patcher, scanOptions = {})
3186
3390
  addSourceScanDependency(dependencies, source.file);
3187
3391
  addSourceScanDependencies(dependencies, source.dependencies);
3188
3392
  const resolved = await resolveTailwindV4EntriesFromCssCached(source.css, source.base);
3189
- return resolved ? createResolvedViteSourceScan({
3190
- entries: resolved.explicit ? resolved.entries : resolved.entries.length > 0 ? resolved.entries : void 0,
3191
- explicit: resolved.explicit,
3192
- inlineCandidates: resolved.inlineCandidates
3193
- }, new Set([...dependencies, ...resolved.dependencies])) : void 0;
3393
+ return resolved ? createResolvedViteSourceScan(createResolvedV4CssScanInput(resolved.entries, resolved.inlineCandidates, resolved.explicit), new Set([...dependencies, ...resolved.dependencies])) : void 0;
3194
3394
  }
3195
3395
  }
3196
3396
  function createViteSourceScanMatcher(entries) {
@@ -3404,6 +3604,40 @@ async function ensureTailwindcssRuntimePatch(twPatcher, options = {}) {
3404
3604
  return task;
3405
3605
  }
3406
3606
  //#endregion
3607
+ //#region src/tailwindcss/v3-engine/generator/runtime-ready.ts
3608
+ const runtimeReadyPromiseCache = /* @__PURE__ */ new Map();
3609
+ function createRuntimeReadyCacheKey(source, rootPath) {
3610
+ return [
3611
+ source.packageName,
3612
+ source.postcssPlugin,
3613
+ rootPath ?? "missing",
3614
+ source.config ?? "config:missing",
3615
+ source.cwd
3616
+ ].join("\0");
3617
+ }
3618
+ function createRuntimeReadyPromise(source) {
3619
+ const patcher = createTailwindcssPatcher({
3620
+ basedir: source.cwd,
3621
+ supportCustomLengthUnitsPatch: true,
3622
+ tailwindcss: {
3623
+ ...source.config === void 0 ? {} : { config: source.config },
3624
+ cwd: source.cwd,
3625
+ packageName: source.packageName,
3626
+ postcssPlugin: source.postcssPlugin,
3627
+ version: 3
3628
+ }
3629
+ });
3630
+ const cacheKey = createRuntimeReadyCacheKey(source, patcher.packageInfo?.rootPath);
3631
+ const cached = runtimeReadyPromiseCache.get(cacheKey);
3632
+ if (cached) return cached;
3633
+ const task = ensureTailwindcssRuntimePatch(patcher, { clearRequireCache: true }).catch((error) => {
3634
+ runtimeReadyPromiseCache.delete(cacheKey);
3635
+ throw error;
3636
+ });
3637
+ runtimeReadyPromiseCache.set(cacheKey, task);
3638
+ return task;
3639
+ }
3640
+ //#endregion
3407
3641
  //#region src/tailwindcss/v3-engine/miniprogram.ts
3408
3642
  const defaultStyleHandler = createStyleHandler({
3409
3643
  cssChildCombinatorReplaceValue: ["view", "text"],
@@ -3485,33 +3719,7 @@ async function transformTailwindV3CssByTarget(css, target, options) {
3485
3719
  }
3486
3720
  //#endregion
3487
3721
  //#region src/tailwindcss/v3-engine/generator.ts
3488
- const runtimeReadyPromiseCache = /* @__PURE__ */ new Map();
3489
3722
  const incrementalGenerateCache = /* @__PURE__ */ new Map();
3490
- function isLegacyContentObject(value) {
3491
- return typeof value === "object" && value !== null && "files" in value;
3492
- }
3493
- function createRawContentEntries(candidates, sources) {
3494
- const entries = [];
3495
- const candidateContent = [...candidates].join(" ");
3496
- if (candidateContent.length > 0) entries.push({
3497
- raw: candidateContent,
3498
- extension: "html"
3499
- });
3500
- for (const source of sources) entries.push({
3501
- raw: source.content,
3502
- extension: source.extension ?? "html"
3503
- });
3504
- return entries;
3505
- }
3506
- function createChangedContentEntries(candidates, sources) {
3507
- return createRawContentEntries(candidates, sources).map((entry) => ({
3508
- content: entry.raw,
3509
- extension: entry.extension
3510
- }));
3511
- }
3512
- function collectCandidates(candidates) {
3513
- return new Set(candidates ?? []);
3514
- }
3515
3723
  function normalizeBareArbitraryValueCandidate(candidate, bareArbitraryValues) {
3516
3724
  return resolveBareArbitraryValueCandidate(candidate, bareArbitraryValues)?.canonicalCandidate ?? candidate;
3517
3725
  }
@@ -3531,7 +3739,7 @@ function normalizeBareArbitraryValueCandidates(candidates, bareArbitraryValues)
3531
3739
  async function collectSourceBareArbitraryValueCandidates(sources, bareArbitraryValues) {
3532
3740
  if (!isBareArbitraryValuesEnabled(bareArbitraryValues)) return [];
3533
3741
  const candidates = /* @__PURE__ */ new Set();
3534
- for (const source of sources ?? []) for (const candidate of await extractSourceCandidates(source.content, source.extension ?? "html", { bareArbitraryValues })) if (resolveBareArbitraryValueCandidate(candidate, bareArbitraryValues)) candidates.add(candidate);
3742
+ for (const source of sources ?? []) for (const candidate of await extractSourceCandidates(source.content, source.extension ?? "html", omitUndefined({ bareArbitraryValues }))) if (resolveBareArbitraryValueCandidate(candidate, bareArbitraryValues)) candidates.add(candidate);
3535
3743
  return [...candidates];
3536
3744
  }
3537
3745
  function escapeCssClassSelector(className) {
@@ -3567,99 +3775,6 @@ function hasRemovedCandidates(previousCandidates, nextCandidates) {
3567
3775
  for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
3568
3776
  return false;
3569
3777
  }
3570
- function collectApplyCandidatesFromCss(css) {
3571
- if (!css.includes("@apply")) return [];
3572
- const candidates = /* @__PURE__ */ new Set();
3573
- try {
3574
- postcss.parse(css).walkAtRules("apply", (rule) => {
3575
- for (const candidate of rule.params.split(/\s+/)) {
3576
- const normalized = candidate.replace(/!important$/, "").trim();
3577
- if (normalized) candidates.add(normalized);
3578
- }
3579
- });
3580
- } catch {}
3581
- return [...candidates];
3582
- }
3583
- function isTailwindCandidateLayer(params) {
3584
- return params.split(/[,\s]+/).some((layer) => layer === "components" || layer === "utilities");
3585
- }
3586
- function extractClassCandidatesFromSelector(selector, candidates) {
3587
- for (let index = 0; index < selector.length; index++) {
3588
- if (selector[index] !== ".") continue;
3589
- let candidate = "";
3590
- let escaped = false;
3591
- for (let tokenIndex = index + 1; tokenIndex < selector.length; tokenIndex++) {
3592
- const char = selector[tokenIndex];
3593
- if (escaped) {
3594
- candidate += char;
3595
- escaped = false;
3596
- continue;
3597
- }
3598
- if (char === "\\") {
3599
- escaped = true;
3600
- continue;
3601
- }
3602
- if (char && /[\w-]/.test(char)) {
3603
- candidate += char;
3604
- continue;
3605
- }
3606
- break;
3607
- }
3608
- if (candidate) candidates.add(candidate);
3609
- }
3610
- }
3611
- function collectLayerCandidatesFromCss(css) {
3612
- if (!css.includes("@layer")) return [];
3613
- const candidates = /* @__PURE__ */ new Set();
3614
- try {
3615
- postcss.parse(css).walkAtRules("layer", (layer) => {
3616
- if (!isTailwindCandidateLayer(layer.params)) return;
3617
- layer.walkRules((rule) => {
3618
- extractClassCandidatesFromSelector(rule.selector, candidates);
3619
- });
3620
- });
3621
- } catch {}
3622
- return [...candidates];
3623
- }
3624
- function mergeGenerateCandidates(source, options) {
3625
- return collectCandidates([
3626
- ...collectLayerCandidatesFromCss(source.css),
3627
- ...collectApplyCandidatesFromCss(source.css),
3628
- ...collectCandidates(options.candidates)
3629
- ]);
3630
- }
3631
- function mergeContent(content, rawEntries) {
3632
- if (isLegacyContentObject(content)) return {
3633
- ...content,
3634
- relative: content.relative ?? true,
3635
- files: [...[].concat(content.files ?? []), ...rawEntries]
3636
- };
3637
- return {
3638
- relative: true,
3639
- files: [...[].concat(content ?? []), ...rawEntries]
3640
- };
3641
- }
3642
- function normalizeConfigObject(config) {
3643
- if (!config || typeof config !== "object") return config;
3644
- const maybeDefault = config.default;
3645
- if (maybeDefault && typeof maybeDefault === "object") return maybeDefault;
3646
- return config;
3647
- }
3648
- function hasExplicitContentInput(options) {
3649
- return options.candidates !== void 0 || options.sources !== void 0;
3650
- }
3651
- function createExplicitContentConfig(rawEntries) {
3652
- return {
3653
- relative: true,
3654
- files: rawEntries
3655
- };
3656
- }
3657
- function createTailwindConfig(source, options) {
3658
- const config = { ...normalizeConfigObject(source.configObject) ?? {} };
3659
- const rawEntries = createRawContentEntries(mergeGenerateCandidates(source, options), options.sources ?? []);
3660
- config.content = hasExplicitContentInput(options) ? createExplicitContentConfig(rawEntries) : mergeContent(config.content, rawEntries);
3661
- return config;
3662
- }
3663
3778
  function shouldAutoEnableCssMacro(source) {
3664
3779
  return hasCssMacroTailwindPlugin(normalizeConfigObject(source.configObject)?.plugins);
3665
3780
  }
@@ -3699,48 +3814,6 @@ function loadTailwindV3Internals(source) {
3699
3814
  validateConfig: validateConfigModule["validateConfig"]
3700
3815
  };
3701
3816
  }
3702
- function createStableJson(value) {
3703
- if (value === void 0) return "undefined";
3704
- if (value === null || typeof value !== "object") return JSON.stringify(value);
3705
- if (Array.isArray(value)) return `[${value.map((item) => createStableJson(item)).join(",")}]`;
3706
- return `{${Object.keys(value).sort().map((key) => {
3707
- const record = value;
3708
- return `${JSON.stringify(key)}:${createStableJson(record[key])}`;
3709
- }).join(",")}}`;
3710
- }
3711
- function createDependencyFingerprint(files) {
3712
- return files.map((file) => {
3713
- try {
3714
- const stat = fs.statSync(file);
3715
- return `${file}:${stat.size}:${stat.mtimeMs}`;
3716
- } catch {
3717
- return `${file}:missing`;
3718
- }
3719
- }).join("|");
3720
- }
3721
- function createIncrementalGenerateCacheKey(source, target, styleOptions, bareArbitraryValues) {
3722
- return [
3723
- source.packageName,
3724
- source.postcssPlugin,
3725
- source.cwd,
3726
- source.config ?? "config:missing",
3727
- createDependencyFingerprint(source.dependencies),
3728
- source.css,
3729
- createStableJson(normalizeConfigObject(source.configObject)?.content),
3730
- target,
3731
- createStableJson(styleOptions),
3732
- createStableJson(bareArbitraryValues)
3733
- ].join("\0");
3734
- }
3735
- function createRuntimeReadyCacheKey(source, rootPath) {
3736
- return [
3737
- source.packageName,
3738
- source.postcssPlugin,
3739
- rootPath ?? "missing",
3740
- source.config ?? "config:missing",
3741
- source.cwd
3742
- ].join("\0");
3743
- }
3744
3817
  function isDirectUtilitiesOnlyCss(css) {
3745
3818
  return css.replace(/\s+/g, "") === "@tailwindutilities;";
3746
3819
  }
@@ -3773,28 +3846,6 @@ function appendUtilityRules(root, context, rules) {
3773
3846
  function appendDirectUtilityRules(root, context) {
3774
3847
  appendUtilityRules(root, context, [...context.ruleCache]);
3775
3848
  }
3776
- function createRuntimeReadyPromise(source) {
3777
- const patcher = createTailwindcssPatcher({
3778
- basedir: source.cwd,
3779
- supportCustomLengthUnitsPatch: true,
3780
- tailwindcss: {
3781
- ...source.config === void 0 ? {} : { config: source.config },
3782
- cwd: source.cwd,
3783
- packageName: source.packageName,
3784
- postcssPlugin: source.postcssPlugin,
3785
- version: 3
3786
- }
3787
- });
3788
- const cacheKey = createRuntimeReadyCacheKey(source, patcher.packageInfo?.rootPath);
3789
- const cached = runtimeReadyPromiseCache.get(cacheKey);
3790
- if (cached) return cached;
3791
- const task = ensureTailwindcssRuntimePatch(patcher, { clearRequireCache: true }).catch((error) => {
3792
- runtimeReadyPromiseCache.delete(cacheKey);
3793
- throw error;
3794
- });
3795
- runtimeReadyPromiseCache.set(cacheKey, task);
3796
- return task;
3797
- }
3798
3849
  function createTailwindV3Engine(source) {
3799
3850
  const runtimeReadyPromise = createRuntimeReadyPromise(source);
3800
3851
  let tailwindInternals;
@@ -3880,7 +3931,7 @@ function createTailwindV3Engine(source) {
3880
3931
  const requestedCandidates = mergeGenerateCandidates(source, options);
3881
3932
  if (requestedCandidates.size === 0) return generateOnce(source, options);
3882
3933
  const styleOptions = resolveStyleOptions(source, options.styleOptions);
3883
- const cacheKey = createIncrementalGenerateCacheKey(source, target, styleOptions, options.bareArbitraryValues);
3934
+ const cacheKey = createIncrementalGenerateCacheKey$1(source, target, styleOptions, options.bareArbitraryValues);
3884
3935
  const cached = incrementalGenerateCache.get(cacheKey);
3885
3936
  if (cached) {
3886
3937
  if (hasRemovedCandidates(cached.seenCandidates, requestedCandidates)) {
@@ -4040,4 +4091,4 @@ function resolveTailwindV3SourceFromPatcher(patcher) {
4040
4091
  return resolveTailwindV3Source(resolveTailwindV3SourceOptionsFromPatcher(patcher));
4041
4092
  }
4042
4093
  //#endregion
4043
- export { collectCssInlineSourceCandidates as $, normalizeTailwindV3CssEntrySource as A, splitTailwindV4GeneratedCssBySourceOrder as B, hasLocalCssImport as C, normalizeTailwindConfigDirectives as D, hasTailwindSourceDirectives as E, createCssAppend as F, prependConfigDirective as G, stripTailwindBanner as H, hasTailwindGeneratedCss as I, transformTailwindV4CssToWeapp as J, createTailwindV4Engine$1 as K, hasTailwindGeneratedCssMarkers as L, removeTailwindSourceDirectives as M, resolveCssEntrySource as N, normalizeTailwindSourceDirectives as O, VITE_MARKER_RE as P, FULL_SOURCE_SCAN_EXTENSION_RE as Q, splitGeneratorPlaceholderCssBySourceOrder as R, resolveTailwindV4SourceOptionsFromPatcher as S, hasTailwindRootDirectives as T, stripTailwindBanners as U, stripGeneratorPlaceholderMarkers as V, normalizeConfigDirective as W, loadTailwindV4DesignSystem as X, filterUnsupportedMiniProgramTailwindV4Candidates as Y, DEFAULT_SOURCE_SCAN_EXTENSIONS as Z, resolveViteSourceScanEntries as _, findNearestPackageRoot as _t, transformTailwindV3CssByTarget as a, resolveCssSourceEntries as at, resolveTailwindV4SourceFromPatchOptions as b, getRuntimeClassSetCacheEntry as c, toPosixPath as ct, invalidateRuntimeClassSet as d, readInstalledPackageMajorVersion as dt, createSourceScanPattern as et, runtimeSignaturePatchersSymbol as f, findTailwindConfig as ft, resolveTailwindV4EntriesFromCssCached as g, omitUndefined as gt, resolveTailwindV4EntriesFromCss as h, resolveBooleanObjectOption as ht, createTailwindV3Engine as i, parseConfigParam$1 as it, parseImportRequest as j, normalizeTailwindSourceForGenerator as k, getRuntimeClassSetSignature as l, createDebug as lt, discoverTailwindV4CssEntries as m, normalizeStringListOption as mt, resolveTailwindV3SourceFromPatcher as n, isFileMatchedByTailwindSourceEntries as nt, transformTailwindV3CssToWeapp as o, resolveSourceScanPath as ot, createViteSourceScanMatcher as p, resolveTailwindcssOptions as pt, transformTailwindV4CssByTarget as q, resolveTailwindV3SourceOptionsFromPatcher as r, normalizeLegacyContentEntries as rt, ensureTailwindcssRuntimePatch as s, resolveTailwindV4CssSourceBase as st, resolveTailwindV3Source as t, expandTailwindSourceEntries as tt, getRuntimeClassSetSignatureWithSources as u, createTailwindcssPatcher as ut, resolveViteTailwindV4CssDependencies as v, findWorkspacePackageDir as vt, hasTailwindApplyDirective as w, resolveTailwindV4SourceFromPatcher as x, resolveTailwindV4Source$1 as y, findWorkspaceRoot as yt, splitTailwindGeneratedCssByBanner as z };
4094
+ export { createSourceScanPattern as $, normalizeTailwindV3CssEntrySource as A, splitTailwindV4GeneratedCssBySourceOrder as B, hasLocalCssImport as C, normalizeTailwindConfigDirectives as D, hasTailwindSourceDirectives as E, createCssAppend as F, prependConfigDirective as G, stripTailwindBanner as H, hasTailwindGeneratedCss as I, transformTailwindV4CssToWeapp as J, createTailwindV4Engine$1 as K, hasTailwindGeneratedCssMarkers as L, removeTailwindSourceDirectives as M, resolveCssEntrySource as N, normalizeTailwindSourceDirectives as O, VITE_MARKER_RE as P, FULL_SOURCE_SCAN_EXTENSION_RE as Q, splitGeneratorPlaceholderCssBySourceOrder as R, resolveTailwindV4SourceOptionsFromPatcher as S, hasTailwindRootDirectives as T, stripTailwindBanners as U, stripGeneratorPlaceholderMarkers as V, normalizeConfigDirective as W, loadTailwindV4DesignSystem as X, filterUnsupportedMiniProgramTailwindV4Candidates as Y, DEFAULT_SOURCE_SCAN_EXTENSIONS as Z, resolveTailwindV4EntriesFromCssCached as _, findWorkspacePackageDir as _t, transformTailwindV3CssByTarget as a, resolveSourceScanPath as at, resolveTailwindV4SourceFromPatchOptions as b, getRuntimeClassSetCacheEntry as c, collectCssInlineSourceCandidates as ct, invalidateRuntimeClassSet as d, readInstalledPackageMajorVersion as dt, expandTailwindSourceEntries as et, runtimeSignaturePatchersSymbol as f, findTailwindConfig as ft, resolveTailwindV4EntriesFromCss as g, findNearestPackageRoot as gt, discoverTailwindV4CssEntries as h, resolveBooleanObjectOption as ht, createTailwindV3Engine as i, resolveCssSourceEntries as it, parseImportRequest as j, normalizeTailwindSourceForGenerator as k, getRuntimeClassSetSignature as l, createDebug as lt, resolveViteSourceScanEntries as m, normalizeStringListOption as mt, resolveTailwindV3SourceFromPatcher as n, normalizeLegacyContentEntries as nt, transformTailwindV3CssToWeapp as o, resolveTailwindV4CssSourceBase as ot, createViteSourceScanMatcher as p, resolveTailwindcssOptions as pt, transformTailwindV4CssByTarget as q, resolveTailwindV3SourceOptionsFromPatcher as r, parseConfigParam$1 as rt, ensureTailwindcssRuntimePatch as s, toPosixPath as st, resolveTailwindV3Source as t, isFileMatchedByTailwindSourceEntries as tt, getRuntimeClassSetSignatureWithSources as u, createTailwindcssPatcher as ut, resolveViteTailwindV4CssDependencies as v, findWorkspaceRoot as vt, hasTailwindApplyDirective as w, resolveTailwindV4SourceFromPatcher as x, resolveTailwindV4Source$1 as y, omitUndefined as yt, splitTailwindGeneratedCssByBanner as z };