weapp-tailwindcss 4.11.2 → 4.12.0-alpha.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 +38 -0
- package/bin/weapp-tailwindcss.js +21 -1
- package/dist/{chunk-AV3XB6EQ.js → chunk-2A4NRLSY.js} +5 -5
- package/dist/{chunk-WJIRXC26.js → chunk-6JBFHYFM.js} +134 -128
- package/dist/{chunk-OMARW5NC.mjs → chunk-AYJ4HLWZ.mjs} +4 -2
- package/dist/{chunk-W3DXDWYC.mjs → chunk-CMNCGACY.mjs} +66 -60
- package/dist/{chunk-ZZ36BKM5.mjs → chunk-CQMHHQRN.mjs} +6 -2
- package/dist/{chunk-OYSABARD.js → chunk-E7I5TW5K.js} +3 -2
- package/dist/{chunk-7LKMJZD2.js → chunk-GMKSBLNY.js} +2 -2
- package/dist/{chunk-EFBQ4SQR.mjs → chunk-HL3US2OT.mjs} +1 -1
- package/dist/{chunk-AB2RGZQO.mjs → chunk-LWEVOVRD.mjs} +144 -76
- package/dist/{chunk-QK6VNNNL.js → chunk-NIS74SI6.js} +8 -6
- package/dist/{chunk-CRDOWYG4.js → chunk-ONLKZIRQ.js} +1 -1
- package/dist/{chunk-3QHYEMEW.js → chunk-PAAX4FDD.js} +45 -40
- package/dist/{chunk-JIERVBTX.mjs → chunk-SHDJA4GG.mjs} +1 -1
- package/dist/{chunk-SUKOZ6OG.js → chunk-SRAG3FST.js} +10 -6
- package/dist/{chunk-TT5WHNGS.js → chunk-YVRX3F6S.js} +149 -81
- package/dist/{chunk-2LH6PZH3.mjs → chunk-ZCH4YINE.mjs} +3 -2
- package/dist/{chunk-VGPAKLMZ.mjs → chunk-ZGIN2OAY.mjs} +12 -7
- package/dist/cli.js +2233 -158
- package/dist/cli.mjs +2238 -163
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +14 -9
- package/dist/core.mjs +10 -5
- package/dist/css-macro/postcss.js +4 -4
- package/dist/css-macro/postcss.mjs +2 -2
- package/dist/css-macro.js +5 -5
- package/dist/css-macro.mjs +2 -2
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/{index-CoXntW_P.d.mts → index-BXrmQelt.d.mts} +29 -1
- package/dist/{index-CoXntW_P.d.ts → index-BXrmQelt.d.ts} +29 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/index.mjs +7 -7
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +8 -1
- package/dist/presets.d.ts +8 -1
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +3 -2
- package/dist/reset.d.mts +1 -31
- package/dist/reset.d.ts +3 -32
- package/dist/reset.js +3 -160
- package/dist/reset.mjs +3 -160
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +4 -4
- package/dist/weapp-tw-css-import-rewrite-loader.js +10 -5
- package/dist/weapp-tw-runtime-classset-loader.js +9 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +65 -56
- package/dist/webpack4.mjs +35 -26
- package/package.json +12 -7
- package/scripts/postinstall.mjs +59 -0
|
@@ -1192,12 +1192,14 @@ function resolveUniAppXOptions(option) {
|
|
|
1192
1192
|
if (typeof option === "object" && option) {
|
|
1193
1193
|
return {
|
|
1194
1194
|
enabled: option.enabled !== false,
|
|
1195
|
-
componentLocalStyles: resolveComponentLocalStyles(option)
|
|
1195
|
+
componentLocalStyles: resolveComponentLocalStyles(option),
|
|
1196
|
+
uvueUnsupported: option.uvueUnsupported ?? "warn"
|
|
1196
1197
|
};
|
|
1197
1198
|
}
|
|
1198
1199
|
return {
|
|
1199
1200
|
enabled: Boolean(option),
|
|
1200
|
-
componentLocalStyles: resolveComponentLocalStyles(option)
|
|
1201
|
+
componentLocalStyles: resolveComponentLocalStyles(option),
|
|
1202
|
+
uvueUnsupported: "warn"
|
|
1201
1203
|
};
|
|
1202
1204
|
}
|
|
1203
1205
|
function isUniAppXEnabled(option) {
|
|
@@ -23,18 +23,20 @@ import {
|
|
|
23
23
|
refreshTailwindRuntimeState,
|
|
24
24
|
replaceWxml,
|
|
25
25
|
setupPatchRecorder,
|
|
26
|
+
shouldSkipJsTransform,
|
|
26
27
|
toCustomAttributesEntities,
|
|
27
28
|
traverse,
|
|
28
29
|
vitePluginName
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LWEVOVRD.mjs";
|
|
30
31
|
import {
|
|
31
32
|
findNearestPackageRoot,
|
|
32
33
|
findTailwindConfig,
|
|
33
34
|
getRuntimeClassSetSignature,
|
|
34
35
|
isUniAppXEnabled,
|
|
36
|
+
logger,
|
|
35
37
|
resolveTailwindcssOptions,
|
|
36
38
|
resolveUniAppXOptions
|
|
37
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-AYJ4HLWZ.mjs";
|
|
38
40
|
import {
|
|
39
41
|
resolveUniUtsPlatform
|
|
40
42
|
} from "./chunk-OOHJLO5M.mjs";
|
|
@@ -43,7 +45,7 @@ import {
|
|
|
43
45
|
import { existsSync as existsSync2 } from "fs";
|
|
44
46
|
import path6 from "path";
|
|
45
47
|
import process4 from "process";
|
|
46
|
-
import { logger as
|
|
48
|
+
import { logger as logger3 } from "@weapp-tailwindcss/logger";
|
|
47
49
|
import postcssHtmlTransform from "@weapp-tailwindcss/postcss/html-transform";
|
|
48
50
|
|
|
49
51
|
// src/uni-app-x/transform.ts
|
|
@@ -239,28 +241,28 @@ function traverse2(node, visitor) {
|
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
|
-
function updateStaticAttribute(ms, prop) {
|
|
244
|
+
function updateStaticAttribute(ms, prop, content = prop.value?.content) {
|
|
243
245
|
if (!prop.value) {
|
|
244
246
|
return;
|
|
245
247
|
}
|
|
246
248
|
const start = prop.value.loc.start.offset + 1;
|
|
247
249
|
const end = prop.value.loc.end.offset - 1;
|
|
248
250
|
if (start < end) {
|
|
249
|
-
ms.update(start, end, replaceWxml(
|
|
251
|
+
ms.update(start, end, replaceWxml(content ?? ""));
|
|
250
252
|
}
|
|
251
253
|
}
|
|
252
|
-
function updateStaticAttributeWithLocalStyle(ms, prop, collector) {
|
|
254
|
+
function updateStaticAttributeWithLocalStyle(ms, prop, collector, content = prop.value?.content) {
|
|
253
255
|
if (!prop.value) {
|
|
254
256
|
return;
|
|
255
257
|
}
|
|
256
258
|
const start = prop.value.loc.start.offset + 1;
|
|
257
259
|
const end = prop.value.loc.end.offset - 1;
|
|
258
260
|
if (start < end) {
|
|
259
|
-
ms.update(start, end, collector.collectAndRewriteStaticClass(
|
|
261
|
+
ms.update(start, end, collector.collectAndRewriteStaticClass(content ?? ""));
|
|
260
262
|
}
|
|
261
263
|
}
|
|
262
|
-
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
263
|
-
if (prop.exp?.type !== NodeTypes.SIMPLE_EXPRESSION) {
|
|
264
|
+
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet, expression = prop.exp?.content) {
|
|
265
|
+
if (prop.exp?.type !== NodeTypes.SIMPLE_EXPRESSION || expression === void 0) {
|
|
264
266
|
return;
|
|
265
267
|
}
|
|
266
268
|
const start = prop.exp.loc.start.offset;
|
|
@@ -268,15 +270,15 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
268
270
|
if (start >= end) {
|
|
269
271
|
return;
|
|
270
272
|
}
|
|
271
|
-
const generated = generateCode(
|
|
273
|
+
const generated = generateCode(expression, {
|
|
272
274
|
jsHandler,
|
|
273
275
|
runtimeSet,
|
|
274
276
|
wrapExpression: true
|
|
275
277
|
});
|
|
276
278
|
ms.update(start, end, generated);
|
|
277
279
|
}
|
|
278
|
-
function updateDirectiveExpressionWithLocalStyle(ms, prop, jsHandler, collector, runtimeSet) {
|
|
279
|
-
if (prop.exp?.type !== NodeTypes.SIMPLE_EXPRESSION) {
|
|
280
|
+
function updateDirectiveExpressionWithLocalStyle(ms, prop, jsHandler, collector, runtimeSet, expression = prop.exp?.content) {
|
|
281
|
+
if (prop.exp?.type !== NodeTypes.SIMPLE_EXPRESSION || expression === void 0) {
|
|
280
282
|
return;
|
|
281
283
|
}
|
|
282
284
|
const start = prop.exp.loc.start.offset;
|
|
@@ -284,10 +286,10 @@ function updateDirectiveExpressionWithLocalStyle(ms, prop, jsHandler, collector,
|
|
|
284
286
|
if (start >= end) {
|
|
285
287
|
return;
|
|
286
288
|
}
|
|
287
|
-
collector.collectRuntimeClasses(
|
|
289
|
+
collector.collectRuntimeClasses(expression, {
|
|
288
290
|
wrapExpression: true
|
|
289
291
|
});
|
|
290
|
-
const generated = generateCode(
|
|
292
|
+
const generated = generateCode(expression, {
|
|
291
293
|
jsHandler,
|
|
292
294
|
runtimeSet,
|
|
293
295
|
wrapExpression: true
|
|
@@ -359,7 +361,13 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
359
361
|
continue;
|
|
360
362
|
}
|
|
361
363
|
if (attrName.toLowerCase() === "class" && localStyleCollector) {
|
|
362
|
-
updateDirectiveExpressionWithLocalStyle(
|
|
364
|
+
updateDirectiveExpressionWithLocalStyle(
|
|
365
|
+
ms,
|
|
366
|
+
prop,
|
|
367
|
+
jsHandler,
|
|
368
|
+
localStyleCollector,
|
|
369
|
+
runtimeSet
|
|
370
|
+
);
|
|
363
371
|
} else {
|
|
364
372
|
updateDirectiveExpression(ms, prop, jsHandler, runtimeSet);
|
|
365
373
|
}
|
|
@@ -390,13 +398,17 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
390
398
|
${localStyleCollector.toStyleBlock()}`);
|
|
391
399
|
}
|
|
392
400
|
}
|
|
393
|
-
|
|
394
|
-
code: ms.toString()
|
|
395
|
-
|
|
396
|
-
|
|
401
|
+
const result = {
|
|
402
|
+
code: ms.toString()
|
|
403
|
+
};
|
|
404
|
+
Object.defineProperty(result, "map", {
|
|
405
|
+
configurable: true,
|
|
406
|
+
enumerable: true,
|
|
407
|
+
get() {
|
|
397
408
|
return ms.generateMap();
|
|
398
409
|
}
|
|
399
|
-
};
|
|
410
|
+
});
|
|
411
|
+
return result;
|
|
400
412
|
}
|
|
401
413
|
|
|
402
414
|
// src/bundlers/vite/query.ts
|
|
@@ -509,6 +521,9 @@ function isPreprocessorRequest(id, lang) {
|
|
|
509
521
|
}
|
|
510
522
|
return PREPROCESSOR_EXT_RE.test(id);
|
|
511
523
|
}
|
|
524
|
+
function resolveUniAppXCssTarget(id) {
|
|
525
|
+
return UVUE_NVUE_RE2.test(cleanUrl(id)) ? "uvue" : void 0;
|
|
526
|
+
}
|
|
512
527
|
function createUniAppXPlugins(options) {
|
|
513
528
|
const {
|
|
514
529
|
appType,
|
|
@@ -551,6 +566,8 @@ function createUniAppXPlugins(options) {
|
|
|
551
566
|
if (!styleHandlerOptions) {
|
|
552
567
|
styleHandlerOptions = {
|
|
553
568
|
isMainChunk: mainCssChunkMatcher(id, appType),
|
|
569
|
+
uniAppXCssTarget: resolveUniAppXCssTarget(id),
|
|
570
|
+
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
554
571
|
postcssOptions: {
|
|
555
572
|
options: {
|
|
556
573
|
from: id,
|
|
@@ -567,6 +584,10 @@ function createUniAppXPlugins(options) {
|
|
|
567
584
|
cssHandlerOptionsCache.set(cacheKey, styleHandlerOptions);
|
|
568
585
|
}
|
|
569
586
|
const postcssResult = await styleHandler(code, styleHandlerOptions);
|
|
587
|
+
const warnings = typeof postcssResult.warnings === "function" ? postcssResult.warnings() : [];
|
|
588
|
+
for (const warning of warnings) {
|
|
589
|
+
logger.warn(warning.toString());
|
|
590
|
+
}
|
|
570
591
|
const rawPostcssMap = postcssResult.map.toJSON();
|
|
571
592
|
const postcssMap = await formatPostcssSourceMap(
|
|
572
593
|
rawPostcssMap,
|
|
@@ -708,7 +729,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
708
729
|
// src/bundlers/vite/generate-bundle.ts
|
|
709
730
|
import path3 from "path";
|
|
710
731
|
import process2 from "process";
|
|
711
|
-
import { logger } from "@weapp-tailwindcss/logger";
|
|
732
|
+
import { logger as logger2 } from "@weapp-tailwindcss/logger";
|
|
712
733
|
import { splitCode as splitCode2 } from "@weapp-tailwindcss/shared/extractors";
|
|
713
734
|
|
|
714
735
|
// src/bundlers/vite/bundle-entries.ts
|
|
@@ -1029,28 +1050,6 @@ function updateBundleBuildState(state, snapshot, linkedByEntry, options = {}) {
|
|
|
1029
1050
|
state.dependentsByLinkedFile = invertLinkedByEntry(state.linkedByEntry);
|
|
1030
1051
|
}
|
|
1031
1052
|
|
|
1032
|
-
// src/bundlers/vite/js-precheck.ts
|
|
1033
|
-
var FAST_JS_TRANSFORM_HINT_RE = /className\b|class\s*=|classList\.|\b(?:twMerge|clsx|classnames|cn|cva)\b|\[["'`]class["'`]\]|text-\[|bg-\[|\b(?:[whpm]|px|py|mx|my|rounded|flex|grid|gap)-/;
|
|
1034
|
-
var DEPENDENCY_HINT_RE = /\bimport\s*[("'`{*]|\brequire\s*\(|\bexport\s+\*\s+from\s+["'`]|\bexport\s*\{[^}]*\}\s*from\s+["'`]/;
|
|
1035
|
-
function shouldSkipViteJsTransform(rawSource, options) {
|
|
1036
|
-
if (!rawSource) {
|
|
1037
|
-
return true;
|
|
1038
|
-
}
|
|
1039
|
-
if (options?.alwaysEscape) {
|
|
1040
|
-
return false;
|
|
1041
|
-
}
|
|
1042
|
-
if (options?.moduleSpecifierReplacements && Object.keys(options.moduleSpecifierReplacements).length > 0) {
|
|
1043
|
-
return false;
|
|
1044
|
-
}
|
|
1045
|
-
if (options?.wrapExpression) {
|
|
1046
|
-
return false;
|
|
1047
|
-
}
|
|
1048
|
-
if (DEPENDENCY_HINT_RE.test(rawSource)) {
|
|
1049
|
-
return false;
|
|
1050
|
-
}
|
|
1051
|
-
return !FAST_JS_TRANSFORM_HINT_RE.test(rawSource);
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
1053
|
// src/bundlers/vite/generate-bundle.ts
|
|
1055
1054
|
function formatDebugFileList(files, limit = 8) {
|
|
1056
1055
|
if (files.size === 0) {
|
|
@@ -1336,7 +1335,7 @@ function createGenerateBundleHook(context) {
|
|
|
1336
1335
|
let transformed = await templateHandler(rawSource, defaultTemplateHandlerOptions);
|
|
1337
1336
|
let unresolvedDynamicCandidates = collectUnescapedDynamicCandidates(transformed);
|
|
1338
1337
|
if (unresolvedDynamicCandidates.length > 0) {
|
|
1339
|
-
|
|
1338
|
+
logger2.warn(
|
|
1340
1339
|
"\u68C0\u6D4B\u5230 WXML \u52A8\u6001\u7C7B\u540D\u672A\u5B8C\u6210\u8F6C\u8BD1\uFF0C\u5DF2\u56DE\u9000\u5230\u5B8C\u6574 runtimeSet \u91CD\u8BD5: %s -> %O",
|
|
1341
1340
|
file,
|
|
1342
1341
|
unresolvedDynamicCandidates
|
|
@@ -1347,7 +1346,7 @@ function createGenerateBundleHook(context) {
|
|
|
1347
1346
|
});
|
|
1348
1347
|
unresolvedDynamicCandidates = collectUnescapedDynamicCandidates(transformed);
|
|
1349
1348
|
if (unresolvedDynamicCandidates.length > 0) {
|
|
1350
|
-
|
|
1349
|
+
logger2.warn(
|
|
1351
1350
|
"WXML \u52A8\u6001\u7C7B\u540D\u5728\u5B8C\u6574 runtimeSet \u91CD\u8BD5\u540E\u4ECD\u672A\u5B8C\u6210\u8F6C\u8BD1: %s -> %O",
|
|
1352
1351
|
file,
|
|
1353
1352
|
unresolvedDynamicCandidates
|
|
@@ -1466,7 +1465,7 @@ function createGenerateBundleHook(context) {
|
|
|
1466
1465
|
debug3("js cache replay miss, fallback transform: %s", file);
|
|
1467
1466
|
}
|
|
1468
1467
|
const handlerOptions = createHandlerOptions(absoluteFile);
|
|
1469
|
-
if (!disableJsPrecheck &&
|
|
1468
|
+
if (!disableJsPrecheck && shouldSkipJsTransform(rawSource, handlerOptions)) {
|
|
1470
1469
|
metrics.js.elapsed += measureElapsed(start);
|
|
1471
1470
|
metrics.js.transformed++;
|
|
1472
1471
|
return {
|
|
@@ -1552,7 +1551,7 @@ function createGenerateBundleHook(context) {
|
|
|
1552
1551
|
sourceType: "unambiguous"
|
|
1553
1552
|
}
|
|
1554
1553
|
});
|
|
1555
|
-
if (!disableJsPrecheck &&
|
|
1554
|
+
if (!disableJsPrecheck && shouldSkipJsTransform(currentSource, precheckOptions)) {
|
|
1556
1555
|
metrics.js.elapsed += measureElapsed(start);
|
|
1557
1556
|
metrics.js.transformed++;
|
|
1558
1557
|
return;
|
|
@@ -2119,6 +2118,13 @@ var debug2 = createDebug();
|
|
|
2119
2118
|
var weappTailwindcssPackageDir = resolvePackageDir("weapp-tailwindcss");
|
|
2120
2119
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
2121
2120
|
var PACKAGE_JSON_FILE2 = "package.json";
|
|
2121
|
+
function getPostcssPluginName(plugin) {
|
|
2122
|
+
if (!plugin || typeof plugin !== "object" || !("postcssPlugin" in plugin)) {
|
|
2123
|
+
return;
|
|
2124
|
+
}
|
|
2125
|
+
const { postcssPlugin } = plugin;
|
|
2126
|
+
return typeof postcssPlugin === "string" ? postcssPlugin : void 0;
|
|
2127
|
+
}
|
|
2122
2128
|
function resolveImplicitTailwindcssBasedirFromViteRoot(root) {
|
|
2123
2129
|
const resolvedRoot = path6.resolve(root);
|
|
2124
2130
|
if (!existsSync2(resolvedRoot)) {
|
|
@@ -2335,7 +2341,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2335
2341
|
if (nextAppType && opts.appType !== nextAppType) {
|
|
2336
2342
|
const previousAppType = opts.appType;
|
|
2337
2343
|
opts.appType = nextAppType;
|
|
2338
|
-
|
|
2344
|
+
logger3.info("\u6839\u636E Vite \u9879\u76EE\u6839\u76EE\u5F55\u81EA\u52A8\u63A8\u65AD appType -> %s", nextAppType);
|
|
2339
2345
|
debug2(
|
|
2340
2346
|
"align appType with vite root: %s -> %s",
|
|
2341
2347
|
previousAppType ?? "undefined",
|
|
@@ -2349,24 +2355,24 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
2349
2355
|
}
|
|
2350
2356
|
if (typeof config.css.postcss === "object" && Array.isArray(config.css.postcss.plugins)) {
|
|
2351
2357
|
const postcssPlugins = config.css.postcss.plugins;
|
|
2352
|
-
const idx = postcssPlugins.findIndex((x) => (
|
|
2353
|
-
// @ts-ignore
|
|
2354
|
-
x.postcssPlugin === "postcss-html-transform"
|
|
2355
|
-
));
|
|
2358
|
+
const idx = postcssPlugins.findIndex((x) => getPostcssPluginName(x) === "postcss-html-transform");
|
|
2356
2359
|
if (idx > -1) {
|
|
2357
2360
|
postcssPlugins.splice(idx, 1, postcssHtmlTransform());
|
|
2358
2361
|
debug2("remove postcss-html-transform plugin from vite config");
|
|
2359
2362
|
}
|
|
2360
2363
|
}
|
|
2361
2364
|
},
|
|
2362
|
-
generateBundle:
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2365
|
+
generateBundle: {
|
|
2366
|
+
order: "post",
|
|
2367
|
+
handler: createGenerateBundleHook({
|
|
2368
|
+
opts,
|
|
2369
|
+
runtimeState,
|
|
2370
|
+
ensureRuntimeClassSet,
|
|
2371
|
+
ensureBundleRuntimeClassSet,
|
|
2372
|
+
debug: debug2,
|
|
2373
|
+
getResolvedConfig
|
|
2374
|
+
})
|
|
2375
|
+
}
|
|
2370
2376
|
}
|
|
2371
2377
|
];
|
|
2372
2378
|
if (uniAppXPlugins) {
|
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
ensureRuntimeClassSet,
|
|
7
7
|
getCompilerContext,
|
|
8
8
|
refreshTailwindRuntimeState,
|
|
9
|
-
setupPatchRecorder
|
|
10
|
-
|
|
9
|
+
setupPatchRecorder,
|
|
10
|
+
shouldSkipJsTransform
|
|
11
|
+
} from "./chunk-LWEVOVRD.mjs";
|
|
11
12
|
|
|
12
13
|
// src/bundlers/gulp/index.ts
|
|
13
14
|
import { Buffer } from "buffer";
|
|
@@ -225,6 +226,9 @@ function createPlugins(options = {}) {
|
|
|
225
226
|
async transform() {
|
|
226
227
|
await runtimeState.patchPromise;
|
|
227
228
|
const currentSource = file.contents?.toString() ?? rawSource;
|
|
229
|
+
if (shouldSkipJsTransform(currentSource, handlerOptions)) {
|
|
230
|
+
return { result: currentSource };
|
|
231
|
+
}
|
|
228
232
|
const { code } = await jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
229
233
|
debug("js handle: %s", file.path);
|
|
230
234
|
return {
|
|
@@ -33,12 +33,13 @@ function ifndef(text) {
|
|
|
33
33
|
}
|
|
34
34
|
var QUERY_KEY_REGEX = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, "g");
|
|
35
35
|
function matchCustomPropertyFromValue(str, cb) {
|
|
36
|
-
let arr;
|
|
37
36
|
let index = 0;
|
|
38
37
|
QUERY_KEY_REGEX.lastIndex = 0;
|
|
39
|
-
|
|
38
|
+
let arr = QUERY_KEY_REGEX.exec(str);
|
|
39
|
+
while (arr !== null) {
|
|
40
40
|
cb(arr, index);
|
|
41
41
|
index++;
|
|
42
|
+
arr = QUERY_KEY_REGEX.exec(str);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkONLKZIRQjs = require('./chunk-ONLKZIRQ.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/disabled.ts
|
|
6
6
|
function resolveDisabledOptions(disabled) {
|
|
@@ -19,7 +19,7 @@ function resolveDisabledOptions(disabled) {
|
|
|
19
19
|
// src/utils/resolve-package.ts
|
|
20
20
|
var _module = require('module');
|
|
21
21
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
22
|
-
var require2 = _module.createRequire.call(void 0,
|
|
22
|
+
var require2 = _module.createRequire.call(void 0, _chunkONLKZIRQjs.importMetaUrl);
|
|
23
23
|
function resolvePackageDir(name) {
|
|
24
24
|
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
25
25
|
return _path2.default.dirname(pkgPath);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.2__@swc+core@1.15.32_@swc+_5ed6cbcda668e45f9f2d3d9f21b34c59/node_modules/tsup/assets/esm_shims.js
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|