weapp-tailwindcss 4.10.2 → 4.10.3
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-IIDSY4XZ.js → chunk-6Z4GEN2Y.js} +2 -2
- package/dist/{chunk-I35XJD75.js → chunk-DEIJXHGJ.js} +28 -18
- package/dist/{chunk-MPVAZKRB.mjs → chunk-E7775SFS.mjs} +22 -12
- package/dist/{chunk-M2ATX5ZS.js → chunk-GCRL3ZYP.js} +5 -5
- package/dist/{chunk-NPZ5QQC7.js → chunk-L7OBNTRI.js} +7 -7
- package/dist/{chunk-BZCCVPSU.mjs → chunk-LICQ6EGN.mjs} +1 -1
- package/dist/{chunk-WJU62RPV.mjs → chunk-PALDKVKG.mjs} +47 -4
- package/dist/{chunk-N6JOG5K3.mjs → chunk-RM3SY4S4.mjs} +2 -2
- package/dist/{chunk-5APD2MNV.js → chunk-RYC23C3K.js} +4 -4
- package/dist/{chunk-HT76VHOV.mjs → chunk-TNYEOBAC.mjs} +1 -1
- package/dist/{chunk-ACNOEKQI.mjs → chunk-UYTCZXNE.mjs} +1 -1
- package/dist/{chunk-6VKE7EWV.js → chunk-W2N6G2QQ.js} +34 -34
- package/dist/{chunk-HJVZ4TO3.js → chunk-WF636Q5E.js} +5 -5
- package/dist/{chunk-LHBUALTK.mjs → chunk-WXT2GI5R.mjs} +4 -4
- package/dist/{chunk-3R7FDZJL.js → chunk-YJSFFRNZ.js} +69 -26
- package/dist/{chunk-DBAAU4LK.js → chunk-YUTKX7JZ.js} +1 -1
- package/dist/cli.js +39 -39
- package/dist/cli.mjs +2 -2
- package/dist/core.js +9 -9
- 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 +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +4 -4
- package/dist/index.js +10 -10
- 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.js +5 -5
- package/dist/presets.mjs +1 -1
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.js +35 -35
- package/dist/webpack4.mjs +4 -4
- package/package.json +5 -5
|
@@ -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 _chunkYUTKX7JZjs = require('./chunk-YUTKX7JZ.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, _chunkYUTKX7JZjs.importMetaUrl);
|
|
23
23
|
function resolvePackageDir(name) {
|
|
24
24
|
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
25
25
|
return _path2.default.dirname(pkgPath);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkRYC23C3Kjs = require('./chunk-RYC23C3K.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk5U24PLVVjs = require('./chunk-5U24PLVV.js');
|
|
@@ -285,7 +285,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
285
285
|
// package.json
|
|
286
286
|
var package_default = {
|
|
287
287
|
name: "weapp-tailwindcss",
|
|
288
|
-
version: "4.10.
|
|
288
|
+
version: "4.10.3",
|
|
289
289
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
290
290
|
author: "ice breaker <1324318532@qq.com>",
|
|
291
291
|
license: "MIT",
|
|
@@ -480,7 +480,7 @@ var package_default = {
|
|
|
480
480
|
"@babel/parser": "~7.29.0",
|
|
481
481
|
"@babel/traverse": "~7.29.0",
|
|
482
482
|
"@babel/types": "~7.29.0",
|
|
483
|
-
"@tailwindcss-mangle/config": "^6.1.
|
|
483
|
+
"@tailwindcss-mangle/config": "^6.1.3",
|
|
484
484
|
"@vue/compiler-dom": "catalog:vue3",
|
|
485
485
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
486
486
|
"@weapp-core/escape": "~7.0.0",
|
|
@@ -646,7 +646,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
646
646
|
}
|
|
647
647
|
function resolveRecordLocation(baseDir) {
|
|
648
648
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
649
|
-
const packageRoot = _nullishCoalesce(
|
|
649
|
+
const packageRoot = _nullishCoalesce(_chunkRYC23C3Kjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
650
650
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
651
651
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
652
652
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -1469,17 +1469,25 @@ function replaceHandleValue(path5, options) {
|
|
|
1469
1469
|
let matchedCandidateCount = 0;
|
|
1470
1470
|
let escapedDecisionCount = 0;
|
|
1471
1471
|
let fallbackDecisionCount = 0;
|
|
1472
|
+
const escapedSamples = [];
|
|
1473
|
+
const skippedSamples = [];
|
|
1472
1474
|
for (const candidate of candidates) {
|
|
1473
1475
|
const decision = resolveClassNameTransformDecision(candidate, {
|
|
1474
1476
|
...options,
|
|
1475
1477
|
classContext
|
|
1476
1478
|
});
|
|
1477
1479
|
if (decision === "skip") {
|
|
1480
|
+
if (skippedSamples.length < 6) {
|
|
1481
|
+
skippedSamples.push(candidate);
|
|
1482
|
+
}
|
|
1478
1483
|
continue;
|
|
1479
1484
|
}
|
|
1480
1485
|
matchedCandidateCount += 1;
|
|
1481
1486
|
if (decision === "escaped") {
|
|
1482
1487
|
escapedDecisionCount += 1;
|
|
1488
|
+
if (escapedSamples.length < 6) {
|
|
1489
|
+
escapedSamples.push(candidate);
|
|
1490
|
+
}
|
|
1483
1491
|
}
|
|
1484
1492
|
if (decision === "fallback") {
|
|
1485
1493
|
fallbackDecisionCount += 1;
|
|
@@ -1499,16 +1507,18 @@ function replaceHandleValue(path5, options) {
|
|
|
1499
1507
|
if (!mutated || typeof node.start !== "number" || typeof node.end !== "number") {
|
|
1500
1508
|
return void 0;
|
|
1501
1509
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
)
|
|
1511
|
-
|
|
1510
|
+
debug2(
|
|
1511
|
+
"runtimeSet size=%d fallbackTriggered=%s candidates=%d matched=%d escapedHits=%d skipped=%d file=%s escapedSamples=%s skippedSamples=%s",
|
|
1512
|
+
_nullishCoalesce(_optionalChain([classNameSet, 'optionalAccess', _47 => _47.size]), () => ( 0)),
|
|
1513
|
+
fallbackDecisionCount > 0,
|
|
1514
|
+
candidates.length,
|
|
1515
|
+
matchedCandidateCount,
|
|
1516
|
+
escapedDecisionCount,
|
|
1517
|
+
skippedSamples.length,
|
|
1518
|
+
_nullishCoalesce(options.filename, () => ( "unknown")),
|
|
1519
|
+
escapedSamples.join(",") || "-",
|
|
1520
|
+
skippedSamples.join(",") || "-"
|
|
1521
|
+
);
|
|
1512
1522
|
const start = node.start + offset;
|
|
1513
1523
|
const end = node.end - offset;
|
|
1514
1524
|
if (start >= end || transformed === original) {
|
|
@@ -3186,15 +3196,15 @@ function createInternalCompilerContext(opts) {
|
|
|
3186
3196
|
);
|
|
3187
3197
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
3188
3198
|
applyLoggerLevel(ctx.logLevel);
|
|
3189
|
-
const twPatcher =
|
|
3199
|
+
const twPatcher = _chunkRYC23C3Kjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
3190
3200
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
3191
3201
|
if (_optionalChain([twPatcher, 'access', _112 => _112.packageInfo, 'optionalAccess', _113 => _113.version])) {
|
|
3192
3202
|
_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)))}`);
|
|
3193
3203
|
} else {
|
|
3194
3204
|
_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`);
|
|
3195
3205
|
}
|
|
3196
|
-
|
|
3197
|
-
const cssCalcOptions =
|
|
3206
|
+
_chunkRYC23C3Kjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
3207
|
+
const cssCalcOptions = _chunkRYC23C3Kjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
3198
3208
|
ctx.cssCalc = cssCalcOptions;
|
|
3199
3209
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
3200
3210
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -3214,7 +3224,7 @@ function createInternalCompilerContext(opts) {
|
|
|
3214
3224
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
3215
3225
|
}
|
|
3216
3226
|
invalidateRuntimeClassSet(previousPatcher);
|
|
3217
|
-
const nextPatcher =
|
|
3227
|
+
const nextPatcher = _chunkRYC23C3Kjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
3218
3228
|
Object.assign(previousPatcher, nextPatcher);
|
|
3219
3229
|
ctx.twPatcher = previousPatcher;
|
|
3220
3230
|
return previousPatcher;
|
|
@@ -285,7 +285,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
285
285
|
// package.json
|
|
286
286
|
var package_default = {
|
|
287
287
|
name: "weapp-tailwindcss",
|
|
288
|
-
version: "4.10.
|
|
288
|
+
version: "4.10.3",
|
|
289
289
|
description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
|
|
290
290
|
author: "ice breaker <1324318532@qq.com>",
|
|
291
291
|
license: "MIT",
|
|
@@ -480,7 +480,7 @@ var package_default = {
|
|
|
480
480
|
"@babel/parser": "~7.29.0",
|
|
481
481
|
"@babel/traverse": "~7.29.0",
|
|
482
482
|
"@babel/types": "~7.29.0",
|
|
483
|
-
"@tailwindcss-mangle/config": "^6.1.
|
|
483
|
+
"@tailwindcss-mangle/config": "^6.1.3",
|
|
484
484
|
"@vue/compiler-dom": "catalog:vue3",
|
|
485
485
|
"@vue/compiler-sfc": "catalog:vue3",
|
|
486
486
|
"@weapp-core/escape": "~7.0.0",
|
|
@@ -1469,17 +1469,25 @@ function replaceHandleValue(path5, options) {
|
|
|
1469
1469
|
let matchedCandidateCount = 0;
|
|
1470
1470
|
let escapedDecisionCount = 0;
|
|
1471
1471
|
let fallbackDecisionCount = 0;
|
|
1472
|
+
const escapedSamples = [];
|
|
1473
|
+
const skippedSamples = [];
|
|
1472
1474
|
for (const candidate of candidates) {
|
|
1473
1475
|
const decision = resolveClassNameTransformDecision(candidate, {
|
|
1474
1476
|
...options,
|
|
1475
1477
|
classContext
|
|
1476
1478
|
});
|
|
1477
1479
|
if (decision === "skip") {
|
|
1480
|
+
if (skippedSamples.length < 6) {
|
|
1481
|
+
skippedSamples.push(candidate);
|
|
1482
|
+
}
|
|
1478
1483
|
continue;
|
|
1479
1484
|
}
|
|
1480
1485
|
matchedCandidateCount += 1;
|
|
1481
1486
|
if (decision === "escaped") {
|
|
1482
1487
|
escapedDecisionCount += 1;
|
|
1488
|
+
if (escapedSamples.length < 6) {
|
|
1489
|
+
escapedSamples.push(candidate);
|
|
1490
|
+
}
|
|
1483
1491
|
}
|
|
1484
1492
|
if (decision === "fallback") {
|
|
1485
1493
|
fallbackDecisionCount += 1;
|
|
@@ -1499,16 +1507,18 @@ function replaceHandleValue(path5, options) {
|
|
|
1499
1507
|
if (!mutated || typeof node.start !== "number" || typeof node.end !== "number") {
|
|
1500
1508
|
return void 0;
|
|
1501
1509
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1510
|
+
debug2(
|
|
1511
|
+
"runtimeSet size=%d fallbackTriggered=%s candidates=%d matched=%d escapedHits=%d skipped=%d file=%s escapedSamples=%s skippedSamples=%s",
|
|
1512
|
+
classNameSet?.size ?? 0,
|
|
1513
|
+
fallbackDecisionCount > 0,
|
|
1514
|
+
candidates.length,
|
|
1515
|
+
matchedCandidateCount,
|
|
1516
|
+
escapedDecisionCount,
|
|
1517
|
+
skippedSamples.length,
|
|
1518
|
+
options.filename ?? "unknown",
|
|
1519
|
+
escapedSamples.join(",") || "-",
|
|
1520
|
+
skippedSamples.join(",") || "-"
|
|
1521
|
+
);
|
|
1512
1522
|
const start = node.start + offset;
|
|
1513
1523
|
const end = node.end - offset;
|
|
1514
1524
|
if (start >= end || transformed === original) {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkDEIJXHGJjs = require('./chunk-DEIJXHGJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkRYC23C3Kjs = require('./chunk-RYC23C3K.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkDEIJXHGJjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
|
|
12
12
|
if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
|
|
13
13
|
const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
14
|
-
|
|
14
|
+
_chunkRYC23C3Kjs.logger.info("%s%s", prefix, recorder.message);
|
|
15
15
|
}
|
|
16
16
|
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
|
|
17
17
|
await recorder.onPatched();
|
|
18
18
|
} : void 0;
|
|
19
|
-
const patchPromise = patcher ?
|
|
19
|
+
const patchPromise = patcher ? _chunkDEIJXHGJjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkGCRL3ZYPjs = require('./chunk-GCRL3ZYP.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkDEIJXHGJjs = require('./chunk-DEIJXHGJ.js');
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
var _buffer = require('buffer');
|
|
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
17
17
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
18
18
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
19
19
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
20
|
-
var debug =
|
|
20
|
+
var debug = _chunkDEIJXHGJjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkDEIJXHGJjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunkGCRL3ZYPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
26
26
|
source: "runtime",
|
|
27
27
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
28
28
|
});
|
|
@@ -36,13 +36,13 @@ function createPlugins(options = {}) {
|
|
|
36
36
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
37
37
|
let runtimeSetInitialized = false;
|
|
38
38
|
async function refreshRuntimeState(force) {
|
|
39
|
-
await
|
|
39
|
+
await _chunkDEIJXHGJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
40
40
|
}
|
|
41
41
|
async function refreshRuntimeSet(force = false) {
|
|
42
42
|
if (!force && runtimeSetInitialized) {
|
|
43
43
|
return runtimeSet;
|
|
44
44
|
}
|
|
45
|
-
runtimeSet = await
|
|
45
|
+
runtimeSet = await _chunkDEIJXHGJjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
46
46
|
forceRefresh: force,
|
|
47
47
|
forceCollect: force,
|
|
48
48
|
clearCache: force,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-RRHPTTCP.mjs";
|
|
13
13
|
import {
|
|
14
14
|
setupPatchRecorder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LICQ6EGN.mjs";
|
|
16
16
|
import {
|
|
17
17
|
collectRuntimeClassSet,
|
|
18
18
|
createAttributeMatcher,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
replaceWxml,
|
|
25
25
|
toCustomAttributesEntities,
|
|
26
26
|
vitePluginName
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-E7775SFS.mjs";
|
|
28
28
|
import {
|
|
29
29
|
resolveUniUtsPlatform
|
|
30
30
|
} from "./chunk-OOHJLO5M.mjs";
|
|
@@ -493,6 +493,16 @@ function shouldSkipViteJsTransform(rawSource, options) {
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
// src/bundlers/vite/generate-bundle.ts
|
|
496
|
+
function formatDebugFileList(files, limit = 8) {
|
|
497
|
+
if (files.size === 0) {
|
|
498
|
+
return "-";
|
|
499
|
+
}
|
|
500
|
+
const sorted = [...files].sort();
|
|
501
|
+
if (sorted.length <= limit) {
|
|
502
|
+
return sorted.join(",");
|
|
503
|
+
}
|
|
504
|
+
return `${sorted.slice(0, limit).join(",")},...(+${sorted.length - limit})`;
|
|
505
|
+
}
|
|
496
506
|
function createEmptyMetric() {
|
|
497
507
|
return {
|
|
498
508
|
total: 0,
|
|
@@ -713,6 +723,28 @@ function createGenerateBundleHook(context) {
|
|
|
713
723
|
const forceRuntimeRefresh = forceRuntimeRefreshByEnv || forceRuntimeRefreshBySource;
|
|
714
724
|
const processSets = buildProcessSets(entries, opts, dirtyEntries.changedByType, state.previousLinkedByEntry, disableDirtyOptimization);
|
|
715
725
|
const processFiles = processSets.files;
|
|
726
|
+
debug2(
|
|
727
|
+
"dirty iteration=%d html=%d[%s] js=%d[%s] css=%d[%s] other=%d[%s]",
|
|
728
|
+
state.iteration + 1,
|
|
729
|
+
dirtyEntries.changedByType.html.size,
|
|
730
|
+
formatDebugFileList(dirtyEntries.changedByType.html),
|
|
731
|
+
dirtyEntries.changedByType.js.size,
|
|
732
|
+
formatDebugFileList(dirtyEntries.changedByType.js),
|
|
733
|
+
dirtyEntries.changedByType.css.size,
|
|
734
|
+
formatDebugFileList(dirtyEntries.changedByType.css),
|
|
735
|
+
dirtyEntries.changedByType.other.size,
|
|
736
|
+
formatDebugFileList(dirtyEntries.changedByType.other)
|
|
737
|
+
);
|
|
738
|
+
debug2(
|
|
739
|
+
"process iteration=%d html=%d[%s] js=%d[%s] css=%d[%s]",
|
|
740
|
+
state.iteration + 1,
|
|
741
|
+
processFiles.html.size,
|
|
742
|
+
formatDebugFileList(processFiles.html),
|
|
743
|
+
processFiles.js.size,
|
|
744
|
+
formatDebugFileList(processFiles.js),
|
|
745
|
+
processFiles.css.size,
|
|
746
|
+
formatDebugFileList(processFiles.css)
|
|
747
|
+
);
|
|
716
748
|
const resolvedConfig = getResolvedConfig();
|
|
717
749
|
const rootDir = resolvedConfig?.root ? path2.resolve(resolvedConfig.root) : process2.cwd();
|
|
718
750
|
const outDir = resolvedConfig?.build?.outDir ? path2.resolve(rootDir, resolvedConfig.build.outDir) : rootDir;
|
|
@@ -852,8 +884,9 @@ function createGenerateBundleHook(context) {
|
|
|
852
884
|
continue;
|
|
853
885
|
}
|
|
854
886
|
metrics.js.total++;
|
|
855
|
-
|
|
856
|
-
|
|
887
|
+
const shouldTransformJs = processFiles.js.has(file);
|
|
888
|
+
if (!shouldTransformJs) {
|
|
889
|
+
debug2("js skip transform (clean), replay cache: %s", file);
|
|
857
890
|
}
|
|
858
891
|
if (originalSource.type === "chunk") {
|
|
859
892
|
const absoluteFile = toJsAbsoluteFilename(file, outDir);
|
|
@@ -883,6 +916,9 @@ function createGenerateBundleHook(context) {
|
|
|
883
916
|
async transform() {
|
|
884
917
|
const start = performance.now();
|
|
885
918
|
const rawSource = originalSource.code;
|
|
919
|
+
if (!shouldTransformJs) {
|
|
920
|
+
debug2("js cache replay miss, fallback transform: %s", file);
|
|
921
|
+
}
|
|
886
922
|
const handlerOptions = createHandlerOptions(absoluteFile);
|
|
887
923
|
if (!disableJsPrecheck && shouldSkipViteJsTransform(rawSource, handlerOptions)) {
|
|
888
924
|
metrics.js.elapsed += measureElapsed(start);
|
|
@@ -952,6 +988,13 @@ function createGenerateBundleHook(context) {
|
|
|
952
988
|
);
|
|
953
989
|
jsTaskFactories.push(async () => {
|
|
954
990
|
const start = performance.now();
|
|
991
|
+
if (!shouldTransformJs) {
|
|
992
|
+
debug2("js skip transform (clean, uni-app-x), replay cache: %s", file);
|
|
993
|
+
await factory();
|
|
994
|
+
metrics.js.elapsed += measureElapsed(start);
|
|
995
|
+
metrics.js.transformed++;
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
955
998
|
const currentSource = originalSource.source.toString();
|
|
956
999
|
const absoluteFile = toJsAbsoluteFilename(file, outDir);
|
|
957
1000
|
const precheckOptions = createHandlerOptions(absoluteFile, {
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LICQ6EGN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
createDebug,
|
|
9
9
|
ensureRuntimeClassSet,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-E7775SFS.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkYUTKX7JZjs = require('./chunk-YUTKX7JZ.js');
|
|
7
7
|
|
|
8
8
|
// src/logger/index.ts
|
|
9
9
|
var _logger = require('@weapp-tailwindcss/logger');
|
|
@@ -399,7 +399,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
399
399
|
return void 0;
|
|
400
400
|
}
|
|
401
401
|
try {
|
|
402
|
-
const req = _module.createRequire.call(void 0,
|
|
402
|
+
const req = _module.createRequire.call(void 0, _chunkYUTKX7JZjs.importMetaUrl);
|
|
403
403
|
return req.resolve(specifier, { paths });
|
|
404
404
|
} catch (e3) {
|
|
405
405
|
return void 0;
|
|
@@ -454,11 +454,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
454
454
|
const cwd = _process2.default.cwd();
|
|
455
455
|
appendNodeModules(paths, cwd);
|
|
456
456
|
try {
|
|
457
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
457
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkYUTKX7JZjs.importMetaUrl);
|
|
458
458
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
459
459
|
paths.add(candidate);
|
|
460
460
|
} catch (e4) {
|
|
461
|
-
paths.add(
|
|
461
|
+
paths.add(_chunkYUTKX7JZjs.importMetaUrl);
|
|
462
462
|
}
|
|
463
463
|
if (paths.size === 0) {
|
|
464
464
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.13__@swc+core@1.15.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.13__@swc+core@1.15.13_@swc_3c7849ff4c0b6c5a62dfcd4f04ae2c69/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);
|