weapp-tailwindcss 4.7.5 → 4.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-E5LRICST.js → chunk-36GNZBVS.js} +35 -59
- package/dist/{chunk-R7GWRQDJ.js → chunk-3AAVIURI.js} +1 -1
- package/dist/{chunk-SJV6DCNZ.js → chunk-6WB6H5P4.js} +6 -6
- package/dist/{chunk-SCOGAO45.mjs → chunk-EGX7MMTE.mjs} +1 -1
- package/dist/{chunk-PUFKPENL.mjs → chunk-G4SYITSG.mjs} +5 -12
- package/dist/{chunk-24ADBRZN.js → chunk-JISOHATJ.js} +10 -10
- package/dist/{chunk-42FXROX4.mjs → chunk-MEX4EXZX.mjs} +2 -2
- package/dist/{chunk-GGD75A34.js → chunk-RTOKUKLA.js} +4 -4
- package/dist/{chunk-RLWIDWTA.js → chunk-SXYSWJRO.js} +14 -21
- package/dist/{chunk-TK5LOBHZ.mjs → chunk-UB5UEGVL.mjs} +1 -1
- package/dist/{chunk-WXBFAARR.js → chunk-USAH2CX5.js} +1 -1
- package/dist/{chunk-XEQBYGBX.mjs → chunk-VL24RIGE.mjs} +9 -33
- package/dist/{chunk-KZJLIZIK.mjs → chunk-XVJBQIVY.mjs} +1 -1
- package/dist/cli.js +10 -10
- package/dist/cli.mjs +3 -3
- package/dist/core.js +10 -10
- package/dist/core.mjs +3 -3
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/escape.js +1 -1
- package/dist/escape.mjs +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +6 -6
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +3 -3
- package/dist/presets.mjs +1 -1
- package/dist/types.d.mts +10 -11
- package/dist/types.d.ts +10 -11
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +13 -13
- package/dist/webpack4.mjs +3 -3
- package/package.json +7 -7
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var _chunkDWAEHRHNjs = require('./chunk-DWAEHRHN.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkRTOKUKLAjs = require('./chunk-RTOKUKLA.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkUSAH2CX5js = require('./chunk-USAH2CX5.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -109,26 +109,6 @@ function tryGetRuntimeClassSetSync(twPatcher) {
|
|
|
109
109
|
return void 0;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
async function mergeContentTokensIntoSet(twPatcher, target) {
|
|
113
|
-
if (typeof twPatcher.collectContentTokens !== "function") {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
try {
|
|
117
|
-
const report = await twPatcher.collectContentTokens();
|
|
118
|
-
const entries = _optionalChain([report, 'optionalAccess', _5 => _5.entries]);
|
|
119
|
-
if (!Array.isArray(entries)) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
for (const entry of entries) {
|
|
123
|
-
const candidate = _optionalChain([entry, 'optionalAccess', _6 => _6.rawCandidate]);
|
|
124
|
-
if (typeof candidate === "string" && candidate.length > 0) {
|
|
125
|
-
target.add(candidate);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
} catch (error) {
|
|
129
|
-
debug("collectContentTokens() failed, continuing without merged tokens: %O", error);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
112
|
async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
133
113
|
let activePatcher = twPatcher;
|
|
134
114
|
if (options.force && !options.skipRefresh) {
|
|
@@ -146,7 +126,6 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
146
126
|
}
|
|
147
127
|
const entry = getCacheEntry(activePatcher);
|
|
148
128
|
const signature = getTailwindConfigSignature(activePatcher);
|
|
149
|
-
const shouldAugmentWithTokens = options.force || !entry.value;
|
|
150
129
|
if (!options.force) {
|
|
151
130
|
if (entry.value && entry.signature === signature) {
|
|
152
131
|
return entry.value;
|
|
@@ -164,7 +143,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
164
143
|
}
|
|
165
144
|
try {
|
|
166
145
|
const result = await activePatcher.extract({ write: false });
|
|
167
|
-
if (_optionalChain([result, 'optionalAccess',
|
|
146
|
+
if (_optionalChain([result, 'optionalAccess', _5 => _5.classSet])) {
|
|
168
147
|
return result.classSet;
|
|
169
148
|
}
|
|
170
149
|
} catch (error) {
|
|
@@ -184,9 +163,6 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
184
163
|
entry.signature = signature;
|
|
185
164
|
try {
|
|
186
165
|
const resolved = await task;
|
|
187
|
-
if (shouldAugmentWithTokens) {
|
|
188
|
-
await mergeContentTokensIntoSet(activePatcher, resolved);
|
|
189
|
-
}
|
|
190
166
|
entry.value = resolved;
|
|
191
167
|
entry.promise = void 0;
|
|
192
168
|
entry.signature = signature;
|
|
@@ -288,13 +264,13 @@ function createCache(options) {
|
|
|
288
264
|
const nextHash = _nullishCoalesce(hash, () => ( cache.computeHash(rawSource)));
|
|
289
265
|
cache.calcHashValueChanged(cacheHashKey, nextHash);
|
|
290
266
|
const entry = cache.getHashValue(cacheHashKey);
|
|
291
|
-
hasChanged = _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
267
|
+
hasChanged = _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _6 => _6.changed]), () => ( true));
|
|
292
268
|
}
|
|
293
269
|
const readCache = _nullishCoalesce(resolveCache, () => ( (() => cache.get(key))));
|
|
294
270
|
if (!hasChanged) {
|
|
295
271
|
const cached = readCache();
|
|
296
272
|
if (cached !== void 0) {
|
|
297
|
-
await _optionalChain([onCacheHit, 'optionalCall',
|
|
273
|
+
await _optionalChain([onCacheHit, 'optionalCall', _7 => _7(cached)]);
|
|
298
274
|
return cached;
|
|
299
275
|
}
|
|
300
276
|
}
|
|
@@ -384,10 +360,10 @@ function createNameMatcher(list, { exact = false } = {}) {
|
|
|
384
360
|
const fuzzyMatcher = exact ? void 0 : buildFuzzyMatcher(fuzzyStrings);
|
|
385
361
|
const hasRegex = regexList.length > 0;
|
|
386
362
|
return (value) => {
|
|
387
|
-
if (exact && _optionalChain([exactStrings, 'optionalAccess',
|
|
363
|
+
if (exact && _optionalChain([exactStrings, 'optionalAccess', _8 => _8.has, 'call', _9 => _9(value)])) {
|
|
388
364
|
return true;
|
|
389
365
|
}
|
|
390
|
-
if (_optionalChain([fuzzyMatcher, 'optionalCall',
|
|
366
|
+
if (_optionalChain([fuzzyMatcher, 'optionalCall', _10 => _10(value)])) {
|
|
391
367
|
return true;
|
|
392
368
|
}
|
|
393
369
|
if (!hasRegex) {
|
|
@@ -553,10 +529,10 @@ function shouldTransformClassName(candidate, {
|
|
|
553
529
|
if (!classNameSet.has(candidate)) {
|
|
554
530
|
return false;
|
|
555
531
|
}
|
|
556
|
-
return !_optionalChain([jsPreserveClass, 'optionalCall',
|
|
532
|
+
return !_optionalChain([jsPreserveClass, 'optionalCall', _11 => _11(candidate)]);
|
|
557
533
|
}
|
|
558
534
|
function extractLiteralValue(path, { unescapeUnicode, arbitraryValues }) {
|
|
559
|
-
const allowDoubleQuotes = _optionalChain([arbitraryValues, 'optionalAccess',
|
|
535
|
+
const allowDoubleQuotes = _optionalChain([arbitraryValues, 'optionalAccess', _12 => _12.allowDoubleQuotes]);
|
|
560
536
|
let offset = 0;
|
|
561
537
|
let original;
|
|
562
538
|
if (path.isStringLiteral()) {
|
|
@@ -750,7 +726,7 @@ var JsModuleGraph = class {
|
|
|
750
726
|
continue;
|
|
751
727
|
}
|
|
752
728
|
if (exportPath.isExportNamedDeclaration()) {
|
|
753
|
-
const source = _optionalChain([exportPath, 'access',
|
|
729
|
+
const source = _optionalChain([exportPath, 'access', _13 => _13.node, 'access', _14 => _14.source, 'optionalAccess', _15 => _15.value]);
|
|
754
730
|
if (typeof source === "string") {
|
|
755
731
|
for (const spec of exportPath.get("specifiers")) {
|
|
756
732
|
if (!spec.isExportSpecifier()) {
|
|
@@ -817,7 +793,7 @@ var JsModuleGraph = class {
|
|
|
817
793
|
continue;
|
|
818
794
|
}
|
|
819
795
|
if (exportPath.isExportAllDeclaration()) {
|
|
820
|
-
const source = _optionalChain([exportPath, 'access',
|
|
796
|
+
const source = _optionalChain([exportPath, 'access', _16 => _16.node, 'access', _17 => _17.source, 'optionalAccess', _18 => _18.value]);
|
|
821
797
|
if (typeof source === "string") {
|
|
822
798
|
for (const exportName of names) {
|
|
823
799
|
propagate.push({
|
|
@@ -869,7 +845,7 @@ var JsModuleGraph = class {
|
|
|
869
845
|
}
|
|
870
846
|
for (const exportPath of state.analysis.exportDeclarations) {
|
|
871
847
|
if (exportPath.isExportAllDeclaration() || exportPath.isExportNamedDeclaration()) {
|
|
872
|
-
const source = _optionalChain([exportPath, 'access',
|
|
848
|
+
const source = _optionalChain([exportPath, 'access', _19 => _19.node, 'access', _20 => _20.source, 'optionalAccess', _21 => _21.value]);
|
|
873
849
|
if (typeof source === "string" && !dependencySpecifiers.has(source)) {
|
|
874
850
|
dependencySpecifiers.set(source, []);
|
|
875
851
|
}
|
|
@@ -1240,7 +1216,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1240
1216
|
const getEffectiveTagPath = (tagPath) => {
|
|
1241
1217
|
let current = tagPath;
|
|
1242
1218
|
while (true) {
|
|
1243
|
-
if (_optionalChain([current, 'access',
|
|
1219
|
+
if (_optionalChain([current, 'access', _22 => _22.isParenthesizedExpression, 'optionalCall', _23 => _23()]) || current.node.type === "ParenthesizedExpression") {
|
|
1244
1220
|
current = current.get("expression");
|
|
1245
1221
|
continue;
|
|
1246
1222
|
}
|
|
@@ -1252,7 +1228,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1252
1228
|
current = current.get("expression");
|
|
1253
1229
|
continue;
|
|
1254
1230
|
}
|
|
1255
|
-
if (_optionalChain([current, 'access',
|
|
1231
|
+
if (_optionalChain([current, 'access', _24 => _24.isTypeCastExpression, 'optionalCall', _25 => _25()])) {
|
|
1256
1232
|
current = current.get("expression");
|
|
1257
1233
|
continue;
|
|
1258
1234
|
}
|
|
@@ -1264,7 +1240,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1264
1240
|
continue;
|
|
1265
1241
|
}
|
|
1266
1242
|
}
|
|
1267
|
-
if (_optionalChain([current, 'access',
|
|
1243
|
+
if (_optionalChain([current, 'access', _26 => _26.isCallExpression, 'optionalCall', _27 => _27()]) || current.node.type === "CallExpression") {
|
|
1268
1244
|
const callee = current.get("callee");
|
|
1269
1245
|
current = callee;
|
|
1270
1246
|
continue;
|
|
@@ -1274,7 +1250,7 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
1274
1250
|
return current;
|
|
1275
1251
|
};
|
|
1276
1252
|
const evaluateTagPath = (tagPath) => {
|
|
1277
|
-
if (_optionalChain([tagPath, 'access',
|
|
1253
|
+
if (_optionalChain([tagPath, 'access', _28 => _28.isCallExpression, 'optionalCall', _29 => _29()]) || tagPath.node.type === "CallExpression") {
|
|
1278
1254
|
const calleePath = tagPath.get("callee");
|
|
1279
1255
|
return evaluateTagPath(calleePath);
|
|
1280
1256
|
}
|
|
@@ -1403,7 +1379,7 @@ function analyzeSource(ast, options, handler) {
|
|
|
1403
1379
|
const args = p.get("arguments");
|
|
1404
1380
|
if (Array.isArray(args) && args.length > 0) {
|
|
1405
1381
|
const first = args[0];
|
|
1406
|
-
if (_optionalChain([first, 'optionalAccess',
|
|
1382
|
+
if (_optionalChain([first, 'optionalAccess', _30 => _30.isStringLiteral, 'call', _31 => _31()])) {
|
|
1407
1383
|
requireCallPaths.push(first);
|
|
1408
1384
|
}
|
|
1409
1385
|
}
|
|
@@ -1628,21 +1604,21 @@ function createAttributeMatcher(entities) {
|
|
|
1628
1604
|
// src/wxml/whitespace.ts
|
|
1629
1605
|
var WHITESPACE_CODES = /* @__PURE__ */ new Set([
|
|
1630
1606
|
9,
|
|
1631
|
-
// \t
|
|
1607
|
+
// 制表符 \t
|
|
1632
1608
|
10,
|
|
1633
|
-
// \n
|
|
1609
|
+
// 换行符 \n
|
|
1634
1610
|
11,
|
|
1635
|
-
// \v
|
|
1611
|
+
// 垂直制表符 \v
|
|
1636
1612
|
12,
|
|
1637
|
-
// \f
|
|
1613
|
+
// 换页符 \f
|
|
1638
1614
|
13,
|
|
1639
|
-
// \r
|
|
1615
|
+
// 回车符 \r
|
|
1640
1616
|
32,
|
|
1641
|
-
//
|
|
1617
|
+
// 空格
|
|
1642
1618
|
160,
|
|
1643
|
-
// \u00A0
|
|
1619
|
+
// 不间断空格 \u00A0
|
|
1644
1620
|
65279
|
|
1645
|
-
// \uFEFF
|
|
1621
|
+
// 零宽无断行空格 \uFEFF
|
|
1646
1622
|
]);
|
|
1647
1623
|
function isWhitespace(char) {
|
|
1648
1624
|
if (char.length === 0) {
|
|
@@ -1797,7 +1773,7 @@ function generateCode(match, options = {}) {
|
|
|
1797
1773
|
if (t.isMemberExpression(path.parent)) {
|
|
1798
1774
|
return;
|
|
1799
1775
|
}
|
|
1800
|
-
if (t.isBinaryExpression(path.parent) && (t.isConditionalExpression(_optionalChain([path, 'access',
|
|
1776
|
+
if (t.isBinaryExpression(path.parent) && (t.isConditionalExpression(_optionalChain([path, 'access', _32 => _32.parentPath, 'optionalAccess', _33 => _33.parent])) || t.isLogicalExpression(_optionalChain([path, 'access', _34 => _34.parentPath, 'optionalAccess', _35 => _35.parent])))) {
|
|
1801
1777
|
return;
|
|
1802
1778
|
}
|
|
1803
1779
|
jsTokenUpdater.addToken(
|
|
@@ -1910,7 +1886,7 @@ async function customTemplateHandler(rawSource, options) {
|
|
|
1910
1886
|
}
|
|
1911
1887
|
const lowerName = name.toLowerCase();
|
|
1912
1888
|
const shouldHandleDefault = !disabledDefaultTemplateHandler && (lowerName === "class" || lowerName === "hover-class" || lowerName === "virtualhostclass");
|
|
1913
|
-
const shouldHandleCustom = _nullishCoalesce(_optionalChain([matchCustomAttribute, 'optionalCall',
|
|
1889
|
+
const shouldHandleCustom = _nullishCoalesce(_optionalChain([matchCustomAttribute, 'optionalCall', _36 => _36(tag, name)]), () => ( false));
|
|
1914
1890
|
if (!shouldHandleDefault && !shouldHandleCustom) {
|
|
1915
1891
|
return;
|
|
1916
1892
|
}
|
|
@@ -2105,11 +2081,11 @@ async function clearTailwindcssPatcherCache(patcher) {
|
|
|
2105
2081
|
if (!patcher) {
|
|
2106
2082
|
return;
|
|
2107
2083
|
}
|
|
2108
|
-
const cacheOptions = _optionalChain([patcher, 'access',
|
|
2084
|
+
const cacheOptions = _optionalChain([patcher, 'access', _37 => _37.options, 'optionalAccess', _38 => _38.cache]);
|
|
2109
2085
|
if (!cacheOptions || cacheOptions.enabled === false) {
|
|
2110
2086
|
return;
|
|
2111
2087
|
}
|
|
2112
|
-
const cachePath = _nullishCoalesce(cacheOptions.path, () => ( _optionalChain([patcher, 'access',
|
|
2088
|
+
const cachePath = _nullishCoalesce(cacheOptions.path, () => ( _optionalChain([patcher, 'access', _39 => _39.cacheStore, 'optionalAccess', _40 => _40.options, 'optionalAccess', _41 => _41.path])));
|
|
2113
2089
|
if (!cachePath) {
|
|
2114
2090
|
return;
|
|
2115
2091
|
}
|
|
@@ -2117,7 +2093,7 @@ async function clearTailwindcssPatcherCache(patcher) {
|
|
|
2117
2093
|
await _promises.rm.call(void 0, cachePath, { force: true });
|
|
2118
2094
|
} catch (error) {
|
|
2119
2095
|
const err = error;
|
|
2120
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
2096
|
+
if (_optionalChain([err, 'optionalAccess', _42 => _42.code]) === "ENOENT") {
|
|
2121
2097
|
return;
|
|
2122
2098
|
}
|
|
2123
2099
|
_logger.logger.debug("failed to clear tailwindcss patcher cache: %s %O", cachePath, err);
|
|
@@ -2126,13 +2102,13 @@ async function clearTailwindcssPatcherCache(patcher) {
|
|
|
2126
2102
|
function getCompilerContext(opts) {
|
|
2127
2103
|
const ctx = _chunkUW3WHSZ5js.defuOverrideArray.call(void 0,
|
|
2128
2104
|
opts,
|
|
2129
|
-
|
|
2105
|
+
_chunkUSAH2CX5js.getDefaultOptions.call(void 0, ),
|
|
2130
2106
|
{}
|
|
2131
2107
|
);
|
|
2132
2108
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2133
2109
|
applyLoggerLevel(ctx.logLevel);
|
|
2134
|
-
const twPatcher =
|
|
2135
|
-
if (_optionalChain([twPatcher, 'access',
|
|
2110
|
+
const twPatcher = _chunkRTOKUKLAjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2111
|
+
if (_optionalChain([twPatcher, 'access', _43 => _43.packageInfo, 'optionalAccess', _44 => _44.version])) {
|
|
2136
2112
|
_logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(twPatcher.packageInfo.version)))}`);
|
|
2137
2113
|
} else {
|
|
2138
2114
|
_logger.logger.warn(`${_logger.pc.cyanBright("Tailwind CSS")} \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u7248\u672C\u68C0\u6D4B\u4E0E\u8865\u4E01\u5E94\u7528\u3002`);
|
|
@@ -2155,11 +2131,11 @@ function getCompilerContext(opts) {
|
|
|
2155
2131
|
ctx.twPatcher = twPatcher;
|
|
2156
2132
|
const refreshTailwindcssPatcher = async (options) => {
|
|
2157
2133
|
const previousPatcher = ctx.twPatcher;
|
|
2158
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2134
|
+
if (_optionalChain([options, 'optionalAccess', _45 => _45.clearCache]) !== false) {
|
|
2159
2135
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2160
2136
|
}
|
|
2161
2137
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2162
|
-
const nextPatcher =
|
|
2138
|
+
const nextPatcher = _chunkRTOKUKLAjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2163
2139
|
Object.assign(previousPatcher, nextPatcher);
|
|
2164
2140
|
ctx.twPatcher = previousPatcher;
|
|
2165
2141
|
return previousPatcher;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.53.1_@types+node@24.10.0__@swc+core@1.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.53.1_@types+node@24.10.0__@swc+core@1.15.0_@swc+h_70727109299a4b8f070696769bd0e0a9/node_modules/tsup/assets/cjs_shims.js
|
|
9
9
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
10
10
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
11
11
|
|
|
@@ -7,7 +7,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk36GNZBVSjs = require('./chunk-36GNZBVS.js');
|
|
11
11
|
|
|
12
12
|
// src/bundlers/gulp/index.ts
|
|
13
13
|
var _buffer = require('buffer');
|
|
@@ -15,21 +15,21 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
15
15
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
16
16
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
17
17
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
18
|
-
var debug =
|
|
18
|
+
var debug = _chunk36GNZBVSjs.createDebug.call(void 0, );
|
|
19
19
|
var Transform = _stream2.default.Transform;
|
|
20
20
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
21
|
+
const opts = _chunk36GNZBVSjs.getCompilerContext.call(void 0, options);
|
|
22
22
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
23
|
let runtimeSet = /* @__PURE__ */ new Set();
|
|
24
24
|
const runtimeState = {
|
|
25
25
|
twPatcher: initialTwPatcher,
|
|
26
|
-
patchPromise:
|
|
26
|
+
patchPromise: _chunk36GNZBVSjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
27
27
|
refreshTailwindcssPatcher
|
|
28
28
|
};
|
|
29
29
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
30
30
|
let runtimeSetInitialized = false;
|
|
31
31
|
async function refreshRuntimeState(force) {
|
|
32
|
-
await
|
|
32
|
+
await _chunk36GNZBVSjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
33
33
|
}
|
|
34
34
|
async function refreshRuntimeSet(force = false) {
|
|
35
35
|
await refreshRuntimeState(force);
|
|
@@ -37,7 +37,7 @@ function createPlugins(options = {}) {
|
|
|
37
37
|
if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
|
|
38
38
|
return runtimeSet;
|
|
39
39
|
}
|
|
40
|
-
runtimeSet = await
|
|
40
|
+
runtimeSet = await _chunk36GNZBVSjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
41
41
|
runtimeSetInitialized = true;
|
|
42
42
|
return runtimeSet;
|
|
43
43
|
}
|
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.53.1_@types+node@24.10.0__@swc+core@1.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.53.1_@types+node@24.10.0__@swc+core@1.15.0_@swc+h_70727109299a4b8f070696769bd0e0a9/node_modules/tsup/assets/esm_shims.js
|
|
9
9
|
import path from "path";
|
|
10
10
|
import { fileURLToPath } from "url";
|
|
11
11
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
refreshTailwindRuntimeState,
|
|
17
17
|
toCustomAttributesEntities,
|
|
18
18
|
vitePluginName
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VL24RIGE.mjs";
|
|
20
20
|
import {
|
|
21
21
|
replaceWxml
|
|
22
22
|
} from "./chunk-VSRDBMDB.mjs";
|
|
@@ -562,18 +562,16 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
562
562
|
map: {
|
|
563
563
|
inline: false,
|
|
564
564
|
annotation: false,
|
|
565
|
-
//
|
|
566
|
-
// we cannot obtain content of them, so this needs to be enabled
|
|
565
|
+
// PostCSS 可能返回虚拟文件,因此需要启用这一项以获取源内容
|
|
567
566
|
sourcesContent: true
|
|
568
|
-
//
|
|
567
|
+
// 若上游预处理器已经生成 source map,sources 中可能出现重复条目
|
|
569
568
|
}
|
|
570
569
|
}
|
|
571
570
|
}
|
|
572
571
|
});
|
|
573
572
|
const rawPostcssMap = postcssResult.map.toJSON();
|
|
574
573
|
const postcssMap = await formatPostcssSourceMap(
|
|
575
|
-
// version
|
|
576
|
-
// but actually it is a number
|
|
574
|
+
// rawPostcssMap.version 类型声明为字符串,实际需要数值
|
|
577
575
|
rawPostcssMap,
|
|
578
576
|
cleanUrl(id)
|
|
579
577
|
);
|
|
@@ -601,12 +599,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
601
599
|
const isWatchBuild = resolvedConfig?.command === "build" && !!resolvedConfig.build?.watch;
|
|
602
600
|
const isNonWatchBuild = resolvedConfig?.command === "build" && !resolvedConfig.build?.watch;
|
|
603
601
|
const shouldForceRefresh = isServeCommand || isWatchBuild || isNonWatchBuild;
|
|
604
|
-
|
|
605
|
-
if (shouldForceRefresh) {
|
|
606
|
-
currentRuntimeSet = await ensureRuntimeClassSet(true);
|
|
607
|
-
} else {
|
|
608
|
-
currentRuntimeSet = await ensureRuntimeClassSet();
|
|
609
|
-
}
|
|
602
|
+
const currentRuntimeSet = shouldForceRefresh ? await ensureRuntimeClassSet(true) : await ensureRuntimeClassSet();
|
|
610
603
|
const extraOptions = customAttributesEntities.length > 0 || disabledDefaultTemplateHandler ? {
|
|
611
604
|
customAttributesEntities,
|
|
612
605
|
disabledDefaultTemplateHandler
|
|
@@ -16,7 +16,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk36GNZBVSjs = require('./chunk-36GNZBVS.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
@@ -25,10 +25,10 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
|
25
25
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
26
26
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
27
27
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
28
|
-
var debug =
|
|
28
|
+
var debug = _chunk36GNZBVSjs.createDebug.call(void 0, );
|
|
29
29
|
var UnifiedWebpackPluginV5 = class {
|
|
30
30
|
constructor(options = {}) {
|
|
31
|
-
this.options =
|
|
31
|
+
this.options = _chunk36GNZBVSjs.getCompilerContext.call(void 0, options);
|
|
32
32
|
this.appType = this.options.appType;
|
|
33
33
|
}
|
|
34
34
|
apply(compiler) {
|
|
@@ -52,18 +52,18 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
52
52
|
}
|
|
53
53
|
const runtimeState = {
|
|
54
54
|
twPatcher: initialTwPatcher,
|
|
55
|
-
patchPromise:
|
|
55
|
+
patchPromise: _chunk36GNZBVSjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
56
56
|
refreshTailwindcssPatcher
|
|
57
57
|
};
|
|
58
58
|
const refreshRuntimeState = async (force) => {
|
|
59
|
-
await
|
|
59
|
+
await _chunk36GNZBVSjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
60
60
|
};
|
|
61
61
|
const { Compilation, sources, NormalModule } = compiler.webpack;
|
|
62
62
|
const { ConcatSource } = sources;
|
|
63
63
|
async function getClassSetInLoader() {
|
|
64
64
|
await refreshRuntimeState(true);
|
|
65
65
|
await runtimeState.patchPromise;
|
|
66
|
-
await
|
|
66
|
+
await _chunk36GNZBVSjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
67
67
|
}
|
|
68
68
|
onLoad();
|
|
69
69
|
const loader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-loader.js")));
|
|
@@ -76,8 +76,8 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
76
76
|
ident: null,
|
|
77
77
|
type: null
|
|
78
78
|
};
|
|
79
|
-
compiler.hooks.compilation.tap(
|
|
80
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
79
|
+
compiler.hooks.compilation.tap(_chunk36GNZBVSjs.pluginName, (compilation) => {
|
|
80
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunk36GNZBVSjs.pluginName, (_loaderContext, module) => {
|
|
81
81
|
if (isExisted) {
|
|
82
82
|
const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
|
|
83
83
|
if (idx > -1) {
|
|
@@ -87,7 +87,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
87
87
|
});
|
|
88
88
|
compilation.hooks.processAssets.tapPromise(
|
|
89
89
|
{
|
|
90
|
-
name:
|
|
90
|
+
name: _chunk36GNZBVSjs.pluginName,
|
|
91
91
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
92
92
|
},
|
|
93
93
|
async (assets) => {
|
|
@@ -156,7 +156,7 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
156
156
|
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
157
157
|
await refreshRuntimeState(true);
|
|
158
158
|
await runtimeState.patchPromise;
|
|
159
|
-
const runtimeSet = await
|
|
159
|
+
const runtimeSet = await _chunk36GNZBVSjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
160
160
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
161
161
|
const tasks = [];
|
|
162
162
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
getCompilerContext,
|
|
17
17
|
pluginName,
|
|
18
18
|
refreshTailwindRuntimeState
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VL24RIGE.mjs";
|
|
20
20
|
import {
|
|
21
21
|
getGroupedEntries
|
|
22
22
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
23
23
|
import {
|
|
24
24
|
__dirname
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-EGX7MMTE.mjs";
|
|
26
26
|
|
|
27
27
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
28
28
|
import fs from "fs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk3AAVIURIjs = require('./chunk-3AAVIURI.js');
|
|
7
7
|
|
|
8
8
|
// src/context/tailwindcss.ts
|
|
9
9
|
var _module = require('module');
|
|
@@ -46,7 +46,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
46
46
|
return void 0;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const req = _module.createRequire.call(void 0,
|
|
49
|
+
const req = _module.createRequire.call(void 0, _chunk3AAVIURIjs.importMetaUrl);
|
|
50
50
|
return req.resolve(specifier, { paths });
|
|
51
51
|
} catch (e) {
|
|
52
52
|
return void 0;
|
|
@@ -163,11 +163,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
163
163
|
const cwd = _process2.default.cwd();
|
|
164
164
|
appendNodeModules(paths, cwd);
|
|
165
165
|
try {
|
|
166
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
166
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunk3AAVIURIjs.importMetaUrl);
|
|
167
167
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
168
168
|
paths.add(candidate);
|
|
169
169
|
} catch (e2) {
|
|
170
|
-
paths.add(
|
|
170
|
+
paths.add(_chunk3AAVIURIjs.importMetaUrl);
|
|
171
171
|
}
|
|
172
172
|
if (paths.size === 0) {
|
|
173
173
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -16,7 +16,7 @@ var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk36GNZBVSjs = require('./chunk-36GNZBVS.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunkDWAEHRHNjs = require('./chunk-DWAEHRHN.js');
|
|
@@ -63,7 +63,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
63
63
|
if (start >= end) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
const generated =
|
|
66
|
+
const generated = _chunk36GNZBVSjs.generateCode.call(void 0, prop.exp.content, {
|
|
67
67
|
jsHandler,
|
|
68
68
|
runtimeSet,
|
|
69
69
|
wrapExpression: true
|
|
@@ -92,7 +92,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
95
|
-
const matchCustomAttribute =
|
|
95
|
+
const matchCustomAttribute = _chunk36GNZBVSjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
96
96
|
const ms = new (0, _magicstring2.default)(code);
|
|
97
97
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
98
98
|
if (errors.length === 0) {
|
|
@@ -215,7 +215,7 @@ async function formatPostcssSourceMap(rawMap, file) {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
// src/bundlers/vite/index.ts
|
|
218
|
-
var debug =
|
|
218
|
+
var debug = _chunk36GNZBVSjs.createDebug.call(void 0, );
|
|
219
219
|
function readOutputEntry(entry) {
|
|
220
220
|
if (entry.output.type === "chunk") {
|
|
221
221
|
return entry.output.code;
|
|
@@ -282,7 +282,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
285
|
-
const opts =
|
|
285
|
+
const opts = _chunk36GNZBVSjs.getCompilerContext.call(void 0, options);
|
|
286
286
|
const {
|
|
287
287
|
disabled,
|
|
288
288
|
customAttributes,
|
|
@@ -304,17 +304,17 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
304
304
|
if (disabled) {
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
const customAttributesEntities =
|
|
307
|
+
const customAttributesEntities = _chunk36GNZBVSjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
308
308
|
const runtimeState = {
|
|
309
309
|
twPatcher: initialTwPatcher,
|
|
310
|
-
patchPromise:
|
|
310
|
+
patchPromise: _chunk36GNZBVSjs.createTailwindPatchPromise.call(void 0, initialTwPatcher),
|
|
311
311
|
refreshTailwindcssPatcher
|
|
312
312
|
};
|
|
313
313
|
let runtimeSet;
|
|
314
314
|
let runtimeSetPromise;
|
|
315
315
|
let resolvedConfig;
|
|
316
316
|
async function refreshRuntimeState(force) {
|
|
317
|
-
const refreshed = await
|
|
317
|
+
const refreshed = await _chunk36GNZBVSjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
318
318
|
if (refreshed) {
|
|
319
319
|
runtimeSet = void 0;
|
|
320
320
|
runtimeSetPromise = void 0;
|
|
@@ -327,7 +327,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
327
327
|
return runtimeSet;
|
|
328
328
|
}
|
|
329
329
|
if (force || !runtimeSetPromise) {
|
|
330
|
-
const task2 =
|
|
330
|
+
const task2 = _chunk36GNZBVSjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
331
331
|
force: force || !runtimeSet,
|
|
332
332
|
skipRefresh: force
|
|
333
333
|
});
|
|
@@ -346,7 +346,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
346
346
|
onLoad();
|
|
347
347
|
const plugins = [
|
|
348
348
|
{
|
|
349
|
-
name: `${
|
|
349
|
+
name: `${_chunk36GNZBVSjs.vitePluginName}:post`,
|
|
350
350
|
enforce: "post",
|
|
351
351
|
configResolved(config) {
|
|
352
352
|
resolvedConfig = config;
|
|
@@ -562,18 +562,16 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
562
562
|
map: {
|
|
563
563
|
inline: false,
|
|
564
564
|
annotation: false,
|
|
565
|
-
//
|
|
566
|
-
// we cannot obtain content of them, so this needs to be enabled
|
|
565
|
+
// PostCSS 可能返回虚拟文件,因此需要启用这一项以获取源内容
|
|
567
566
|
sourcesContent: true
|
|
568
|
-
//
|
|
567
|
+
// 若上游预处理器已经生成 source map,sources 中可能出现重复条目
|
|
569
568
|
}
|
|
570
569
|
}
|
|
571
570
|
}
|
|
572
571
|
});
|
|
573
572
|
const rawPostcssMap = postcssResult.map.toJSON();
|
|
574
573
|
const postcssMap = await formatPostcssSourceMap(
|
|
575
|
-
// version
|
|
576
|
-
// but actually it is a number
|
|
574
|
+
// rawPostcssMap.version 类型声明为字符串,实际需要数值
|
|
577
575
|
rawPostcssMap,
|
|
578
576
|
cleanUrl(id)
|
|
579
577
|
);
|
|
@@ -601,12 +599,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
601
599
|
const isWatchBuild = _optionalChain([resolvedConfig, 'optionalAccess', _14 => _14.command]) === "build" && !!_optionalChain([resolvedConfig, 'access', _15 => _15.build, 'optionalAccess', _16 => _16.watch]);
|
|
602
600
|
const isNonWatchBuild = _optionalChain([resolvedConfig, 'optionalAccess', _17 => _17.command]) === "build" && !_optionalChain([resolvedConfig, 'access', _18 => _18.build, 'optionalAccess', _19 => _19.watch]);
|
|
603
601
|
const shouldForceRefresh = isServeCommand || isWatchBuild || isNonWatchBuild;
|
|
604
|
-
|
|
605
|
-
if (shouldForceRefresh) {
|
|
606
|
-
currentRuntimeSet = await ensureRuntimeClassSet(true);
|
|
607
|
-
} else {
|
|
608
|
-
currentRuntimeSet = await ensureRuntimeClassSet();
|
|
609
|
-
}
|
|
602
|
+
const currentRuntimeSet = shouldForceRefresh ? await ensureRuntimeClassSet(true) : await ensureRuntimeClassSet();
|
|
610
603
|
const extraOptions = customAttributesEntities.length > 0 || disabledDefaultTemplateHandler ? {
|
|
611
604
|
customAttributesEntities,
|
|
612
605
|
disabledDefaultTemplateHandler
|
|
@@ -59,7 +59,7 @@ function getDefaultOptions() {
|
|
|
59
59
|
},
|
|
60
60
|
mainCssChunkMatcher: createMainCssChunkMatcher(),
|
|
61
61
|
wxsMatcher: alwaysFalse,
|
|
62
|
-
// https://tailwindcss.com/docs/preflight#border-styles-are-reset-globally
|
|
62
|
+
// 参考:https://tailwindcss.com/docs/preflight#border-styles-are-reset-globally
|
|
63
63
|
cssPreflight: {
|
|
64
64
|
"box-sizing": "border-box",
|
|
65
65
|
"border-width": "0",
|