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
|
@@ -10,27 +10,27 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkWF636Q5Ejs = require('./chunk-WF636Q5E.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk6Z4GEN2Yjs = require('./chunk-6Z4GEN2Y.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkGCRL3ZYPjs = require('./chunk-GCRL3ZYP.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkDEIJXHGJjs = require('./chunk-DEIJXHGJ.js');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -57,10 +57,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
57
57
|
} = options;
|
|
58
58
|
const { Compilation, sources } = compiler.webpack;
|
|
59
59
|
const { ConcatSource } = sources;
|
|
60
|
-
compiler.hooks.compilation.tap(
|
|
60
|
+
compiler.hooks.compilation.tap(_chunkDEIJXHGJjs.pluginName, (compilation) => {
|
|
61
61
|
compilation.hooks.processAssets.tapPromise(
|
|
62
62
|
{
|
|
63
|
-
name:
|
|
63
|
+
name: _chunkDEIJXHGJjs.pluginName,
|
|
64
64
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
65
65
|
},
|
|
66
66
|
async (assets) => {
|
|
@@ -72,20 +72,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
72
72
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
const assetHashByChunk =
|
|
75
|
+
const assetHashByChunk = _chunkWF636Q5Ejs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
76
76
|
const entries = Object.entries(assets);
|
|
77
77
|
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
78
78
|
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
79
79
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
80
80
|
for (const [file] of entries) {
|
|
81
81
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
82
|
-
const absolute =
|
|
82
|
+
const absolute = _chunk6Z4GEN2Yjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
83
83
|
jsAssets.set(absolute, file);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
const moduleGraphOptions = {
|
|
87
87
|
resolve(specifier, importer) {
|
|
88
|
-
return
|
|
88
|
+
return _chunk6Z4GEN2Yjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
89
89
|
},
|
|
90
90
|
load: (id) => {
|
|
91
91
|
const assetName = jsAssets.get(id);
|
|
@@ -129,7 +129,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
129
129
|
};
|
|
130
130
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
131
131
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
132
|
-
const runtimeSet = await
|
|
132
|
+
const runtimeSet = await _chunkDEIJXHGJjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
133
133
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
134
134
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
135
135
|
forceCollect: true,
|
|
@@ -174,12 +174,12 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
174
174
|
const jsTaskFactories = [];
|
|
175
175
|
if (Array.isArray(groupedEntries.js)) {
|
|
176
176
|
for (const [file] of groupedEntries.js) {
|
|
177
|
-
const cacheKey =
|
|
177
|
+
const cacheKey = _chunkWF636Q5Ejs.getCacheKey.call(void 0, file);
|
|
178
178
|
const asset = compilation.getAsset(file);
|
|
179
179
|
if (!asset) {
|
|
180
180
|
continue;
|
|
181
181
|
}
|
|
182
|
-
const absoluteFile =
|
|
182
|
+
const absoluteFile = _chunk6Z4GEN2Yjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
183
183
|
const initialSource = asset.source.source();
|
|
184
184
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
185
185
|
const chunkHash = assetHashByChunk.get(file);
|
|
@@ -262,7 +262,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
262
262
|
);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
|
|
265
|
+
_chunk6Z4GEN2Yjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
266
266
|
await Promise.all(tasks);
|
|
267
267
|
debug2("end");
|
|
268
268
|
compilerOptions.onEnd();
|
|
@@ -287,9 +287,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
287
287
|
getClassSetInLoader,
|
|
288
288
|
debug: debug2
|
|
289
289
|
} = options;
|
|
290
|
-
const isMpxApp =
|
|
290
|
+
const isMpxApp = _chunkWF636Q5Ejs.isMpx.call(void 0, appType);
|
|
291
291
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
292
|
-
|
|
292
|
+
_chunkWF636Q5Ejs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
293
293
|
}
|
|
294
294
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
295
295
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -302,12 +302,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
302
302
|
const classSetLoaderOptions = {
|
|
303
303
|
getClassSet: getClassSetInLoader
|
|
304
304
|
};
|
|
305
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
305
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkWF636Q5Ejs.createLoaderAnchorFinders.call(void 0, appType);
|
|
306
306
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
307
307
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
308
308
|
} : void 0;
|
|
309
309
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
310
|
-
|
|
310
|
+
_chunkWF636Q5Ejs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
311
311
|
}
|
|
312
312
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
313
313
|
loader: runtimeClassSetLoader,
|
|
@@ -327,17 +327,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
327
327
|
};
|
|
328
328
|
};
|
|
329
329
|
const { NormalModule } = compiler.webpack;
|
|
330
|
-
compiler.hooks.compilation.tap(
|
|
331
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
330
|
+
compiler.hooks.compilation.tap(_chunkDEIJXHGJjs.pluginName, (compilation) => {
|
|
331
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkDEIJXHGJjs.pluginName, (_loaderContext, module) => {
|
|
332
332
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
333
333
|
if (!hasRuntimeLoader) {
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
_chunkWF636Q5Ejs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
337
337
|
const loaderEntries = module.loaders || [];
|
|
338
338
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
339
339
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
340
|
-
const isCssModule =
|
|
340
|
+
const isCssModule = _chunkWF636Q5Ejs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
341
341
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
342
342
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
343
343
|
}
|
|
@@ -369,7 +369,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
369
369
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
if (runtimeClassSetLoaderExists && !
|
|
372
|
+
if (runtimeClassSetLoaderExists && !_chunkWF636Q5Ejs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
373
373
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
374
374
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
375
375
|
if (anchorIndex === -1) {
|
|
@@ -384,11 +384,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
387
|
-
var debug =
|
|
388
|
-
var weappTailwindcssPackageDir =
|
|
387
|
+
var debug = _chunkDEIJXHGJjs.createDebug.call(void 0, );
|
|
388
|
+
var weappTailwindcssPackageDir = _chunk6Z4GEN2Yjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
389
389
|
var UnifiedWebpackPluginV5 = class {
|
|
390
390
|
constructor(options = {}) {
|
|
391
|
-
this.options =
|
|
391
|
+
this.options = _chunkDEIJXHGJjs.getCompilerContext.call(void 0, options);
|
|
392
392
|
this.appType = this.options.appType;
|
|
393
393
|
}
|
|
394
394
|
apply(compiler) {
|
|
@@ -401,22 +401,22 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
401
401
|
twPatcher: initialTwPatcher,
|
|
402
402
|
refreshTailwindcssPatcher
|
|
403
403
|
} = this.options;
|
|
404
|
-
const disabledOptions =
|
|
404
|
+
const disabledOptions = _chunk6Z4GEN2Yjs.resolveDisabledOptions.call(void 0, disabled);
|
|
405
405
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
406
406
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
407
|
-
const isMpxApp =
|
|
407
|
+
const isMpxApp = _chunkWF636Q5Ejs.isMpx.call(void 0, this.appType);
|
|
408
408
|
if (shouldRewriteCssImports) {
|
|
409
|
-
|
|
409
|
+
_chunkWF636Q5Ejs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
410
410
|
pkgDir: weappTailwindcssPackageDir,
|
|
411
411
|
enabled: true,
|
|
412
412
|
appType: this.appType
|
|
413
413
|
});
|
|
414
|
-
|
|
414
|
+
_chunkWF636Q5Ejs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
415
415
|
}
|
|
416
416
|
if (disabledOptions.plugin) {
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
|
-
const patchRecorderState =
|
|
419
|
+
const patchRecorderState = _chunkGCRL3ZYPjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
420
420
|
source: "runtime",
|
|
421
421
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
422
422
|
});
|
|
@@ -432,18 +432,18 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
432
432
|
runtimeSetPrepared = false;
|
|
433
433
|
};
|
|
434
434
|
if (_optionalChain([compiler, 'access', _13 => _13.hooks, 'access', _14 => _14.thisCompilation, 'optionalAccess', _15 => _15.tap])) {
|
|
435
|
-
compiler.hooks.thisCompilation.tap(
|
|
435
|
+
compiler.hooks.thisCompilation.tap(_chunkDEIJXHGJjs.pluginName, resetRuntimePreparation);
|
|
436
436
|
} else if (_optionalChain([compiler, 'access', _16 => _16.hooks, 'access', _17 => _17.compilation, 'optionalAccess', _18 => _18.tap])) {
|
|
437
|
-
compiler.hooks.compilation.tap(
|
|
437
|
+
compiler.hooks.compilation.tap(_chunkDEIJXHGJjs.pluginName, resetRuntimePreparation);
|
|
438
438
|
}
|
|
439
439
|
async function getClassSetInLoader() {
|
|
440
440
|
if (runtimeSetPrepared) {
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
-
const signature =
|
|
443
|
+
const signature = _chunkDEIJXHGJjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
444
444
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
445
445
|
runtimeSetPrepared = true;
|
|
446
|
-
await
|
|
446
|
+
await _chunkDEIJXHGJjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
447
447
|
forceRefresh,
|
|
448
448
|
forceCollect: true,
|
|
449
449
|
clearCache: forceRefresh,
|
|
@@ -1,9 +1,9 @@
|
|
|
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 _chunk6Z4GEN2Yjs = require('./chunk-6Z4GEN2Y.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkDEIJXHGJjs = require('./chunk-DEIJXHGJ.js');
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -144,7 +144,7 @@ function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
|
|
|
144
144
|
if (!CSS_EXT_RE.test(normalizedIssuer)) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
const resolved =
|
|
147
|
+
const resolved = _chunk6Z4GEN2Yjs.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
|
|
148
148
|
if (!resolved) {
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
@@ -154,8 +154,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
|
154
154
|
if (!options.enabled) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
compiler.hooks.normalModuleFactory.tap(
|
|
158
|
-
factory.hooks.beforeResolve.tap(
|
|
157
|
+
compiler.hooks.normalModuleFactory.tap(_chunkDEIJXHGJjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkDEIJXHGJjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isMpx,
|
|
11
11
|
patchMpxLoaderResolve,
|
|
12
12
|
setupMpxTailwindcssRedirect
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UYTCZXNE.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -23,20 +23,20 @@ import {
|
|
|
23
23
|
} from "./chunk-RRHPTTCP.mjs";
|
|
24
24
|
import {
|
|
25
25
|
setupPatchRecorder
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LICQ6EGN.mjs";
|
|
27
27
|
import {
|
|
28
28
|
createDebug,
|
|
29
29
|
ensureRuntimeClassSet,
|
|
30
30
|
getCompilerContext,
|
|
31
31
|
getRuntimeClassSetSignature,
|
|
32
32
|
pluginName
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-E7775SFS.mjs";
|
|
34
34
|
import {
|
|
35
35
|
getGroupedEntries
|
|
36
36
|
} from "./chunk-OOHJLO5M.mjs";
|
|
37
37
|
import {
|
|
38
38
|
__dirname
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-TNYEOBAC.mjs";
|
|
40
40
|
|
|
41
41
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
42
42
|
import process3 from "process";
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk6Z4GEN2Yjs = require('./chunk-6Z4GEN2Y.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkGCRL3ZYPjs = require('./chunk-GCRL3ZYP.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ var _chunkM2ATX5ZSjs = require('./chunk-M2ATX5ZS.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkDEIJXHGJjs = require('./chunk-DEIJXHGJ.js');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -55,7 +55,7 @@ function updateStaticAttribute(ms, prop) {
|
|
|
55
55
|
const start = prop.value.loc.start.offset + 1;
|
|
56
56
|
const end = prop.value.loc.end.offset - 1;
|
|
57
57
|
if (start < end) {
|
|
58
|
-
ms.update(start, end,
|
|
58
|
+
ms.update(start, end, _chunkDEIJXHGJjs.replaceWxml.call(void 0, prop.value.content));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
@@ -67,7 +67,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
|
|
|
67
67
|
if (start >= end) {
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
const generated =
|
|
70
|
+
const generated = _chunkDEIJXHGJjs.generateCode.call(void 0, prop.exp.content, {
|
|
71
71
|
jsHandler,
|
|
72
72
|
runtimeSet,
|
|
73
73
|
wrapExpression: true
|
|
@@ -96,7 +96,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
99
|
-
const matchCustomAttribute =
|
|
99
|
+
const matchCustomAttribute = _chunkDEIJXHGJjs.createAttributeMatcher.call(void 0, customAttributesEntities);
|
|
100
100
|
const ms = new (0, _magicstring2.default)(code);
|
|
101
101
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
102
102
|
if (errors.length === 0) {
|
|
@@ -361,7 +361,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
361
361
|
runtimeSet,
|
|
362
362
|
applyLinkedResults: applyLinkedResults2
|
|
363
363
|
} = options;
|
|
364
|
-
const absoluteFile =
|
|
364
|
+
const absoluteFile = _chunk6Z4GEN2Yjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
365
365
|
const rawSource = originalSource.source.toString();
|
|
366
366
|
const rawHashSource = options.hashSalt ? `${rawSource}
|
|
367
367
|
/*${options.hashSalt}*/` : rawSource;
|
|
@@ -433,7 +433,7 @@ function isJavaScriptEntry(entry) {
|
|
|
433
433
|
function createBundleModuleGraphOptions(outputDir, entries) {
|
|
434
434
|
return {
|
|
435
435
|
resolve(specifier, importer) {
|
|
436
|
-
return
|
|
436
|
+
return _chunk6Z4GEN2Yjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
|
|
437
437
|
},
|
|
438
438
|
load(id) {
|
|
439
439
|
const entry = entries.get(id);
|
|
@@ -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,
|
|
@@ -528,7 +538,7 @@ function readEntrySource(output) {
|
|
|
528
538
|
return output.source.toString();
|
|
529
539
|
}
|
|
530
540
|
function toJsAbsoluteFilename(file, outDir) {
|
|
531
|
-
return
|
|
541
|
+
return _chunk6Z4GEN2Yjs.toAbsoluteOutputPath.call(void 0, file, outDir);
|
|
532
542
|
}
|
|
533
543
|
function computeDirtyEntries(entries, opts, state) {
|
|
534
544
|
const nextSourceHashByFile = /* @__PURE__ */ new Map();
|
|
@@ -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 = _optionalChain([resolvedConfig, 'optionalAccess', _25 => _25.root]) ? _path2.default.resolve(resolvedConfig.root) : _process2.default.cwd();
|
|
718
750
|
const outDir = _optionalChain([resolvedConfig, 'optionalAccess', _26 => _26.build, 'optionalAccess', _27 => _27.outDir]) ? _path2.default.resolve(rootDir, resolvedConfig.build.outDir) : rootDir;
|
|
@@ -736,7 +768,7 @@ function createGenerateBundleHook(context) {
|
|
|
736
768
|
);
|
|
737
769
|
}
|
|
738
770
|
debug2("get runtimeSet, class count: %d", runtime.size);
|
|
739
|
-
const runtimeSignature = _nullishCoalesce(
|
|
771
|
+
const runtimeSignature = _nullishCoalesce(_chunkDEIJXHGJjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher), () => ( "runtime:missing"));
|
|
740
772
|
const handleLinkedUpdate = (fileName, previous, next) => {
|
|
741
773
|
onUpdate(fileName, previous, next);
|
|
742
774
|
debug2("js linked handle: %s", fileName);
|
|
@@ -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, {
|
|
@@ -972,7 +1015,7 @@ function createGenerateBundleHook(context) {
|
|
|
972
1015
|
});
|
|
973
1016
|
}
|
|
974
1017
|
}
|
|
975
|
-
|
|
1018
|
+
_chunk6Z4GEN2Yjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
976
1019
|
await Promise.all(tasks);
|
|
977
1020
|
for (const apply of pendingLinkedUpdates) {
|
|
978
1021
|
apply();
|
|
@@ -1037,12 +1080,12 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1037
1080
|
const { appType, weappTailwindcssDirPosix: weappTailwindcssDirPosix2 } = options;
|
|
1038
1081
|
return [
|
|
1039
1082
|
{
|
|
1040
|
-
name: `${
|
|
1083
|
+
name: `${_chunkDEIJXHGJjs.vitePluginName}:rewrite-css-imports`,
|
|
1041
1084
|
enforce: "pre",
|
|
1042
1085
|
resolveId: {
|
|
1043
1086
|
order: "pre",
|
|
1044
1087
|
handler(id, importer) {
|
|
1045
|
-
const replacement =
|
|
1088
|
+
const replacement = _chunk6Z4GEN2Yjs.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix2, {
|
|
1046
1089
|
join: joinPosixPath,
|
|
1047
1090
|
appType
|
|
1048
1091
|
});
|
|
@@ -1061,7 +1104,7 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1061
1104
|
if (!isCSSRequest(id)) {
|
|
1062
1105
|
return null;
|
|
1063
1106
|
}
|
|
1064
|
-
const rewritten =
|
|
1107
|
+
const rewritten = _chunk6Z4GEN2Yjs.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix2, {
|
|
1065
1108
|
join: joinPosixPath,
|
|
1066
1109
|
appType
|
|
1067
1110
|
});
|
|
@@ -1079,13 +1122,13 @@ function createRewriteCssImportsPlugins(options) {
|
|
|
1079
1122
|
}
|
|
1080
1123
|
|
|
1081
1124
|
// src/bundlers/vite/index.ts
|
|
1082
|
-
var debug =
|
|
1083
|
-
var weappTailwindcssPackageDir =
|
|
1125
|
+
var debug = _chunkDEIJXHGJjs.createDebug.call(void 0, );
|
|
1126
|
+
var weappTailwindcssPackageDir = _chunk6Z4GEN2Yjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
1084
1127
|
var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
|
|
1085
1128
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
1086
1129
|
const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
|
|
1087
1130
|
const hasExplicitTailwindcssBasedir = typeof options.tailwindcssBasedir === "string" && options.tailwindcssBasedir.trim().length > 0;
|
|
1088
|
-
const opts =
|
|
1131
|
+
const opts = _chunkDEIJXHGJjs.getCompilerContext.call(void 0, options);
|
|
1089
1132
|
const {
|
|
1090
1133
|
disabled,
|
|
1091
1134
|
customAttributes,
|
|
@@ -1099,7 +1142,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1099
1142
|
uniAppX,
|
|
1100
1143
|
disabledDefaultTemplateHandler
|
|
1101
1144
|
} = opts;
|
|
1102
|
-
const disabledOptions =
|
|
1145
|
+
const disabledOptions = _chunk6Z4GEN2Yjs.resolveDisabledOptions.call(void 0, disabled);
|
|
1103
1146
|
const tailwindcssMajorVersion = _nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0));
|
|
1104
1147
|
const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
|
|
1105
1148
|
const rewritePlugins = createRewriteCssImportsPlugins({
|
|
@@ -1110,8 +1153,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1110
1153
|
if (disabledOptions.plugin) {
|
|
1111
1154
|
return rewritePlugins.length ? rewritePlugins : void 0;
|
|
1112
1155
|
}
|
|
1113
|
-
const customAttributesEntities =
|
|
1114
|
-
const patchRecorderState =
|
|
1156
|
+
const customAttributesEntities = _chunkDEIJXHGJjs.toCustomAttributesEntities.call(void 0, customAttributes);
|
|
1157
|
+
const patchRecorderState = _chunkGCRL3ZYPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
|
|
1115
1158
|
source: "runtime",
|
|
1116
1159
|
cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
1117
1160
|
});
|
|
@@ -1128,7 +1171,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1128
1171
|
let runtimeRefreshOptionsKey;
|
|
1129
1172
|
function resolveRuntimeRefreshOptions() {
|
|
1130
1173
|
const configPath = _optionalChain([runtimeState, 'access', _29 => _29.twPatcher, 'access', _30 => _30.options, 'optionalAccess', _31 => _31.tailwind, 'optionalAccess', _32 => _32.config]);
|
|
1131
|
-
const signature =
|
|
1174
|
+
const signature = _chunkDEIJXHGJjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
1132
1175
|
const optionsKey = JSON.stringify({
|
|
1133
1176
|
appType,
|
|
1134
1177
|
uniAppX: Boolean(uniAppX),
|
|
@@ -1149,7 +1192,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1149
1192
|
async function refreshRuntimeState(force) {
|
|
1150
1193
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
1151
1194
|
const shouldRefresh = force || invalidation.changed;
|
|
1152
|
-
const refreshed = await
|
|
1195
|
+
const refreshed = await _chunkDEIJXHGJjs.refreshTailwindRuntimeState.call(void 0, runtimeState, {
|
|
1153
1196
|
force: shouldRefresh,
|
|
1154
1197
|
clearCache: force || invalidation.changed
|
|
1155
1198
|
});
|
|
@@ -1170,7 +1213,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1170
1213
|
}
|
|
1171
1214
|
if (forceRuntimeRefresh || !runtimeSetPromise) {
|
|
1172
1215
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
1173
|
-
const task2 =
|
|
1216
|
+
const task2 = _chunkDEIJXHGJjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
|
|
1174
1217
|
force: forceRuntimeRefresh || invalidation.changed,
|
|
1175
1218
|
skipRefresh: forceRuntimeRefresh,
|
|
1176
1219
|
clearCache: forceRuntimeRefresh || invalidation.changed
|
|
@@ -1206,7 +1249,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
1206
1249
|
const plugins = [
|
|
1207
1250
|
...rewritePlugins,
|
|
1208
1251
|
{
|
|
1209
|
-
name: `${
|
|
1252
|
+
name: `${_chunkDEIJXHGJjs.vitePluginName}:post`,
|
|
1210
1253
|
enforce: "post",
|
|
1211
1254
|
async configResolved(config) {
|
|
1212
1255
|
resolvedConfig = config;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.13__@swc+core@1.15.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../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/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|