weapp-tailwindcss 4.11.1 → 4.12.0-next.0
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/dist/{chunk-VOCOKTZW.js → chunk-5ONE75V7.js} +117 -119
- package/dist/{chunk-OMARW5NC.mjs → chunk-AYJ4HLWZ.mjs} +4 -2
- package/dist/{chunk-SV55AOBL.mjs → chunk-F5XJWJYO.mjs} +12 -7
- package/dist/{chunk-Y6JUVWRU.js → chunk-FMK6SFQQ.js} +10 -6
- package/dist/{chunk-SSASUP5F.js → chunk-GC7WXUOW.js} +187 -82
- package/dist/{chunk-KX2JVTVM.mjs → chunk-GD4SQMVF.mjs} +49 -51
- package/dist/{chunk-7LKMJZD2.js → chunk-GMKSBLNY.js} +2 -2
- package/dist/{chunk-EFBQ4SQR.mjs → chunk-HL3US2OT.mjs} +1 -1
- package/dist/{chunk-6YV5WADN.js → chunk-LVSUBDJC.js} +45 -40
- package/dist/{chunk-QK6VNNNL.js → chunk-NIS74SI6.js} +8 -6
- package/dist/{chunk-CRDOWYG4.js → chunk-ONLKZIRQ.js} +1 -1
- package/dist/{chunk-4O2J5ZM6.mjs → chunk-QNRJCEZN.mjs} +195 -90
- package/dist/{chunk-WSMWD4MC.mjs → chunk-UUJWDME4.mjs} +6 -2
- package/dist/{chunk-Q2HTQFI4.js → chunk-WSS26HZS.js} +5 -5
- package/dist/{chunk-ZUV5AZRB.mjs → chunk-ZR3KN3FG.mjs} +1 -1
- package/dist/cli.js +121 -81
- package/dist/cli.mjs +121 -81
- 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 +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.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/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 +41 -36
- package/dist/webpack4.mjs +12 -7
- package/package.json +8 -4
|
@@ -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) {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isMpx,
|
|
12
12
|
patchMpxLoaderResolve,
|
|
13
13
|
setupMpxTailwindcssRedirect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZR3KN3FG.mjs";
|
|
15
15
|
import {
|
|
16
16
|
pushConcurrentTaskFactories,
|
|
17
17
|
resolveDisabledOptions,
|
|
@@ -27,18 +27,19 @@ import {
|
|
|
27
27
|
ensureRuntimeClassSet,
|
|
28
28
|
getCompilerContext,
|
|
29
29
|
pluginName,
|
|
30
|
-
setupPatchRecorder
|
|
31
|
-
|
|
30
|
+
setupPatchRecorder,
|
|
31
|
+
shouldSkipJsTransform
|
|
32
|
+
} from "./chunk-QNRJCEZN.mjs";
|
|
32
33
|
import {
|
|
33
34
|
getRuntimeClassSetSignature,
|
|
34
35
|
resolveTailwindcssOptions
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-AYJ4HLWZ.mjs";
|
|
36
37
|
import {
|
|
37
38
|
getGroupedEntries
|
|
38
39
|
} from "./chunk-OOHJLO5M.mjs";
|
|
39
40
|
import {
|
|
40
41
|
__dirname
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-HL3US2OT.mjs";
|
|
42
43
|
|
|
43
44
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
44
45
|
import process3 from "process";
|
|
@@ -236,7 +237,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
236
237
|
const currentAsset = compilation.getAsset(file);
|
|
237
238
|
const currentSourceValue = currentAsset?.source.source();
|
|
238
239
|
const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : currentSourceValue?.toString() ?? "";
|
|
239
|
-
const
|
|
240
|
+
const handlerOptions = {
|
|
240
241
|
staleClassNameFallback,
|
|
241
242
|
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
242
243
|
filename: absoluteFile,
|
|
@@ -244,7 +245,11 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
244
245
|
babelParserOptions: {
|
|
245
246
|
sourceFilename: absoluteFile
|
|
246
247
|
}
|
|
247
|
-
}
|
|
248
|
+
};
|
|
249
|
+
if (shouldSkipJsTransform(currentSource, handlerOptions)) {
|
|
250
|
+
return { result: new ConcatSource(currentSource) };
|
|
251
|
+
}
|
|
252
|
+
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
248
253
|
const source = new ConcatSource(code);
|
|
249
254
|
compilerOptions.onUpdate(file, currentSource, code);
|
|
250
255
|
debug2("js handle: %s", file);
|
|
@@ -7,7 +7,8 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkGC7WXUOWjs = require('./chunk-GC7WXUOW.js');
|
|
11
12
|
|
|
12
13
|
// src/bundlers/gulp/index.ts
|
|
13
14
|
var _buffer = require('buffer');
|
|
@@ -15,12 +16,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
15
16
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
16
17
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
17
18
|
var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
|
|
18
|
-
var debug =
|
|
19
|
+
var debug = _chunkGC7WXUOWjs.createDebug.call(void 0, );
|
|
19
20
|
var Transform = _stream2.default.Transform;
|
|
20
21
|
function createPlugins(options = {}) {
|
|
21
|
-
const opts =
|
|
22
|
+
const opts = _chunkGC7WXUOWjs.getCompilerContext.call(void 0, options);
|
|
22
23
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
23
|
-
const patchRecorderState =
|
|
24
|
+
const patchRecorderState = _chunkGC7WXUOWjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
24
25
|
source: "runtime",
|
|
25
26
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
26
27
|
});
|
|
@@ -38,13 +39,13 @@ function createPlugins(options = {}) {
|
|
|
38
39
|
const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
|
|
39
40
|
let runtimeSetInitialized = false;
|
|
40
41
|
async function refreshRuntimeState(force) {
|
|
41
|
-
await
|
|
42
|
+
await _chunkGC7WXUOWjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
42
43
|
}
|
|
43
44
|
async function refreshRuntimeSet(force = false) {
|
|
44
45
|
if (!force && runtimeSetInitialized) {
|
|
45
46
|
return runtimeSet;
|
|
46
47
|
}
|
|
47
|
-
runtimeSet = await
|
|
48
|
+
runtimeSet = await _chunkGC7WXUOWjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
48
49
|
forceRefresh: force,
|
|
49
50
|
forceCollect: force,
|
|
50
51
|
clearCache: force,
|
|
@@ -225,6 +226,9 @@ function createPlugins(options = {}) {
|
|
|
225
226
|
async transform() {
|
|
226
227
|
await runtimeState.patchPromise;
|
|
227
228
|
const currentSource = _nullishCoalesce(_optionalChain([file, 'access', _2 => _2.contents, 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]), () => ( rawSource));
|
|
229
|
+
if (_chunkGC7WXUOWjs.shouldSkipJsTransform.call(void 0, 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 {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkNIS74SI6js = require('./chunk-NIS74SI6.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
var _chunkA5PB4KZTjs = require('./chunk-A5PB4KZT.js');
|
|
@@ -39,7 +40,7 @@ var debug = createDebug("[tailwindcss:runtime] ");
|
|
|
39
40
|
var refreshTailwindcssPatcherSymbol = /* @__PURE__ */ Symbol.for("weapp-tailwindcss.refreshTailwindcssPatcher");
|
|
40
41
|
function createTailwindPatchPromise(twPatcher, onPatched) {
|
|
41
42
|
return Promise.resolve(twPatcher.patch()).then(async () => {
|
|
42
|
-
|
|
43
|
+
_chunkNIS74SI6js.invalidateRuntimeClassSet.call(void 0, twPatcher);
|
|
43
44
|
if (onPatched) {
|
|
44
45
|
try {
|
|
45
46
|
await onPatched();
|
|
@@ -94,7 +95,7 @@ async function ensureRuntimeClassSet(state, options = {}) {
|
|
|
94
95
|
}
|
|
95
96
|
await state.patchPromise;
|
|
96
97
|
const entry = getRuntimeClassSetStateEntry(state);
|
|
97
|
-
const signature =
|
|
98
|
+
const signature = _chunkNIS74SI6js.getRuntimeClassSetSignature.call(void 0, state.twPatcher);
|
|
98
99
|
const signatureChanged = entry.signature !== signature;
|
|
99
100
|
const shouldForceCollect = forceCollect || forceRefresh || signatureChanged;
|
|
100
101
|
if (!shouldForceCollect) {
|
|
@@ -129,7 +130,7 @@ async function ensureRuntimeClassSet(state, options = {}) {
|
|
|
129
130
|
try {
|
|
130
131
|
const runtimeSet = await task;
|
|
131
132
|
entry.value = runtimeSet;
|
|
132
|
-
entry.signature =
|
|
133
|
+
entry.signature = _chunkNIS74SI6js.getRuntimeClassSetSignature.call(void 0, state.twPatcher);
|
|
133
134
|
return runtimeSet;
|
|
134
135
|
} finally {
|
|
135
136
|
if (entry.promise === task) {
|
|
@@ -186,8 +187,8 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
const entry =
|
|
190
|
-
const signature =
|
|
190
|
+
const entry = _chunkNIS74SI6js.getRuntimeClassSetCacheEntry.call(void 0, activePatcher);
|
|
191
|
+
const signature = _chunkNIS74SI6js.getRuntimeClassSetSignature.call(void 0, activePatcher);
|
|
191
192
|
if (!options.force) {
|
|
192
193
|
if (entry.value && entry.signature === signature) {
|
|
193
194
|
return entry.value;
|
|
@@ -361,9 +362,51 @@ function initializeCache(cacheConfig) {
|
|
|
361
362
|
return cacheConfig;
|
|
362
363
|
}
|
|
363
364
|
|
|
364
|
-
// src/tailwindcss/
|
|
365
|
+
// src/tailwindcss/runtime-logs.ts
|
|
365
366
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
366
367
|
|
|
368
|
+
var runtimeLogDedupeHolder = globalThis;
|
|
369
|
+
var runtimeLogDedupe = _nullishCoalesce(runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__, () => ( (runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ = /* @__PURE__ */ new Set())));
|
|
370
|
+
function createRuntimeLogKey(category, baseDir, rootPath, version) {
|
|
371
|
+
return JSON.stringify([
|
|
372
|
+
category,
|
|
373
|
+
_nullishCoalesce(baseDir, () => ( _process2.default.cwd())),
|
|
374
|
+
_nullishCoalesce(rootPath, () => ( "")),
|
|
375
|
+
_nullishCoalesce(version, () => ( ""))
|
|
376
|
+
]);
|
|
377
|
+
}
|
|
378
|
+
function markRuntimeLog(category, baseDir, rootPath, version) {
|
|
379
|
+
const key = createRuntimeLogKey(category, baseDir, rootPath, version);
|
|
380
|
+
if (runtimeLogDedupe.has(key)) {
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
runtimeLogDedupe.add(key);
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
function logRuntimeTailwindcssTarget(baseDir, rootPath, version) {
|
|
387
|
+
if (!markRuntimeLog("target", baseDir, rootPath, version)) {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const versionText = version ? ` (v${version})` : "";
|
|
391
|
+
_logger.logger.info("%s \u4F7F\u7528 Tailwind CSS%s", "Weapp-tailwindcss", versionText);
|
|
392
|
+
}
|
|
393
|
+
function logRuntimeTailwindcssVersion(baseDir, rootPath, version) {
|
|
394
|
+
if (version) {
|
|
395
|
+
if (!markRuntimeLog("version", baseDir, rootPath, version)) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
_logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(version)))}`);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
if (!markRuntimeLog("missing", baseDir, rootPath, version)) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
_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`);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// src/tailwindcss/targets.ts
|
|
408
|
+
|
|
409
|
+
|
|
367
410
|
|
|
368
411
|
// src/tailwindcss/targets/paths.ts
|
|
369
412
|
var _fs = require('fs');
|
|
@@ -386,7 +429,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
386
429
|
}
|
|
387
430
|
function resolveRecordLocation(baseDir) {
|
|
388
431
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
389
|
-
const packageRoot = _nullishCoalesce(
|
|
432
|
+
const packageRoot = _nullishCoalesce(_chunkNIS74SI6js.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
390
433
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
391
434
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
392
435
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -423,7 +466,7 @@ function getRecordFileCandidates(baseDir) {
|
|
|
423
466
|
// package.json
|
|
424
467
|
var package_default = {
|
|
425
468
|
name: "weapp-tailwindcss",
|
|
426
|
-
version: "4.
|
|
469
|
+
version: "4.12.0-next.0",
|
|
427
470
|
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!",
|
|
428
471
|
author: "ice breaker <1324318532@qq.com>",
|
|
429
472
|
license: "MIT",
|
|
@@ -625,6 +668,7 @@ var package_default = {
|
|
|
625
668
|
"@weapp-core/regex": "~1.0.1",
|
|
626
669
|
"@weapp-tailwindcss/logger": "workspace:*",
|
|
627
670
|
"@weapp-tailwindcss/postcss": "workspace:*",
|
|
671
|
+
"@weapp-tailwindcss/reset": "workspace:*",
|
|
628
672
|
"@weapp-tailwindcss/shared": "workspace:*",
|
|
629
673
|
cac: "6.7.14",
|
|
630
674
|
"comment-json": "^4.6.2",
|
|
@@ -639,6 +683,9 @@ var package_default = {
|
|
|
639
683
|
"tailwindcss-patch": "catalog:tailwindcssPatch",
|
|
640
684
|
"webpack-sources": "3.3.4",
|
|
641
685
|
yaml: "^2.8.3"
|
|
686
|
+
},
|
|
687
|
+
devDependencies: {
|
|
688
|
+
"fast-check": "^4.7.0"
|
|
642
689
|
}
|
|
643
690
|
};
|
|
644
691
|
|
|
@@ -814,7 +861,7 @@ function createPatchTargetRecorder(baseDir, patcher, options) {
|
|
|
814
861
|
// src/tailwindcss/targets.ts
|
|
815
862
|
function logTailwindcssTarget(kind, patcher, baseDir) {
|
|
816
863
|
const packageInfo = _optionalChain([patcher, 'optionalAccess', _20 => _20.packageInfo]);
|
|
817
|
-
const label = kind === "cli" ? "weapp-tw patch" : "tailwindcss
|
|
864
|
+
const label = kind === "cli" ? "weapp-tw patch" : "Weapp-tailwindcss";
|
|
818
865
|
if (!_optionalChain([packageInfo, 'optionalAccess', _21 => _21.rootPath])) {
|
|
819
866
|
_logger.logger.warn(
|
|
820
867
|
"%s \u672A\u627E\u5230 Tailwind CSS \u4F9D\u8D56\uFF0C\u8BF7\u68C0\u67E5\u5728 %s \u662F\u5426\u5DF2\u5B89\u88C5 tailwindcss",
|
|
@@ -825,6 +872,10 @@ function logTailwindcssTarget(kind, patcher, baseDir) {
|
|
|
825
872
|
}
|
|
826
873
|
const displayPath = formatRelativeToBase(packageInfo.rootPath, baseDir);
|
|
827
874
|
const version = packageInfo.version ? ` (v${packageInfo.version})` : "";
|
|
875
|
+
if (kind === "runtime") {
|
|
876
|
+
logRuntimeTailwindcssTarget(baseDir, packageInfo.rootPath, packageInfo.version);
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
828
879
|
_logger.logger.info("%s \u7ED1\u5B9A Tailwind CSS -> %s%s", label, displayPath, version);
|
|
829
880
|
}
|
|
830
881
|
|
|
@@ -1118,6 +1169,9 @@ function toCustomAttributesEntities(customAttributes) {
|
|
|
1118
1169
|
// src/context/handlers.ts
|
|
1119
1170
|
var _postcss = require('@weapp-tailwindcss/postcss');
|
|
1120
1171
|
|
|
1172
|
+
// src/js/index.ts
|
|
1173
|
+
|
|
1174
|
+
|
|
1121
1175
|
// src/babel/index.ts
|
|
1122
1176
|
var _traverse = require('@babel/traverse'); var _traverse2 = _interopRequireDefault(_traverse);
|
|
1123
1177
|
var _parser = require('@babel/parser');
|
|
@@ -2935,6 +2989,49 @@ function jsHandler(rawSource, options) {
|
|
|
2935
2989
|
}
|
|
2936
2990
|
|
|
2937
2991
|
// src/js/index.ts
|
|
2992
|
+
var RESULT_CACHE_MAX = 512;
|
|
2993
|
+
var classNameSetIds = /* @__PURE__ */ new WeakMap();
|
|
2994
|
+
var nextClassNameSetId = 0;
|
|
2995
|
+
function getClassNameSetId(set) {
|
|
2996
|
+
if (!set) {
|
|
2997
|
+
return "none";
|
|
2998
|
+
}
|
|
2999
|
+
const existing = classNameSetIds.get(set);
|
|
3000
|
+
if (existing !== void 0) {
|
|
3001
|
+
return String(existing);
|
|
3002
|
+
}
|
|
3003
|
+
const id = nextClassNameSetId++;
|
|
3004
|
+
classNameSetIds.set(set, id);
|
|
3005
|
+
return String(id);
|
|
3006
|
+
}
|
|
3007
|
+
var fingerprintCache = /* @__PURE__ */ new WeakMap();
|
|
3008
|
+
function getOptionsFingerprint(options) {
|
|
3009
|
+
const cached = fingerprintCache.get(options);
|
|
3010
|
+
if (cached) {
|
|
3011
|
+
return cached;
|
|
3012
|
+
}
|
|
3013
|
+
const parts = [
|
|
3014
|
+
getClassNameSetId(options.classNameSet),
|
|
3015
|
+
JSON.stringify(_nullishCoalesce(options.escapeMap, () => ( null))),
|
|
3016
|
+
options.needEscaped ? "1" : "0",
|
|
3017
|
+
options.alwaysEscape ? "1" : "0",
|
|
3018
|
+
options.unescapeUnicode ? "1" : "0",
|
|
3019
|
+
options.generateMap ? "1" : "0",
|
|
3020
|
+
options.uniAppX ? "1" : "0",
|
|
3021
|
+
options.wrapExpression ? "1" : "0",
|
|
3022
|
+
String(_nullishCoalesce(options.tailwindcssMajorVersion, () => ( ""))),
|
|
3023
|
+
String(_nullishCoalesce(options.staleClassNameFallback, () => ( ""))),
|
|
3024
|
+
String(_nullishCoalesce(options.jsArbitraryValueFallback, () => ( ""))),
|
|
3025
|
+
JSON.stringify(_nullishCoalesce(options.arbitraryValues, () => ( null))),
|
|
3026
|
+
JSON.stringify(_nullishCoalesce(options.ignoreCallExpressionIdentifiers, () => ( null))),
|
|
3027
|
+
JSON.stringify(_nullishCoalesce(_optionalChain([options, 'access', _99 => _99.ignoreTaggedTemplateExpressionIdentifiers, 'optionalAccess', _100 => _100.map, 'call', _101 => _101((v) => v instanceof RegExp ? v.source : v)]), () => ( null))),
|
|
3028
|
+
JSON.stringify(_nullishCoalesce(options.moduleSpecifierReplacements, () => ( null))),
|
|
3029
|
+
JSON.stringify(_nullishCoalesce(options.babelParserOptions, () => ( null)))
|
|
3030
|
+
];
|
|
3031
|
+
const fingerprint = parts.join("|");
|
|
3032
|
+
fingerprintCache.set(options, fingerprint);
|
|
3033
|
+
return fingerprint;
|
|
3034
|
+
}
|
|
2938
3035
|
function hasDefinedOverrides(options) {
|
|
2939
3036
|
if (!options) {
|
|
2940
3037
|
return false;
|
|
@@ -2946,17 +3043,6 @@ function hasDefinedOverrides(options) {
|
|
|
2946
3043
|
}
|
|
2947
3044
|
return false;
|
|
2948
3045
|
}
|
|
2949
|
-
var CACHEABLE_SOURCE_MAX_LENGTH = 512;
|
|
2950
|
-
var RESULT_CACHE_LIMIT = 256;
|
|
2951
|
-
function shouldCacheJsResult(rawSource, options) {
|
|
2952
|
-
if (rawSource.length === 0 || rawSource.length > CACHEABLE_SOURCE_MAX_LENGTH) {
|
|
2953
|
-
return false;
|
|
2954
|
-
}
|
|
2955
|
-
if (options.moduleGraph || options.filename) {
|
|
2956
|
-
return false;
|
|
2957
|
-
}
|
|
2958
|
-
return true;
|
|
2959
|
-
}
|
|
2960
3046
|
function createJsHandler(options) {
|
|
2961
3047
|
const defaults = {
|
|
2962
3048
|
escapeMap: options.escapeMap,
|
|
@@ -2975,11 +3061,10 @@ function createJsHandler(options) {
|
|
|
2975
3061
|
uniAppX: options.uniAppX,
|
|
2976
3062
|
moduleSpecifierReplacements: options.moduleSpecifierReplacements
|
|
2977
3063
|
};
|
|
2978
|
-
const
|
|
3064
|
+
const defaultOptionsCache = /* @__PURE__ */ new WeakMap();
|
|
2979
3065
|
let resolvedOptionsWithoutClassNameSet;
|
|
2980
|
-
const
|
|
2981
|
-
const
|
|
2982
|
-
const resultCache = /* @__PURE__ */ new WeakMap();
|
|
3066
|
+
const overrideOptionsCache = /* @__PURE__ */ new WeakMap();
|
|
3067
|
+
const resultCache = new (0, _lrucache.LRUCache)({ max: RESULT_CACHE_MAX });
|
|
2983
3068
|
function resolveDefaultOptions(classNameSet) {
|
|
2984
3069
|
if (!classNameSet) {
|
|
2985
3070
|
if (!resolvedOptionsWithoutClassNameSet) {
|
|
@@ -2990,7 +3075,7 @@ function createJsHandler(options) {
|
|
|
2990
3075
|
}
|
|
2991
3076
|
return resolvedOptionsWithoutClassNameSet;
|
|
2992
3077
|
}
|
|
2993
|
-
const cached =
|
|
3078
|
+
const cached = defaultOptionsCache.get(classNameSet);
|
|
2994
3079
|
if (cached) {
|
|
2995
3080
|
return cached;
|
|
2996
3081
|
}
|
|
@@ -2998,42 +3083,36 @@ function createJsHandler(options) {
|
|
|
2998
3083
|
...defaults,
|
|
2999
3084
|
classNameSet
|
|
3000
3085
|
};
|
|
3001
|
-
|
|
3086
|
+
defaultOptionsCache.set(classNameSet, created);
|
|
3002
3087
|
return created;
|
|
3003
3088
|
}
|
|
3004
3089
|
function getCachedJsResult(rawSource, resolvedOptions) {
|
|
3005
|
-
if (
|
|
3090
|
+
if (rawSource.length === 0) {
|
|
3006
3091
|
return void 0;
|
|
3007
3092
|
}
|
|
3008
|
-
const
|
|
3009
|
-
return
|
|
3093
|
+
const key = `${getOptionsFingerprint(resolvedOptions)}:${_node.md5.call(void 0, rawSource)}`;
|
|
3094
|
+
return resultCache.get(key);
|
|
3010
3095
|
}
|
|
3011
3096
|
function setCachedJsResult(rawSource, resolvedOptions, result) {
|
|
3012
|
-
if (
|
|
3097
|
+
if (rawSource.length === 0 || result.error || result.linked) {
|
|
3013
3098
|
return result;
|
|
3014
3099
|
}
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
cache = /* @__PURE__ */ new Map();
|
|
3018
|
-
resultCache.set(resolvedOptions, cache);
|
|
3019
|
-
}
|
|
3020
|
-
cache.set(rawSource, result);
|
|
3021
|
-
if (cache.size > RESULT_CACHE_LIMIT) {
|
|
3022
|
-
const firstKey = cache.keys().next().value;
|
|
3023
|
-
if (typeof firstKey === "string") {
|
|
3024
|
-
cache.delete(firstKey);
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3100
|
+
const key = `${getOptionsFingerprint(resolvedOptions)}:${_node.md5.call(void 0, rawSource)}`;
|
|
3101
|
+
resultCache.set(key, result);
|
|
3027
3102
|
return result;
|
|
3028
3103
|
}
|
|
3029
3104
|
function resolveOptions(classNameSet, overrideOptions) {
|
|
3030
3105
|
if (!hasDefinedOverrides(overrideOptions)) {
|
|
3031
3106
|
return resolveDefaultOptions(classNameSet);
|
|
3032
3107
|
}
|
|
3108
|
+
let entry = overrideOptionsCache.get(overrideOptions);
|
|
3109
|
+
if (!entry) {
|
|
3110
|
+
entry = { bySet: /* @__PURE__ */ new WeakMap() };
|
|
3111
|
+
overrideOptionsCache.set(overrideOptions, entry);
|
|
3112
|
+
}
|
|
3033
3113
|
if (!classNameSet) {
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
return cached2;
|
|
3114
|
+
if (entry.noSet) {
|
|
3115
|
+
return entry.noSet;
|
|
3037
3116
|
}
|
|
3038
3117
|
const created2 = _chunkDYLQ6UOIjs.defuOverrideArray.call(void 0,
|
|
3039
3118
|
{
|
|
@@ -3042,15 +3121,10 @@ function createJsHandler(options) {
|
|
|
3042
3121
|
},
|
|
3043
3122
|
defaults
|
|
3044
3123
|
);
|
|
3045
|
-
|
|
3124
|
+
entry.noSet = created2;
|
|
3046
3125
|
return created2;
|
|
3047
3126
|
}
|
|
3048
|
-
|
|
3049
|
-
if (!cache) {
|
|
3050
|
-
cache = /* @__PURE__ */ new WeakMap();
|
|
3051
|
-
resolvedOverrideOptionsByClassNameSet.set(overrideOptions, cache);
|
|
3052
|
-
}
|
|
3053
|
-
const cached = cache.get(classNameSet);
|
|
3127
|
+
const cached = entry.bySet.get(classNameSet);
|
|
3054
3128
|
if (cached) {
|
|
3055
3129
|
return cached;
|
|
3056
3130
|
}
|
|
@@ -3061,7 +3135,7 @@ function createJsHandler(options) {
|
|
|
3061
3135
|
},
|
|
3062
3136
|
defaults
|
|
3063
3137
|
);
|
|
3064
|
-
|
|
3138
|
+
entry.bySet.set(classNameSet, created);
|
|
3065
3139
|
return created;
|
|
3066
3140
|
}
|
|
3067
3141
|
function handler(rawSource, classNameSet, options2) {
|
|
@@ -3154,7 +3228,7 @@ function shouldSkipLegacyStringLiteral(path5) {
|
|
|
3154
3228
|
return true;
|
|
3155
3229
|
}
|
|
3156
3230
|
return Boolean(
|
|
3157
|
-
t.isBinaryExpression(path5.parent) && (t.isConditionalExpression(_optionalChain([path5, 'access',
|
|
3231
|
+
t.isBinaryExpression(path5.parent) && (t.isConditionalExpression(_optionalChain([path5, 'access', _102 => _102.parentPath, 'optionalAccess', _103 => _103.parent])) || t.isLogicalExpression(_optionalChain([path5, 'access', _104 => _104.parentPath, 'optionalAccess', _105 => _105.parent])))
|
|
3158
3232
|
);
|
|
3159
3233
|
}
|
|
3160
3234
|
function createLegacyTraverseOptions(options, jsTokenUpdater) {
|
|
@@ -3496,7 +3570,7 @@ async function customTemplateHandler(rawSource, options, cachedMatcher) {
|
|
|
3496
3570
|
return;
|
|
3497
3571
|
}
|
|
3498
3572
|
const shouldHandleDefault = defaultTemplateHandlerEnabled && isDefaultTemplateAttribute(name);
|
|
3499
|
-
const shouldHandleCustom = _nullishCoalesce(_optionalChain([matchCustomAttribute, 'optionalCall',
|
|
3573
|
+
const shouldHandleCustom = _nullishCoalesce(_optionalChain([matchCustomAttribute, 'optionalCall', _106 => _106(tag, name)]), () => ( false));
|
|
3500
3574
|
if (!shouldHandleDefault && !shouldHandleCustom) {
|
|
3501
3575
|
return;
|
|
3502
3576
|
}
|
|
@@ -3536,7 +3610,7 @@ async function customTemplateHandler(rawSource, options, cachedMatcher) {
|
|
|
3536
3610
|
getMagicString().update(startIndex, endIndex, code);
|
|
3537
3611
|
}
|
|
3538
3612
|
}
|
|
3539
|
-
return _nullishCoalesce(_optionalChain([s, 'optionalAccess',
|
|
3613
|
+
return _nullishCoalesce(_optionalChain([s, 'optionalAccess', _107 => _107.toString, 'call', _108 => _108()]), () => ( rawSource));
|
|
3540
3614
|
}
|
|
3541
3615
|
|
|
3542
3616
|
// src/wxml/utils.ts
|
|
@@ -3548,7 +3622,7 @@ function createTemplateHandler(options = {}) {
|
|
|
3548
3622
|
let cachedRuntimeSet;
|
|
3549
3623
|
let cachedOptionsWithRuntimeSet;
|
|
3550
3624
|
return (rawSource, opt) => {
|
|
3551
|
-
const runtimeSet = _optionalChain([opt, 'optionalAccess',
|
|
3625
|
+
const runtimeSet = _optionalChain([opt, 'optionalAccess', _109 => _109.runtimeSet]);
|
|
3552
3626
|
if (runtimeSet === void 0) {
|
|
3553
3627
|
return customTemplateHandler(rawSource, defaultOptions, cachedMatcher);
|
|
3554
3628
|
}
|
|
@@ -3591,6 +3665,7 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3591
3665
|
cssRemoveProperty,
|
|
3592
3666
|
cssRemoveHoverPseudoClass,
|
|
3593
3667
|
cssPresetEnv,
|
|
3668
|
+
autoprefixer,
|
|
3594
3669
|
uniAppX,
|
|
3595
3670
|
px2rpx,
|
|
3596
3671
|
unitsToPx,
|
|
@@ -3605,7 +3680,8 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3605
3680
|
disabledDefaultTemplateHandler,
|
|
3606
3681
|
replaceRuntimePackages
|
|
3607
3682
|
} = ctx;
|
|
3608
|
-
const uniAppXEnabled =
|
|
3683
|
+
const uniAppXEnabled = _chunkNIS74SI6js.isUniAppXEnabled.call(void 0, uniAppX);
|
|
3684
|
+
const resolvedUniAppXOptions = _chunkNIS74SI6js.resolveUniAppXOptions.call(void 0, uniAppX);
|
|
3609
3685
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
3610
3686
|
const styleHandler = _postcss.createStyleHandler.call(void 0, {
|
|
3611
3687
|
cssPreflight,
|
|
@@ -3619,10 +3695,13 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
3619
3695
|
cssRemoveProperty,
|
|
3620
3696
|
cssRemoveHoverPseudoClass,
|
|
3621
3697
|
cssPresetEnv,
|
|
3698
|
+
autoprefixer,
|
|
3622
3699
|
uniAppX: uniAppXEnabled,
|
|
3700
|
+
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
3623
3701
|
cssCalc: cssCalcOptions,
|
|
3624
3702
|
px2rpx,
|
|
3625
|
-
unitsToPx
|
|
3703
|
+
unitsToPx,
|
|
3704
|
+
majorVersion: tailwindcssMajorVersion
|
|
3626
3705
|
});
|
|
3627
3706
|
const jsHandler2 = createJsHandler({
|
|
3628
3707
|
escapeMap,
|
|
@@ -3669,7 +3748,7 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
3669
3748
|
if (!patcher) {
|
|
3670
3749
|
return;
|
|
3671
3750
|
}
|
|
3672
|
-
const cacheOptions = _optionalChain([patcher, 'access',
|
|
3751
|
+
const cacheOptions = _optionalChain([patcher, 'access', _110 => _110.options, 'optionalAccess', _111 => _111.cache]);
|
|
3673
3752
|
if (cacheOptions == null || typeof cacheOptions === "object" && cacheOptions.enabled === false) {
|
|
3674
3753
|
return;
|
|
3675
3754
|
}
|
|
@@ -3680,19 +3759,19 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
3680
3759
|
_logger.logger.debug("failed to clear tailwindcss patcher cache via clearCache(): %O", error);
|
|
3681
3760
|
}
|
|
3682
3761
|
}
|
|
3683
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
3762
|
+
if (!_optionalChain([options, 'optionalAccess', _112 => _112.removeDirectory])) {
|
|
3684
3763
|
return;
|
|
3685
3764
|
}
|
|
3686
3765
|
const cachePaths = /* @__PURE__ */ new Map();
|
|
3687
3766
|
const normalizedCacheOptions = typeof cacheOptions === "object" ? cacheOptions : void 0;
|
|
3688
|
-
if (_optionalChain([normalizedCacheOptions, 'optionalAccess',
|
|
3767
|
+
if (_optionalChain([normalizedCacheOptions, 'optionalAccess', _113 => _113.path])) {
|
|
3689
3768
|
cachePaths.set(normalizedCacheOptions.path, false);
|
|
3690
3769
|
}
|
|
3691
|
-
const privateCachePath = _optionalChain([patcher, 'optionalAccess',
|
|
3770
|
+
const privateCachePath = _optionalChain([patcher, 'optionalAccess', _114 => _114.cacheStore, 'optionalAccess', _115 => _115.options, 'optionalAccess', _116 => _116.path]);
|
|
3692
3771
|
if (privateCachePath) {
|
|
3693
3772
|
cachePaths.set(privateCachePath, false);
|
|
3694
3773
|
}
|
|
3695
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3774
|
+
if (_optionalChain([options, 'optionalAccess', _117 => _117.removeDirectory]) && _optionalChain([normalizedCacheOptions, 'optionalAccess', _118 => _118.dir])) {
|
|
3696
3775
|
cachePaths.set(normalizedCacheOptions.dir, true);
|
|
3697
3776
|
}
|
|
3698
3777
|
if (!cachePaths.size) {
|
|
@@ -3703,7 +3782,7 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
3703
3782
|
await _promises.rm.call(void 0, cachePath, { force: true, recursive });
|
|
3704
3783
|
} catch (error) {
|
|
3705
3784
|
const err = error;
|
|
3706
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
3785
|
+
if (_optionalChain([err, 'optionalAccess', _119 => _119.code]) === "ENOENT") {
|
|
3707
3786
|
continue;
|
|
3708
3787
|
}
|
|
3709
3788
|
_logger.logger.debug("failed to clear tailwindcss patcher cache: %s %O", cachePath, err);
|
|
@@ -3718,15 +3797,15 @@ function createInternalCompilerContext(opts) {
|
|
|
3718
3797
|
);
|
|
3719
3798
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
3720
3799
|
applyLoggerLevel(ctx.logLevel);
|
|
3721
|
-
const twPatcher =
|
|
3800
|
+
const twPatcher = _chunkNIS74SI6js.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
3722
3801
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
const cssCalcOptions =
|
|
3802
|
+
logRuntimeTailwindcssVersion(
|
|
3803
|
+
ctx.tailwindcssBasedir,
|
|
3804
|
+
_optionalChain([twPatcher, 'access', _120 => _120.packageInfo, 'optionalAccess', _121 => _121.rootPath]),
|
|
3805
|
+
_optionalChain([twPatcher, 'access', _122 => _122.packageInfo, 'optionalAccess', _123 => _123.version])
|
|
3806
|
+
);
|
|
3807
|
+
_chunkNIS74SI6js.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
3808
|
+
const cssCalcOptions = _chunkNIS74SI6js.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
3730
3809
|
ctx.cssCalc = cssCalcOptions;
|
|
3731
3810
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
3732
3811
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -3742,11 +3821,11 @@ function createInternalCompilerContext(opts) {
|
|
|
3742
3821
|
ctx.twPatcher = twPatcher;
|
|
3743
3822
|
const refreshTailwindcssPatcher = async (options) => {
|
|
3744
3823
|
const previousPatcher = ctx.twPatcher;
|
|
3745
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
3824
|
+
if (_optionalChain([options, 'optionalAccess', _124 => _124.clearCache]) !== false) {
|
|
3746
3825
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
3747
3826
|
}
|
|
3748
|
-
|
|
3749
|
-
const nextPatcher =
|
|
3827
|
+
_chunkNIS74SI6js.invalidateRuntimeClassSet.call(void 0, previousPatcher);
|
|
3828
|
+
const nextPatcher = _chunkNIS74SI6js.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
3750
3829
|
Object.assign(previousPatcher, nextPatcher);
|
|
3751
3830
|
ctx.twPatcher = previousPatcher;
|
|
3752
3831
|
return previousPatcher;
|
|
@@ -3762,14 +3841,39 @@ function getCompilerContext(opts) {
|
|
|
3762
3841
|
return withCompilerContextCache(opts, () => createInternalCompilerContext(opts));
|
|
3763
3842
|
}
|
|
3764
3843
|
|
|
3844
|
+
// src/js/precheck.ts
|
|
3845
|
+
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)-/;
|
|
3846
|
+
var DEPENDENCY_HINT_RE = /\bimport\s*[("'`{*]|\brequire\s*\(|\bexport\s+\*\s+from\s+["'`]|\bexport\s*\{[^}]*\}\s*from\s+["'`]/;
|
|
3847
|
+
function shouldSkipJsTransform(rawSource, options) {
|
|
3848
|
+
if (process.env.WEAPP_TW_DISABLE_JS_PRECHECK === "1") {
|
|
3849
|
+
return false;
|
|
3850
|
+
}
|
|
3851
|
+
if (!rawSource) {
|
|
3852
|
+
return true;
|
|
3853
|
+
}
|
|
3854
|
+
if (_optionalChain([options, 'optionalAccess', _125 => _125.alwaysEscape])) {
|
|
3855
|
+
return false;
|
|
3856
|
+
}
|
|
3857
|
+
if (_optionalChain([options, 'optionalAccess', _126 => _126.moduleSpecifierReplacements]) && Object.keys(options.moduleSpecifierReplacements).length > 0) {
|
|
3858
|
+
return false;
|
|
3859
|
+
}
|
|
3860
|
+
if (_optionalChain([options, 'optionalAccess', _127 => _127.wrapExpression])) {
|
|
3861
|
+
return false;
|
|
3862
|
+
}
|
|
3863
|
+
if (DEPENDENCY_HINT_RE.test(rawSource)) {
|
|
3864
|
+
return false;
|
|
3865
|
+
}
|
|
3866
|
+
return !FAST_JS_TRANSFORM_HINT_RE.test(rawSource);
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3765
3869
|
// src/tailwindcss/recorder.ts
|
|
3766
3870
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
3767
3871
|
const recorder = createPatchTargetRecorder(baseDir, patcher, options);
|
|
3768
|
-
if (_optionalChain([recorder, 'optionalAccess',
|
|
3769
|
-
const prefix = _optionalChain([options, 'optionalAccess',
|
|
3770
|
-
|
|
3872
|
+
if (_optionalChain([recorder, 'optionalAccess', _128 => _128.message]) && _optionalChain([options, 'optionalAccess', _129 => _129.logMessage]) !== false) {
|
|
3873
|
+
const prefix = _optionalChain([options, 'optionalAccess', _130 => _130.messagePrefix]) ? `${options.messagePrefix} ` : "";
|
|
3874
|
+
_chunkNIS74SI6js.logger.info("%s%s", prefix, recorder.message);
|
|
3771
3875
|
}
|
|
3772
|
-
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess',
|
|
3876
|
+
const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _131 => _131.onPatched]) ? async () => {
|
|
3773
3877
|
await recorder.onPatched();
|
|
3774
3878
|
} : void 0;
|
|
3775
3879
|
const patchPromise = patcher ? createTailwindPatchPromise(patcher, onPatchCompleted) : Promise.resolve();
|
|
@@ -3798,4 +3902,5 @@ function setupPatchRecorder(patcher, baseDir, options) {
|
|
|
3798
3902
|
|
|
3799
3903
|
|
|
3800
3904
|
|
|
3801
|
-
|
|
3905
|
+
|
|
3906
|
+
exports.createDebug = createDebug; exports.refreshTailwindRuntimeState = refreshTailwindRuntimeState; exports.ensureRuntimeClassSet = ensureRuntimeClassSet; exports.collectRuntimeClassSet = collectRuntimeClassSet; exports.pluginName = pluginName; exports.vitePluginName = vitePluginName; exports.toCustomAttributesEntities = toCustomAttributesEntities; exports.traverse = traverse; exports.babelParse = babelParse; exports.replaceWxml = replaceWxml; exports.isClassContextLiteralPath = isClassContextLiteralPath; exports.JsTokenUpdater = JsTokenUpdater; exports.analyzeSource = analyzeSource; exports.createAttributeMatcher = createAttributeMatcher; exports.generateCode = generateCode; exports.getCompilerContext = getCompilerContext; exports.shouldSkipJsTransform = shouldSkipJsTransform; exports.setupPatchRecorder = setupPatchRecorder;
|