weapp-tailwindcss 5.5.0 → 5.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/bundlers/shared/css-imports.d.ts +1 -0
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/framework-user-css.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +6 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -1
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -0
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/entry-style-graph.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +1 -0
- package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +3 -1
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +1 -0
- package/dist/compiler/runtime-snapshot.d.ts +4 -1
- package/dist/{compiler-SwMb3lOX.cjs → compiler-BSMSbVVt.cjs} +6 -6
- package/dist/{compiler-B0YSc0DY.js → compiler-tHMcW3BT.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-imports-BFMU7Hpd.cjs → css-imports-DsCSPIj2.cjs} +29 -0
- package/dist/{css-loader-runtime-CSv0lKqV.cjs → css-loader-runtime-DGqsWVua.cjs} +2 -1
- package/dist/{defaults-B5ep0ojb.js → defaults-CKx-4LcW.js} +1 -1
- package/dist/{defaults-BI9j1znS.cjs → defaults-CiGsr8Xq.cjs} +1 -1
- package/dist/defaults.cjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/{final-css-cleanup-CmVYbXPr.js → final-css-cleanup-B0HUBtiE.js} +63 -37
- package/dist/final-css-cleanup-DSjczga3.cjs +138 -0
- package/dist/{generator-DsrQ9txU.cjs → generator-CCw17l0G.cjs} +72 -67
- package/dist/{generator-DyXTBPmE.js → generator-DxEsInLz.js} +61 -68
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-Dtc01FdI.cjs → gulp-C1r36Y_f.cjs} +6 -6
- package/dist/{gulp-CVUiPXPy.js → gulp-qGXKwQMZ.js} +5 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-DNxQm-bN.js → hmr-timing-DixZjtTS.js} +245 -183
- package/dist/{hmr-timing-3SdRVfZx.cjs → hmr-timing-DuIbach8.cjs} +5 -5
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{pipeline-helpers-DVrgv1HS.cjs → pipeline-helpers-CUwwOFt3.cjs} +5 -5
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -2
- package/dist/presets.js +2 -2
- package/dist/rspack.cjs +6 -3
- package/dist/rspack.js +6 -3
- package/dist/{scoped-generator-kRj_5Axx.js → scoped-generator-BJvL2CKZ.js} +3 -3
- package/dist/{scoped-generator-B7thnzzm.cjs → scoped-generator-CO9xZ06m.cjs} +3 -3
- package/dist/{source-candidate-scan-signature-CsP4BQNa.js → source-candidate-scan-signature-CgJi--lh.js} +2 -2
- package/dist/{source-candidate-scan-signature-B7cUxqqX.cjs → source-candidate-scan-signature-_UPwg8oJ.cjs} +2 -2
- package/dist/tailwindcss/v4-engine/css-import.d.ts +14 -0
- package/dist/{tailwindcss-BK9S7zuq.js → tailwindcss-D2joPNdN.js} +1 -1
- package/dist/{tailwindcss-C-jBBQfw.cjs → tailwindcss-DhaLV5a2.cjs} +1 -1
- package/dist/{transform-C0rWZblB.js → transform-BNtyKkZi.js} +14 -14
- package/dist/{transform-C7QxW-fV.cjs → transform-DAg85t9Z.cjs} +14 -14
- package/dist/uni-app-x/border-preflight.d.ts +18 -0
- package/dist/uni-app-x/style-asset/source-parser.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +2 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +2 -0
- package/dist/uni-app-x/vite/style-source.d.ts +21 -0
- package/dist/{v4-generation-core-DuIVZvRz.cjs → v4-generation-core-bOm8k4AY.cjs} +243 -181
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-0PsttwuR.js → vite-C_JJxZWl.js} +290 -69
- package/dist/{vite-CJbO-7AQ.cjs → vite-bJZi1V-l.cjs} +306 -66
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-DLZDrWdH.cjs → watch-dependencies-GbC14Rlt.cjs} +14 -11
- package/dist/weapp-tw-css-generation-loader.cjs +3 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +11 -10
- package/dist/weapp-tw-runtime-classset-loader.cjs +16 -11
- package/dist/{web-BFOkkJ-8.cjs → web-B4wa3xrE.cjs} +13 -8
- package/dist/{web-D8HSs56R.js → web-BiubXhxs.js} +11 -6
- package/dist/{webpack-DVtKeBq1.js → webpack-BDOQUv3J.js} +39 -24
- package/dist/{webpack-BWknqSDV.cjs → webpack-CsBe1G_1.cjs} +37 -23
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +7 -5
- package/dist/final-css-cleanup-BMlUDzik.cjs +0 -112
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
2
|
+
//#region src/bundlers/shared/final-css-cleanup.ts
|
|
3
|
+
function isCssWhitespace(code) {
|
|
4
|
+
return code === 9 || code === 10 || code === 12 || code === 13 || code === 32;
|
|
5
|
+
}
|
|
6
|
+
function isCssWordChar(code) {
|
|
7
|
+
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95;
|
|
8
|
+
}
|
|
9
|
+
const EMPTY_CSS_BLOCK_RE = /\{(?:[\t\n\f\r ]|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/;
|
|
10
|
+
function findCssPreludeStart(css, start, end) {
|
|
11
|
+
let cursor = start;
|
|
12
|
+
while (cursor < end) {
|
|
13
|
+
while (cursor < end && isCssWhitespace(css.charCodeAt(cursor))) cursor++;
|
|
14
|
+
if (css.charCodeAt(cursor) !== 47 || css.charCodeAt(cursor + 1) !== 42) return cursor;
|
|
15
|
+
const commentEnd = css.indexOf("*/", cursor + 2);
|
|
16
|
+
if (commentEnd < 0 || commentEnd + 2 > end) return end;
|
|
17
|
+
cursor = commentEnd + 2;
|
|
18
|
+
}
|
|
19
|
+
return end;
|
|
20
|
+
}
|
|
21
|
+
function isKeyframesAtRule(css, start, end) {
|
|
22
|
+
let cursor = start + 1;
|
|
23
|
+
if (css.charCodeAt(cursor) === 45) {
|
|
24
|
+
cursor++;
|
|
25
|
+
const prefixStart = cursor;
|
|
26
|
+
while (cursor < end && isCssWordChar(css.charCodeAt(cursor))) cursor++;
|
|
27
|
+
if (cursor === prefixStart || css.charCodeAt(cursor) !== 45) return false;
|
|
28
|
+
cursor++;
|
|
29
|
+
}
|
|
30
|
+
if (cursor + 9 > end || css.slice(cursor, cursor + 9).toLowerCase() !== "keyframes") return false;
|
|
31
|
+
return !isCssWordChar(css.charCodeAt(cursor + 9));
|
|
32
|
+
}
|
|
33
|
+
function hasEmptyCssBlockCandidate(css) {
|
|
34
|
+
if (!EMPTY_CSS_BLOCK_RE.test(css)) return false;
|
|
35
|
+
const blocks = [];
|
|
36
|
+
let parenthesisDepth = 0;
|
|
37
|
+
let quote = 0;
|
|
38
|
+
let squareBracketDepth = 0;
|
|
39
|
+
let statementStart = 0;
|
|
40
|
+
for (let index = 0; index < css.length; index++) {
|
|
41
|
+
const code = css.charCodeAt(index);
|
|
42
|
+
if (quote !== 0) {
|
|
43
|
+
if (code === 92) index++;
|
|
44
|
+
else if (code === quote) quote = 0;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (code === 34 || code === 39) {
|
|
48
|
+
quote = code;
|
|
49
|
+
if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (code === 92) {
|
|
53
|
+
if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
54
|
+
index++;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (code === 47 && css.charCodeAt(index + 1) === 42) {
|
|
58
|
+
const commentEnd = css.indexOf("*/", index + 2);
|
|
59
|
+
if (commentEnd < 0) return false;
|
|
60
|
+
index = commentEnd + 1;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (code === 40) {
|
|
64
|
+
parenthesisDepth++;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (code === 41 && parenthesisDepth > 0) {
|
|
68
|
+
parenthesisDepth--;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (code === 91) {
|
|
72
|
+
squareBracketDepth++;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (code === 93 && squareBracketDepth > 0) {
|
|
76
|
+
squareBracketDepth--;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (code === 123 && parenthesisDepth === 0 && squareBracketDepth === 0) {
|
|
80
|
+
const preludeStart = findCssPreludeStart(css, statementStart, index);
|
|
81
|
+
const isAtRule = css.charCodeAt(preludeStart) === 64;
|
|
82
|
+
const isKeyframesContainer = isAtRule && isKeyframesAtRule(css, preludeStart, index);
|
|
83
|
+
blocks.push({
|
|
84
|
+
hasContent: false,
|
|
85
|
+
isKeyframesContainer,
|
|
86
|
+
isKeyframeStep: !isAtRule && blocks[blocks.length - 1]?.isKeyframesContainer === true
|
|
87
|
+
});
|
|
88
|
+
statementStart = index + 1;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (code === 125 && parenthesisDepth === 0 && squareBracketDepth === 0) {
|
|
92
|
+
const block = blocks.pop();
|
|
93
|
+
if (!block) continue;
|
|
94
|
+
if (!block.hasContent && !block.isKeyframeStep) return true;
|
|
95
|
+
if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
96
|
+
statementStart = index + 1;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (code === 59 && parenthesisDepth === 0 && squareBracketDepth === 0) {
|
|
100
|
+
statementStart = index + 1;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (!isCssWhitespace(code) && blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 在小程序样式进入最终产物图时递归清理无语义的空 CSS 块。
|
|
109
|
+
*/
|
|
110
|
+
function finalizeMiniProgramCssStructure(css) {
|
|
111
|
+
const repaired = (0, _weapp_tailwindcss_postcss.repairTrailingUnclosedTailwindSourceMedia)(css);
|
|
112
|
+
if (!hasEmptyCssBlockCandidate(repaired)) return repaired;
|
|
113
|
+
try {
|
|
114
|
+
const root = _weapp_tailwindcss_postcss.postcss.parse(repaired);
|
|
115
|
+
let removed = 0;
|
|
116
|
+
let passRemoved = 0;
|
|
117
|
+
do {
|
|
118
|
+
passRemoved = (0, _weapp_tailwindcss_postcss.removeEmptyRules)(root) + (0, _weapp_tailwindcss_postcss.removeEmptyAtRules)(root);
|
|
119
|
+
removed += passRemoved;
|
|
120
|
+
} while (passRemoved > 0);
|
|
121
|
+
return removed > 0 ? root.toString() : repaired;
|
|
122
|
+
} catch {
|
|
123
|
+
return repaired;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
Object.defineProperty(exports, "finalizeMiniProgramCssStructure", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function() {
|
|
130
|
+
return finalizeMiniProgramCssStructure;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "hasEmptyCssBlockCandidate", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function() {
|
|
136
|
+
return hasEmptyCssBlockCandidate;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
@@ -12,6 +12,7 @@ let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
|
12
12
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
13
13
|
let lru_cache = require("lru-cache");
|
|
14
14
|
let node_module = require("node:module");
|
|
15
|
+
let _csstools_css_tokenizer = require("@csstools/css-tokenizer");
|
|
15
16
|
let node_fs_promises = require("node:fs/promises");
|
|
16
17
|
let micromatch = require("micromatch");
|
|
17
18
|
micromatch = require_rolldown_runtime.__toESM(micromatch, 1);
|
|
@@ -341,6 +342,47 @@ async function transformTailwindV4CssByTarget(css, target, options) {
|
|
|
341
342
|
return shouldUseUniAppWebRpxCompatibility(options?.appType) ? transformTailwindV4WebRpxCss(resolvedWebCss) : resolvedWebCss;
|
|
342
343
|
}
|
|
343
344
|
//#endregion
|
|
345
|
+
//#region src/tailwindcss/v4-engine/css-import.ts
|
|
346
|
+
function parseCssImportSpecifier(params) {
|
|
347
|
+
const tokens = (0, _csstools_css_tokenizer.tokenize)({ css: params }).filter((token) => token[0] !== _csstools_css_tokenizer.TokenType.Whitespace && token[0] !== _csstools_css_tokenizer.TokenType.Comment);
|
|
348
|
+
const first = tokens[0];
|
|
349
|
+
if (!first) return;
|
|
350
|
+
if (first[0] === _csstools_css_tokenizer.TokenType.String || first[0] === _csstools_css_tokenizer.TokenType.URL) return {
|
|
351
|
+
specifier: first[4].value,
|
|
352
|
+
raw: first[1],
|
|
353
|
+
quote: first[0] === _csstools_css_tokenizer.TokenType.String ? first[1][0] : void 0
|
|
354
|
+
};
|
|
355
|
+
if (first[0] === _csstools_css_tokenizer.TokenType.Function && first[4].value.toLowerCase() === "url" && tokens[1]?.[0] === _csstools_css_tokenizer.TokenType.String && tokens[2]?.[0] === _csstools_css_tokenizer.TokenType.CloseParen) return {
|
|
356
|
+
specifier: tokens[1][4].value,
|
|
357
|
+
raw: params.slice(first[2], tokens[2][3] + 1),
|
|
358
|
+
quote: tokens[1][1][0]
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function quoteCssImportSpecifier(file, quote = "\"") {
|
|
362
|
+
return `${quote}${(node_path.default.sep === "\\" || /^[a-z]:[\\/]|^\\\\/i.test(file) ? file.replaceAll("\\", "/") : file).replaceAll("\\", "\\\\").replaceAll(quote, `\\${quote}`).replaceAll("\n", "\\a ").replaceAll("\r", "\\d ")}${quote}`;
|
|
363
|
+
}
|
|
364
|
+
function isTailwindCssImport(params) {
|
|
365
|
+
const specifier = parseCssImportSpecifier(params)?.specifier;
|
|
366
|
+
if (!specifier) return false;
|
|
367
|
+
if (specifier === "tailwindcss" || specifier.startsWith("tailwindcss/")) return true;
|
|
368
|
+
const paths = specifier.includes("\\") ? node_path.default.win32 : node_path.default.posix;
|
|
369
|
+
return paths.basename(specifier) === "index.css" && paths.basename(paths.dirname(specifier)) === "tailwindcss";
|
|
370
|
+
}
|
|
371
|
+
function parseImportSourceParam(params) {
|
|
372
|
+
const tokens = (0, _csstools_css_tokenizer.tokenize)({ css: params }).filter((token) => token[0] !== _csstools_css_tokenizer.TokenType.Whitespace && token[0] !== _csstools_css_tokenizer.TokenType.Comment);
|
|
373
|
+
const index = tokens.findIndex((token) => token[0] === _csstools_css_tokenizer.TokenType.Function && token[4].value === "source");
|
|
374
|
+
const value = tokens[index + 1];
|
|
375
|
+
if (index < 0 || tokens[index + 2]?.[0] !== _csstools_css_tokenizer.TokenType.CloseParen) return;
|
|
376
|
+
if (value?.[0] === _csstools_css_tokenizer.TokenType.Ident && value[4].value === "none") return {
|
|
377
|
+
none: true,
|
|
378
|
+
sourcePath: void 0
|
|
379
|
+
};
|
|
380
|
+
return value?.[0] === _csstools_css_tokenizer.TokenType.String ? {
|
|
381
|
+
none: false,
|
|
382
|
+
sourcePath: value[4].value
|
|
383
|
+
} : void 0;
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
344
386
|
//#region src/tailwindcss/v4-engine/tailwind-v4-default-colors.ts
|
|
345
387
|
const TAILWIND_V4_COLOR_STEPS = [
|
|
346
388
|
"50",
|
|
@@ -730,7 +772,7 @@ function resolveTailwindV4ThemeCssFromImport(css) {
|
|
|
730
772
|
let resolved;
|
|
731
773
|
root.walkAtRules("import", (rule) => {
|
|
732
774
|
if (resolved) return;
|
|
733
|
-
const specifier = parseCssImportSpecifier
|
|
775
|
+
const specifier = parseCssImportSpecifier(rule.params)?.specifier;
|
|
734
776
|
if (!specifier || !node_path.default.isAbsolute(specifier) || node_path.default.basename(specifier) !== "index.css") return;
|
|
735
777
|
const themeCss = node_path.default.join(node_path.default.dirname(specifier), "theme.css");
|
|
736
778
|
if ((0, node_fs.existsSync)(themeCss)) resolved = themeCss;
|
|
@@ -762,15 +804,8 @@ function applyMiniProgramTailwindV4DefaultColorCss(css, source) {
|
|
|
762
804
|
if (insertionIndex === 0) return `${themeCss}\n${css}`;
|
|
763
805
|
return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
|
|
764
806
|
}
|
|
765
|
-
function parseCssImportSpecifier$2(params) {
|
|
766
|
-
const value = params.trim();
|
|
767
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
768
|
-
if (quoted) return quoted[2];
|
|
769
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
770
|
-
return url?.[2] ?? url?.[3];
|
|
771
|
-
}
|
|
772
807
|
function isTailwindCssPreflightImport(params) {
|
|
773
|
-
const specifier = parseCssImportSpecifier
|
|
808
|
+
const specifier = parseCssImportSpecifier(params)?.specifier;
|
|
774
809
|
return specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss/preflight";
|
|
775
810
|
}
|
|
776
811
|
function removeTailwindV4PreflightImports(css) {
|
|
@@ -827,7 +862,7 @@ function createCompatibleSource(source, target) {
|
|
|
827
862
|
};
|
|
828
863
|
}
|
|
829
864
|
//#endregion
|
|
830
|
-
//#region \0@oxc-project+runtime@0.
|
|
865
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
|
|
831
866
|
function _typeof(o) {
|
|
832
867
|
"@babel/helpers - typeof";
|
|
833
868
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -837,7 +872,7 @@ function _typeof(o) {
|
|
|
837
872
|
}, _typeof(o);
|
|
838
873
|
}
|
|
839
874
|
//#endregion
|
|
840
|
-
//#region \0@oxc-project+runtime@0.
|
|
875
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
|
|
841
876
|
function toPrimitive(t, r) {
|
|
842
877
|
if ("object" != _typeof(t) || !t) return t;
|
|
843
878
|
var e = t[Symbol.toPrimitive];
|
|
@@ -849,13 +884,13 @@ function toPrimitive(t, r) {
|
|
|
849
884
|
return ("string" === r ? String : Number)(t);
|
|
850
885
|
}
|
|
851
886
|
//#endregion
|
|
852
|
-
//#region \0@oxc-project+runtime@0.
|
|
887
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
|
|
853
888
|
function toPropertyKey(t) {
|
|
854
889
|
var i = toPrimitive(t, "string");
|
|
855
890
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
856
891
|
}
|
|
857
892
|
//#endregion
|
|
858
|
-
//#region \0@oxc-project+runtime@0.
|
|
893
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
|
|
859
894
|
function _defineProperty(e, r, t) {
|
|
860
895
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
861
896
|
value: t,
|
|
@@ -923,6 +958,7 @@ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
|
923
958
|
"ksml",
|
|
924
959
|
"ttml",
|
|
925
960
|
"qml",
|
|
961
|
+
"qxml",
|
|
926
962
|
"tyml",
|
|
927
963
|
"xhsml",
|
|
928
964
|
"swan",
|
|
@@ -954,6 +990,7 @@ const FULL_SOURCE_SCAN_EXTENSIONS = [
|
|
|
954
990
|
"ksml",
|
|
955
991
|
"ttml",
|
|
956
992
|
"qml",
|
|
993
|
+
"qxml",
|
|
957
994
|
"tyml",
|
|
958
995
|
"xhsml",
|
|
959
996
|
"swan",
|
|
@@ -979,19 +1016,19 @@ function toPosixPath(value) {
|
|
|
979
1016
|
return value.split(node_path.default.sep).join("/").split(node_path.default.win32.sep).join("/");
|
|
980
1017
|
}
|
|
981
1018
|
function resolveSourceScanPath(value) {
|
|
982
|
-
|
|
983
|
-
try {
|
|
984
|
-
return node_fs.realpathSync.native(resolved);
|
|
985
|
-
} catch {
|
|
986
|
-
return resolved;
|
|
987
|
-
}
|
|
1019
|
+
return resolveSourceScanPathWithApi(value, node_path.default);
|
|
988
1020
|
}
|
|
989
1021
|
function resolveSourceScanPathWithApi(value, pathApi) {
|
|
990
1022
|
const resolved = pathApi.resolve(value);
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
return
|
|
1023
|
+
let current = resolved;
|
|
1024
|
+
const missing = [];
|
|
1025
|
+
while (true) try {
|
|
1026
|
+
return pathApi.join(node_fs.realpathSync.native(current), ...missing.reverse());
|
|
1027
|
+
} catch (error) {
|
|
1028
|
+
const parent = pathApi.dirname(current);
|
|
1029
|
+
if (error.code !== "ENOENT" || parent === current) return resolved;
|
|
1030
|
+
missing.push(pathApi.basename(current));
|
|
1031
|
+
current = parent;
|
|
995
1032
|
}
|
|
996
1033
|
}
|
|
997
1034
|
function normalizeEntryPattern(entry) {
|
|
@@ -1208,25 +1245,6 @@ const TAILWIND_V4_DEFAULT_IGNORED_SOURCE_PATTERNS = [
|
|
|
1208
1245
|
"**/.env",
|
|
1209
1246
|
"**/.env.*"
|
|
1210
1247
|
];
|
|
1211
|
-
function parseImportSourceParam(params) {
|
|
1212
|
-
const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
|
|
1213
|
-
if (!match) return;
|
|
1214
|
-
return {
|
|
1215
|
-
none: match[1] === "none",
|
|
1216
|
-
sourcePath: match[3]
|
|
1217
|
-
};
|
|
1218
|
-
}
|
|
1219
|
-
function parseCssImportSpecifier$1(params) {
|
|
1220
|
-
const value = params.trim();
|
|
1221
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
1222
|
-
if (quoted) return quoted[2];
|
|
1223
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
1224
|
-
return url?.[2] ?? url?.[3];
|
|
1225
|
-
}
|
|
1226
|
-
function isTailwindCssImport(params) {
|
|
1227
|
-
const specifier = parseCssImportSpecifier$1(params);
|
|
1228
|
-
return specifier === "tailwindcss" || specifier?.startsWith("tailwindcss/") || specifier?.replaceAll("\\", "/").endsWith("/tailwindcss/index.css");
|
|
1229
|
-
}
|
|
1230
1248
|
function resolveSourceBase(base, sourcePath) {
|
|
1231
1249
|
return node_path.default.isAbsolute(sourcePath) ? sourcePath : node_path.default.resolve(base, sourcePath);
|
|
1232
1250
|
}
|
|
@@ -2968,31 +2986,6 @@ function isBarePackageSpecifier(specifier) {
|
|
|
2968
2986
|
function isPackageJsonImportSpecifier(specifier) {
|
|
2969
2987
|
return typeof specifier === "string" && specifier.startsWith("#");
|
|
2970
2988
|
}
|
|
2971
|
-
function parseCssImportSpecifier(params) {
|
|
2972
|
-
const value = params.trim();
|
|
2973
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
2974
|
-
if (quoted) {
|
|
2975
|
-
const specifier = quoted[2];
|
|
2976
|
-
if (specifier === void 0) return;
|
|
2977
|
-
return {
|
|
2978
|
-
quote: quoted[1],
|
|
2979
|
-
raw: quoted[0],
|
|
2980
|
-
specifier
|
|
2981
|
-
};
|
|
2982
|
-
}
|
|
2983
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
2984
|
-
if (!url) return;
|
|
2985
|
-
const specifier = url[2] ?? url[3];
|
|
2986
|
-
if (specifier === void 0) return;
|
|
2987
|
-
return {
|
|
2988
|
-
quote: url[1],
|
|
2989
|
-
raw: url[0],
|
|
2990
|
-
specifier
|
|
2991
|
-
};
|
|
2992
|
-
}
|
|
2993
|
-
function quoteCssImportSpecifier(specifier, quote = "\"") {
|
|
2994
|
-
return `${quote}${specifier.replaceAll("\\", "\\\\").replaceAll(quote, `\\${quote}`)}${quote}`;
|
|
2995
|
-
}
|
|
2996
2989
|
function createTailwindV4CssImportSpecifierSet(packageName) {
|
|
2997
2990
|
const specifiers = /* @__PURE__ */ new Set(["tailwindcss"]);
|
|
2998
2991
|
if (packageName && isBarePackageSpecifier(packageName)) specifiers.add(packageName);
|
|
@@ -3574,6 +3567,12 @@ Object.defineProperty(exports, "parseConfigParam", {
|
|
|
3574
3567
|
return parseConfigParam;
|
|
3575
3568
|
}
|
|
3576
3569
|
});
|
|
3570
|
+
Object.defineProperty(exports, "parseCssImportSpecifier", {
|
|
3571
|
+
enumerable: true,
|
|
3572
|
+
get: function() {
|
|
3573
|
+
return parseCssImportSpecifier;
|
|
3574
|
+
}
|
|
3575
|
+
});
|
|
3577
3576
|
Object.defineProperty(exports, "parseImportRequest", {
|
|
3578
3577
|
enumerable: true,
|
|
3579
3578
|
get: function() {
|
|
@@ -3592,6 +3591,12 @@ Object.defineProperty(exports, "prependConfigDirective", {
|
|
|
3592
3591
|
return prependConfigDirective;
|
|
3593
3592
|
}
|
|
3594
3593
|
});
|
|
3594
|
+
Object.defineProperty(exports, "quoteCssImportSpecifier", {
|
|
3595
|
+
enumerable: true,
|
|
3596
|
+
get: function() {
|
|
3597
|
+
return quoteCssImportSpecifier;
|
|
3598
|
+
}
|
|
3599
|
+
});
|
|
3595
3600
|
Object.defineProperty(exports, "removeMiniProgramInteractiveSelectors", {
|
|
3596
3601
|
enumerable: true,
|
|
3597
3602
|
get: function() {
|
|
@@ -8,6 +8,7 @@ import process from "node:process";
|
|
|
8
8
|
import { createTailwindGenerationSession, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
9
9
|
import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss as finalizeMiniProgramCss$1, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, selectorContainsPseudoClass, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
10
10
|
import { LRUCache } from "lru-cache";
|
|
11
|
+
import { TokenType, tokenize } from "@csstools/css-tokenizer";
|
|
11
12
|
import { stat } from "node:fs/promises";
|
|
12
13
|
import micromatch from "micromatch";
|
|
13
14
|
//#region src/runtime-branch/generator-target-env.ts
|
|
@@ -336,6 +337,47 @@ async function transformTailwindV4CssByTarget(css, target, options) {
|
|
|
336
337
|
return shouldUseUniAppWebRpxCompatibility(options?.appType) ? transformTailwindV4WebRpxCss(resolvedWebCss) : resolvedWebCss;
|
|
337
338
|
}
|
|
338
339
|
//#endregion
|
|
340
|
+
//#region src/tailwindcss/v4-engine/css-import.ts
|
|
341
|
+
function parseCssImportSpecifier(params) {
|
|
342
|
+
const tokens = tokenize({ css: params }).filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);
|
|
343
|
+
const first = tokens[0];
|
|
344
|
+
if (!first) return;
|
|
345
|
+
if (first[0] === TokenType.String || first[0] === TokenType.URL) return {
|
|
346
|
+
specifier: first[4].value,
|
|
347
|
+
raw: first[1],
|
|
348
|
+
quote: first[0] === TokenType.String ? first[1][0] : void 0
|
|
349
|
+
};
|
|
350
|
+
if (first[0] === TokenType.Function && first[4].value.toLowerCase() === "url" && tokens[1]?.[0] === TokenType.String && tokens[2]?.[0] === TokenType.CloseParen) return {
|
|
351
|
+
specifier: tokens[1][4].value,
|
|
352
|
+
raw: params.slice(first[2], tokens[2][3] + 1),
|
|
353
|
+
quote: tokens[1][1][0]
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function quoteCssImportSpecifier(file, quote = "\"") {
|
|
357
|
+
return `${quote}${(path.sep === "\\" || /^[a-z]:[\\/]|^\\\\/i.test(file) ? file.replaceAll("\\", "/") : file).replaceAll("\\", "\\\\").replaceAll(quote, `\\${quote}`).replaceAll("\n", "\\a ").replaceAll("\r", "\\d ")}${quote}`;
|
|
358
|
+
}
|
|
359
|
+
function isTailwindCssImport(params) {
|
|
360
|
+
const specifier = parseCssImportSpecifier(params)?.specifier;
|
|
361
|
+
if (!specifier) return false;
|
|
362
|
+
if (specifier === "tailwindcss" || specifier.startsWith("tailwindcss/")) return true;
|
|
363
|
+
const paths = specifier.includes("\\") ? path.win32 : path.posix;
|
|
364
|
+
return paths.basename(specifier) === "index.css" && paths.basename(paths.dirname(specifier)) === "tailwindcss";
|
|
365
|
+
}
|
|
366
|
+
function parseImportSourceParam(params) {
|
|
367
|
+
const tokens = tokenize({ css: params }).filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);
|
|
368
|
+
const index = tokens.findIndex((token) => token[0] === TokenType.Function && token[4].value === "source");
|
|
369
|
+
const value = tokens[index + 1];
|
|
370
|
+
if (index < 0 || tokens[index + 2]?.[0] !== TokenType.CloseParen) return;
|
|
371
|
+
if (value?.[0] === TokenType.Ident && value[4].value === "none") return {
|
|
372
|
+
none: true,
|
|
373
|
+
sourcePath: void 0
|
|
374
|
+
};
|
|
375
|
+
return value?.[0] === TokenType.String ? {
|
|
376
|
+
none: false,
|
|
377
|
+
sourcePath: value[4].value
|
|
378
|
+
} : void 0;
|
|
379
|
+
}
|
|
380
|
+
//#endregion
|
|
339
381
|
//#region src/tailwindcss/v4-engine/tailwind-v4-default-colors.ts
|
|
340
382
|
const TAILWIND_V4_COLOR_STEPS = [
|
|
341
383
|
"50",
|
|
@@ -725,7 +767,7 @@ function resolveTailwindV4ThemeCssFromImport(css) {
|
|
|
725
767
|
let resolved;
|
|
726
768
|
root.walkAtRules("import", (rule) => {
|
|
727
769
|
if (resolved) return;
|
|
728
|
-
const specifier = parseCssImportSpecifier
|
|
770
|
+
const specifier = parseCssImportSpecifier(rule.params)?.specifier;
|
|
729
771
|
if (!specifier || !path.isAbsolute(specifier) || path.basename(specifier) !== "index.css") return;
|
|
730
772
|
const themeCss = path.join(path.dirname(specifier), "theme.css");
|
|
731
773
|
if (existsSync(themeCss)) resolved = themeCss;
|
|
@@ -757,15 +799,8 @@ function applyMiniProgramTailwindV4DefaultColorCss(css, source) {
|
|
|
757
799
|
if (insertionIndex === 0) return `${themeCss}\n${css}`;
|
|
758
800
|
return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
|
|
759
801
|
}
|
|
760
|
-
function parseCssImportSpecifier$2(params) {
|
|
761
|
-
const value = params.trim();
|
|
762
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
763
|
-
if (quoted) return quoted[2];
|
|
764
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
765
|
-
return url?.[2] ?? url?.[3];
|
|
766
|
-
}
|
|
767
802
|
function isTailwindCssPreflightImport(params) {
|
|
768
|
-
const specifier = parseCssImportSpecifier
|
|
803
|
+
const specifier = parseCssImportSpecifier(params)?.specifier;
|
|
769
804
|
return specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss/preflight";
|
|
770
805
|
}
|
|
771
806
|
function removeTailwindV4PreflightImports(css) {
|
|
@@ -822,7 +857,7 @@ function createCompatibleSource(source, target) {
|
|
|
822
857
|
};
|
|
823
858
|
}
|
|
824
859
|
//#endregion
|
|
825
|
-
//#region \0@oxc-project+runtime@0.
|
|
860
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
|
|
826
861
|
function _typeof(o) {
|
|
827
862
|
"@babel/helpers - typeof";
|
|
828
863
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -832,7 +867,7 @@ function _typeof(o) {
|
|
|
832
867
|
}, _typeof(o);
|
|
833
868
|
}
|
|
834
869
|
//#endregion
|
|
835
|
-
//#region \0@oxc-project+runtime@0.
|
|
870
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
|
|
836
871
|
function toPrimitive(t, r) {
|
|
837
872
|
if ("object" != _typeof(t) || !t) return t;
|
|
838
873
|
var e = t[Symbol.toPrimitive];
|
|
@@ -844,13 +879,13 @@ function toPrimitive(t, r) {
|
|
|
844
879
|
return ("string" === r ? String : Number)(t);
|
|
845
880
|
}
|
|
846
881
|
//#endregion
|
|
847
|
-
//#region \0@oxc-project+runtime@0.
|
|
882
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
|
|
848
883
|
function toPropertyKey(t) {
|
|
849
884
|
var i = toPrimitive(t, "string");
|
|
850
885
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
851
886
|
}
|
|
852
887
|
//#endregion
|
|
853
|
-
//#region \0@oxc-project+runtime@0.
|
|
888
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
|
|
854
889
|
function _defineProperty(e, r, t) {
|
|
855
890
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
856
891
|
value: t,
|
|
@@ -918,6 +953,7 @@ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
|
918
953
|
"ksml",
|
|
919
954
|
"ttml",
|
|
920
955
|
"qml",
|
|
956
|
+
"qxml",
|
|
921
957
|
"tyml",
|
|
922
958
|
"xhsml",
|
|
923
959
|
"swan",
|
|
@@ -949,6 +985,7 @@ const FULL_SOURCE_SCAN_EXTENSIONS = [
|
|
|
949
985
|
"ksml",
|
|
950
986
|
"ttml",
|
|
951
987
|
"qml",
|
|
988
|
+
"qxml",
|
|
952
989
|
"tyml",
|
|
953
990
|
"xhsml",
|
|
954
991
|
"swan",
|
|
@@ -974,19 +1011,19 @@ function toPosixPath(value) {
|
|
|
974
1011
|
return value.split(path.sep).join("/").split(path.win32.sep).join("/");
|
|
975
1012
|
}
|
|
976
1013
|
function resolveSourceScanPath(value) {
|
|
977
|
-
|
|
978
|
-
try {
|
|
979
|
-
return realpathSync.native(resolved);
|
|
980
|
-
} catch {
|
|
981
|
-
return resolved;
|
|
982
|
-
}
|
|
1014
|
+
return resolveSourceScanPathWithApi(value, path);
|
|
983
1015
|
}
|
|
984
1016
|
function resolveSourceScanPathWithApi(value, pathApi) {
|
|
985
1017
|
const resolved = pathApi.resolve(value);
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
return
|
|
1018
|
+
let current = resolved;
|
|
1019
|
+
const missing = [];
|
|
1020
|
+
while (true) try {
|
|
1021
|
+
return pathApi.join(realpathSync.native(current), ...missing.reverse());
|
|
1022
|
+
} catch (error) {
|
|
1023
|
+
const parent = pathApi.dirname(current);
|
|
1024
|
+
if (error.code !== "ENOENT" || parent === current) return resolved;
|
|
1025
|
+
missing.push(pathApi.basename(current));
|
|
1026
|
+
current = parent;
|
|
990
1027
|
}
|
|
991
1028
|
}
|
|
992
1029
|
function normalizeEntryPattern(entry) {
|
|
@@ -1203,25 +1240,6 @@ const TAILWIND_V4_DEFAULT_IGNORED_SOURCE_PATTERNS = [
|
|
|
1203
1240
|
"**/.env",
|
|
1204
1241
|
"**/.env.*"
|
|
1205
1242
|
];
|
|
1206
|
-
function parseImportSourceParam(params) {
|
|
1207
|
-
const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
|
|
1208
|
-
if (!match) return;
|
|
1209
|
-
return {
|
|
1210
|
-
none: match[1] === "none",
|
|
1211
|
-
sourcePath: match[3]
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
function parseCssImportSpecifier$1(params) {
|
|
1215
|
-
const value = params.trim();
|
|
1216
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
1217
|
-
if (quoted) return quoted[2];
|
|
1218
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
1219
|
-
return url?.[2] ?? url?.[3];
|
|
1220
|
-
}
|
|
1221
|
-
function isTailwindCssImport(params) {
|
|
1222
|
-
const specifier = parseCssImportSpecifier$1(params);
|
|
1223
|
-
return specifier === "tailwindcss" || specifier?.startsWith("tailwindcss/") || specifier?.replaceAll("\\", "/").endsWith("/tailwindcss/index.css");
|
|
1224
|
-
}
|
|
1225
1243
|
function resolveSourceBase(base, sourcePath) {
|
|
1226
1244
|
return path.isAbsolute(sourcePath) ? sourcePath : path.resolve(base, sourcePath);
|
|
1227
1245
|
}
|
|
@@ -2959,31 +2977,6 @@ function isBarePackageSpecifier(specifier) {
|
|
|
2959
2977
|
function isPackageJsonImportSpecifier(specifier) {
|
|
2960
2978
|
return typeof specifier === "string" && specifier.startsWith("#");
|
|
2961
2979
|
}
|
|
2962
|
-
function parseCssImportSpecifier(params) {
|
|
2963
|
-
const value = params.trim();
|
|
2964
|
-
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
2965
|
-
if (quoted) {
|
|
2966
|
-
const specifier = quoted[2];
|
|
2967
|
-
if (specifier === void 0) return;
|
|
2968
|
-
return {
|
|
2969
|
-
quote: quoted[1],
|
|
2970
|
-
raw: quoted[0],
|
|
2971
|
-
specifier
|
|
2972
|
-
};
|
|
2973
|
-
}
|
|
2974
|
-
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
2975
|
-
if (!url) return;
|
|
2976
|
-
const specifier = url[2] ?? url[3];
|
|
2977
|
-
if (specifier === void 0) return;
|
|
2978
|
-
return {
|
|
2979
|
-
quote: url[1],
|
|
2980
|
-
raw: url[0],
|
|
2981
|
-
specifier
|
|
2982
|
-
};
|
|
2983
|
-
}
|
|
2984
|
-
function quoteCssImportSpecifier(specifier, quote = "\"") {
|
|
2985
|
-
return `${quote}${specifier.replaceAll("\\", "\\\\").replaceAll(quote, `\\${quote}`)}${quote}`;
|
|
2986
|
-
}
|
|
2987
2980
|
function createTailwindV4CssImportSpecifierSet(packageName) {
|
|
2988
2981
|
const specifiers = /* @__PURE__ */ new Set(["tailwindcss"]);
|
|
2989
2982
|
if (packageName && isBarePackageSpecifier(packageName)) specifiers.add(packageName);
|
|
@@ -3283,4 +3276,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
|
3283
3276
|
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3284
3277
|
}
|
|
3285
3278
|
//#endregion
|
|
3286
|
-
export { hasTailwindRootDirectives as $, resolveBooleanObjectOption as A, resolveTailwindV4CssSourceBase as At, removeUnsupportedMiniProgramAtRules as B,
|
|
3279
|
+
export { hasTailwindRootDirectives as $, resolveBooleanObjectOption as A, resolveTailwindV4CssSourceBase as At, removeUnsupportedMiniProgramAtRules as B, shouldUseUniAppWebRpxCompatibility as Bt, findWorkspacePackageDir as C, expandTailwindSourceEntries as Ct, normalizeTailwindcssRuntimeOptions as D, parseConfigParam as Dt, normalizeExtendLengthUnits as E, normalizeLegacyContentEntries as Et, stripTailwindSourceMediaFragments as F, transformTailwindV4CssByTarget as Ft, shouldFilterApplyOnlyGeneratedCss as G, removeTailwindV4GeneratedUserCssArtifacts as H, resolveValidTailwindV4Candidates$1 as Ht, stripUnmatchedTailwindSourceMediaCloseFragments as I, transformTailwindV4CssToWeapp as It, splitUserCssLayerBlocks as J, extractGeneratedCssForUserLayerSelectors as K, finalizeMiniProgramCss$1 as L, resolveCssMacroTailwindV4Source as Lt, isCommentOnlyCss as M, _defineProperty as Mt, removeMiniProgramInteractiveSelectors as N, parseCssImportSpecifier as Nt, resolveTailwindcssOptions as O, resolveCssSourceEntries as Ot, removeTailwindV4GeneratorAtRules as P, quoteCssImportSpecifier as Pt, hasTailwindNonRootGenerationDirectives as Q, hasMiniProgramCssSpecificityPlaceholders as R, getTailwindV4IncrementalGenerateCacheStats as Rt, findNearestPackageRoot as S, FULL_SOURCE_SCAN_PATTERN as St, omitUndefined as T, isFileMatchedByTailwindSourceEntries as Tt, filterApplyOnlyGeneratedCss as U, stripMiniProgramCssSpecificityPlaceholders as V, loadTailwindV4DesignSystem as Vt, normalizeEmptyTailwindCustomVariants as W, hasLocalCssImport as X, preferScopedGeneratedCssRules as Y, hasTailwindApplyDirective as Z, upsertTailwindV4CssSource as _, stripTailwindBanners as _t, resolveGeneratorRuntimeBranch as a, removeTailwindSourceDirectives as at, isTailwindV4CssEntry as b, createTailwindV4Engine$1 as bt, shouldUseNativeAppCssBranch as c, VITE_MARKER_RE as ct, resolveTailwindV4SourceFromRuntime as d, hasTailwindGeneratedCssMarkers as dt, hasTailwindSourceDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, splitGeneratorPlaceholderCssBySourceOrder as ft, removeTailwindV4CssSource as g, stripTailwindBanner as gt, hasConfiguredTailwindV4CssRoots as h, stripGeneratorPlaceholderMarkers as ht, normalizeWeappTailwindcssGeneratorOptions as i, parseImportRequest as it, transformGeneratorUserCss as j, toPosixPath as jt, normalizeStringListOption as k, resolveSourceScanPath as kt, resolveUniUtsPlatform as l, createCssAppend as lt, filterTailwindV4CssSourceRoots as m, splitTailwindV4GeneratedCssBySourceOrder as mt, createWeappTailwindcssGeneratorFromRuntime as n, normalizeTailwindSourceDirectives as nt, resolveRuntimeBranch as o, resolveCssEntrySource as ot, resolveTailwindV4SourceOptionsFromRuntime as p, splitTailwindGeneratedCssByBanner as pt, hasUserCssLayerBlocks as q, resolveTailwindSourceFromRuntime as r, normalizeTailwindSourceForGenerator as rt, shouldUseMiniProgramCssBranch as s, GENERATOR_PLACEHOLDER_MARKER_RE as st, createWeappTailwindcssGenerator as t, normalizeTailwindConfigDirectives as tt, resolveTailwindV4Source$1 as u, hasTailwindGeneratedCss as ut, groupCssEntriesByBase as v, normalizeConfigDirective as vt, findWorkspaceRoot as w, isFileExcludedByTailwindSourceEntries as wt, normalizeCssEntries as x, FULL_SOURCE_SCAN_EXTENSION_RE as xt, guessBasedirFromEntries as y, prependConfigDirective as yt, pruneMiniProgramGeneratedCss as z, filterUnsupportedMiniProgramTailwindV4Candidates as zt };
|
package/dist/generator.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
3
3
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
4
4
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
5
5
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
package/dist/generator.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ft as transformTailwindV4CssByTarget, It as transformTailwindV4CssToWeapp, Vt as loadTailwindV4DesignSystem, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-DxEsInLz.js";
|
|
2
2
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, loadTailwindV4DesignSystem, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
4
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
5
|
-
const require_compiler = require("./compiler-
|
|
2
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
3
|
+
const require_tailwindcss = require("./tailwindcss-DhaLV5a2.cjs");
|
|
4
|
+
const require_v4_generation_core = require("./v4-generation-core-bOm8k4AY.cjs");
|
|
5
|
+
const require_compiler = require("./compiler-BSMSbVVt.cjs");
|
|
6
6
|
const require_runtime_state = require("./runtime-state-BBQcA0n5.cjs");
|
|
7
7
|
const require_cache = require("./cache-CBJFB1HN.cjs");
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
9
|
-
const require_final_css_cleanup = require("./final-css-cleanup-
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-DuIbach8.cjs");
|
|
9
|
+
const require_final_css_cleanup = require("./final-css-cleanup-DSjczga3.cjs");
|
|
10
10
|
let node_fs = require("node:fs");
|
|
11
11
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
12
12
|
let node_path = require("node:path");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as hasTailwindRootDirectives,
|
|
2
|
-
import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-
|
|
3
|
-
import { A as createCssSourceTraceCacheSignature, B as createSourceCandidateCollector, E as hasBundlerGeneratedCssMarker, L as rewriteLocalCssImportRequestsForOutput, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, R as splitLocalCssImports, T as createBundlerGeneratedCssMarker, b as finalizeMiniProgramGeneratorCss, j as createCssTokenSourceMap, k as annotateCssSourceTrace, n as emitHmrTiming, r as generateTailwindV4Css, z as finalizeCompilerShadowRun } from "./hmr-timing-
|
|
4
|
-
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, M as invalidateCompilationScope, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-
|
|
5
|
-
import { i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, s as removeRuntimeCompilationBuildStateFiles, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-
|
|
1
|
+
import { $ as hasTailwindRootDirectives, Rt as getTailwindV4IncrementalGenerateCacheStats, _ as upsertTailwindV4CssSource, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, rt as normalizeTailwindSourceForGenerator, tt as normalizeTailwindConfigDirectives, yt as prependConfigDirective } from "./generator-DxEsInLz.js";
|
|
2
|
+
import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-D2joPNdN.js";
|
|
3
|
+
import { A as createCssSourceTraceCacheSignature, B as createSourceCandidateCollector, E as hasBundlerGeneratedCssMarker, L as rewriteLocalCssImportRequestsForOutput, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, R as splitLocalCssImports, T as createBundlerGeneratedCssMarker, b as finalizeMiniProgramGeneratorCss, j as createCssTokenSourceMap, k as annotateCssSourceTrace, n as emitHmrTiming, r as generateTailwindV4Css, z as finalizeCompilerShadowRun } from "./hmr-timing-DixZjtTS.js";
|
|
4
|
+
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, M as invalidateCompilationScope, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-tHMcW3BT.js";
|
|
5
|
+
import { i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, s as removeRuntimeCompilationBuildStateFiles, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-B0HUBtiE.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|