weapp-tailwindcss 4.9.9-beta.0 → 4.10.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-FT3YGOHE.mjs → chunk-2KAM7AAG.mjs} +35 -7
- package/dist/{chunk-PO3CCFU7.js → chunk-3RGU475C.js} +4 -4
- package/dist/{chunk-YPIQUBC4.mjs → chunk-7ATL22KK.mjs} +44 -17
- package/dist/{chunk-NBS6RMNM.mjs → chunk-AGF55OIE.mjs} +1 -1
- package/dist/{chunk-YYE3U4L3.mjs → chunk-D3I6GQUV.mjs} +134 -20
- package/dist/{chunk-HAM3JEU2.js → chunk-DBAAU4LK.js} +1 -1
- package/dist/{chunk-U4T2HGRZ.js → chunk-F7FBGRWS.js} +16 -13
- package/dist/{chunk-YVYWSXU7.mjs → chunk-FIJF6OL7.mjs} +13 -10
- package/dist/{chunk-A2ST4H4Y.js → chunk-FLJBD5TW.js} +5 -5
- package/dist/{chunk-CAFL5XBF.js → chunk-GFJYJ6WV.js} +65 -38
- package/dist/{chunk-47TVJCQM.mjs → chunk-HT76VHOV.mjs} +1 -1
- package/dist/{chunk-DOX3RXJ2.js → chunk-IIDSY4XZ.js} +2 -2
- package/dist/{chunk-IY5ZVBL2.mjs → chunk-Q7TIBSU2.mjs} +37 -1
- package/dist/{chunk-42HSNAKM.js → chunk-QOWSZHYT.js} +42 -6
- package/dist/{chunk-YY55J7K3.js → chunk-UCDOKKRH.js} +141 -27
- package/dist/{chunk-HQ2G6NBK.js → chunk-YS2V3XY2.js} +57 -29
- package/dist/cli.js +39 -39
- package/dist/cli.mjs +2 -2
- package/dist/core.js +29 -22
- package/dist/core.mjs +28 -21
- 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.d.mts +5 -0
- package/dist/types.d.ts +5 -0
- 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 +63 -41
- package/dist/webpack4.mjs +40 -18
- package/package.json +7 -6
|
@@ -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 _chunkUCDOKKRHjs = require('./chunk-UCDOKKRH.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk3RGU475Cjs = require('./chunk-3RGU475C.js');
|
|
8
8
|
|
|
9
9
|
// src/tailwindcss/recorder.ts
|
|
10
10
|
function setupPatchRecorder(patcher, baseDir, options) {
|
|
11
|
-
const recorder =
|
|
11
|
+
const recorder = _chunkUCDOKKRHjs.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
|
+
_chunk3RGU475Cjs.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 ? _chunkUCDOKKRHjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
|
|
20
20
|
return {
|
|
21
21
|
recorder,
|
|
22
22
|
patchPromise,
|
|
@@ -9,27 +9,28 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var _chunk42HSNAKMjs = require('./chunk-42HSNAKM.js');
|
|
13
12
|
|
|
13
|
+
var _chunkQOWSZHYTjs = require('./chunk-QOWSZHYT.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
var _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
var
|
|
26
|
+
var _chunkFLJBD5TWjs = require('./chunk-FLJBD5TW.js');
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
var
|
|
33
|
+
var _chunkUCDOKKRHjs = require('./chunk-UCDOKKRH.js');
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -46,15 +47,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
46
47
|
options: compilerOptions,
|
|
47
48
|
appType,
|
|
48
49
|
runtimeState,
|
|
49
|
-
refreshRuntimeState,
|
|
50
50
|
debug: debug2
|
|
51
51
|
} = options;
|
|
52
52
|
const { Compilation, sources } = compiler.webpack;
|
|
53
53
|
const { ConcatSource } = sources;
|
|
54
|
-
compiler.hooks.compilation.tap(
|
|
54
|
+
compiler.hooks.compilation.tap(_chunkUCDOKKRHjs.pluginName, (compilation) => {
|
|
55
55
|
compilation.hooks.processAssets.tapPromise(
|
|
56
56
|
{
|
|
57
|
-
name:
|
|
57
|
+
name: _chunkUCDOKKRHjs.pluginName,
|
|
58
58
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
59
59
|
},
|
|
60
60
|
async (assets) => {
|
|
@@ -66,19 +66,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
66
66
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
const assetHashByChunk = _chunkQOWSZHYTjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
69
70
|
const entries = Object.entries(assets);
|
|
70
71
|
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
71
72
|
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
72
73
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
73
74
|
for (const [file] of entries) {
|
|
74
75
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
75
|
-
const absolute =
|
|
76
|
+
const absolute = _chunkIIDSY4XZjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
76
77
|
jsAssets.set(absolute, file);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
const moduleGraphOptions = {
|
|
80
81
|
resolve(specifier, importer) {
|
|
81
|
-
return
|
|
82
|
+
return _chunkIIDSY4XZjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
82
83
|
},
|
|
83
84
|
load: (id) => {
|
|
84
85
|
const assetName = jsAssets.get(id);
|
|
@@ -121,9 +122,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
124
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
124
|
-
await
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
const runtimeSet = await _chunkUCDOKKRHjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
126
|
+
forceCollect: false,
|
|
127
|
+
allowEmpty: false
|
|
128
|
+
});
|
|
127
129
|
debug2("get runtimeSet, class count: %d", runtimeSet.size);
|
|
128
130
|
const tasks = [];
|
|
129
131
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -131,11 +133,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
131
133
|
const [file, originalSource] = element;
|
|
132
134
|
const rawSource = originalSource.source().toString();
|
|
133
135
|
const cacheKey = file;
|
|
136
|
+
const chunkHash = assetHashByChunk.get(file);
|
|
134
137
|
tasks.push(
|
|
135
138
|
_chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
136
139
|
cache: compilerOptions.cache,
|
|
137
140
|
cacheKey,
|
|
141
|
+
hashKey: `${file}:asset`,
|
|
138
142
|
rawSource,
|
|
143
|
+
hash: chunkHash,
|
|
139
144
|
applyResult(source) {
|
|
140
145
|
compilation.updateAsset(file, source);
|
|
141
146
|
},
|
|
@@ -160,19 +165,22 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
160
165
|
const jsTaskFactories = [];
|
|
161
166
|
if (Array.isArray(groupedEntries.js)) {
|
|
162
167
|
for (const [file] of groupedEntries.js) {
|
|
163
|
-
const cacheKey =
|
|
168
|
+
const cacheKey = _chunkQOWSZHYTjs.getCacheKey.call(void 0, file);
|
|
164
169
|
const asset = compilation.getAsset(file);
|
|
165
170
|
if (!asset) {
|
|
166
171
|
continue;
|
|
167
172
|
}
|
|
168
|
-
const absoluteFile =
|
|
173
|
+
const absoluteFile = _chunkIIDSY4XZjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
169
174
|
const initialSource = asset.source.source();
|
|
170
175
|
const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
|
|
176
|
+
const chunkHash = assetHashByChunk.get(file);
|
|
171
177
|
jsTaskFactories.push(async () => {
|
|
172
178
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
173
179
|
cache: compilerOptions.cache,
|
|
174
180
|
cacheKey,
|
|
181
|
+
hashKey: `${file}:asset`,
|
|
175
182
|
rawSource: initialRawSource,
|
|
183
|
+
hash: chunkHash,
|
|
176
184
|
applyResult(source) {
|
|
177
185
|
compilation.updateAsset(file, source);
|
|
178
186
|
},
|
|
@@ -207,11 +215,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
207
215
|
const [file, originalSource] = element;
|
|
208
216
|
const rawSource = originalSource.source().toString();
|
|
209
217
|
const cacheKey = file;
|
|
218
|
+
const chunkHash = assetHashByChunk.get(file);
|
|
210
219
|
tasks.push(
|
|
211
220
|
_chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
212
221
|
cache: compilerOptions.cache,
|
|
213
222
|
cacheKey,
|
|
223
|
+
hashKey: `${file}:asset`,
|
|
214
224
|
rawSource,
|
|
225
|
+
hash: chunkHash,
|
|
215
226
|
applyResult(source) {
|
|
216
227
|
compilation.updateAsset(file, source);
|
|
217
228
|
},
|
|
@@ -240,7 +251,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
240
251
|
);
|
|
241
252
|
}
|
|
242
253
|
}
|
|
243
|
-
|
|
254
|
+
_chunkIIDSY4XZjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
244
255
|
await Promise.all(tasks);
|
|
245
256
|
debug2("end");
|
|
246
257
|
compilerOptions.onEnd();
|
|
@@ -265,9 +276,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
265
276
|
getClassSetInLoader,
|
|
266
277
|
debug: debug2
|
|
267
278
|
} = options;
|
|
268
|
-
const isMpxApp =
|
|
279
|
+
const isMpxApp = _chunkQOWSZHYTjs.isMpx.call(void 0, appType);
|
|
269
280
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
270
|
-
|
|
281
|
+
_chunkQOWSZHYTjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
271
282
|
}
|
|
272
283
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
273
284
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -280,12 +291,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
280
291
|
const classSetLoaderOptions = {
|
|
281
292
|
getClassSet: getClassSetInLoader
|
|
282
293
|
};
|
|
283
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
294
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkQOWSZHYTjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
284
295
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
285
296
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
286
297
|
} : void 0;
|
|
287
298
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
288
|
-
|
|
299
|
+
_chunkQOWSZHYTjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
289
300
|
}
|
|
290
301
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
291
302
|
loader: runtimeClassSetLoader,
|
|
@@ -305,17 +316,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
305
316
|
};
|
|
306
317
|
};
|
|
307
318
|
const { NormalModule } = compiler.webpack;
|
|
308
|
-
compiler.hooks.compilation.tap(
|
|
309
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
319
|
+
compiler.hooks.compilation.tap(_chunkUCDOKKRHjs.pluginName, (compilation) => {
|
|
320
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkUCDOKKRHjs.pluginName, (_loaderContext, module) => {
|
|
310
321
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
311
322
|
if (!hasRuntimeLoader) {
|
|
312
323
|
return;
|
|
313
324
|
}
|
|
314
|
-
|
|
325
|
+
_chunkQOWSZHYTjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
315
326
|
const loaderEntries = module.loaders || [];
|
|
316
327
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
317
328
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
318
|
-
const isCssModule =
|
|
329
|
+
const isCssModule = _chunkQOWSZHYTjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
319
330
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
320
331
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
321
332
|
}
|
|
@@ -347,7 +358,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
347
358
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
359
|
}
|
|
349
360
|
}
|
|
350
|
-
if (runtimeClassSetLoaderExists && !
|
|
361
|
+
if (runtimeClassSetLoaderExists && !_chunkQOWSZHYTjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
351
362
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
352
363
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
353
364
|
if (anchorIndex === -1) {
|
|
@@ -362,11 +373,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
362
373
|
}
|
|
363
374
|
|
|
364
375
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
365
|
-
var debug =
|
|
366
|
-
var weappTailwindcssPackageDir =
|
|
376
|
+
var debug = _chunkUCDOKKRHjs.createDebug.call(void 0, );
|
|
377
|
+
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
367
378
|
var UnifiedWebpackPluginV5 = class {
|
|
368
379
|
constructor(options = {}) {
|
|
369
|
-
this.options =
|
|
380
|
+
this.options = _chunkUCDOKKRHjs.getCompilerContext.call(void 0, options);
|
|
370
381
|
this.appType = this.options.appType;
|
|
371
382
|
}
|
|
372
383
|
apply(compiler) {
|
|
@@ -379,22 +390,22 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
379
390
|
twPatcher: initialTwPatcher,
|
|
380
391
|
refreshTailwindcssPatcher
|
|
381
392
|
} = this.options;
|
|
382
|
-
const disabledOptions =
|
|
393
|
+
const disabledOptions = _chunkIIDSY4XZjs.resolveDisabledOptions.call(void 0, disabled);
|
|
383
394
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
384
395
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
385
|
-
const isMpxApp =
|
|
396
|
+
const isMpxApp = _chunkQOWSZHYTjs.isMpx.call(void 0, this.appType);
|
|
386
397
|
if (shouldRewriteCssImports) {
|
|
387
|
-
|
|
398
|
+
_chunkQOWSZHYTjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
388
399
|
pkgDir: weappTailwindcssPackageDir,
|
|
389
400
|
enabled: true,
|
|
390
401
|
appType: this.appType
|
|
391
402
|
});
|
|
392
|
-
|
|
403
|
+
_chunkQOWSZHYTjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
393
404
|
}
|
|
394
405
|
if (disabledOptions.plugin) {
|
|
395
406
|
return;
|
|
396
407
|
}
|
|
397
|
-
const patchRecorderState =
|
|
408
|
+
const patchRecorderState = _chunkFLJBD5TWjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
398
409
|
source: "runtime",
|
|
399
410
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
400
411
|
});
|
|
@@ -404,13 +415,30 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
404
415
|
refreshTailwindcssPatcher,
|
|
405
416
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
406
417
|
};
|
|
407
|
-
|
|
408
|
-
|
|
418
|
+
let runtimeSetPrepared = false;
|
|
419
|
+
let runtimeSetSignature;
|
|
420
|
+
const resetRuntimePreparation = () => {
|
|
421
|
+
runtimeSetPrepared = false;
|
|
409
422
|
};
|
|
423
|
+
if (_optionalChain([compiler, 'access', _13 => _13.hooks, 'access', _14 => _14.thisCompilation, 'optionalAccess', _15 => _15.tap])) {
|
|
424
|
+
compiler.hooks.thisCompilation.tap(_chunkUCDOKKRHjs.pluginName, resetRuntimePreparation);
|
|
425
|
+
} else if (_optionalChain([compiler, 'access', _16 => _16.hooks, 'access', _17 => _17.compilation, 'optionalAccess', _18 => _18.tap])) {
|
|
426
|
+
compiler.hooks.compilation.tap(_chunkUCDOKKRHjs.pluginName, resetRuntimePreparation);
|
|
427
|
+
}
|
|
410
428
|
async function getClassSetInLoader() {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
429
|
+
if (runtimeSetPrepared) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const signature = _chunkUCDOKKRHjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
433
|
+
const forceRefresh = signature !== runtimeSetSignature;
|
|
434
|
+
runtimeSetPrepared = true;
|
|
435
|
+
await _chunkUCDOKKRHjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
436
|
+
forceRefresh,
|
|
437
|
+
forceCollect: true,
|
|
438
|
+
clearCache: forceRefresh,
|
|
439
|
+
allowEmpty: true
|
|
440
|
+
});
|
|
441
|
+
runtimeSetSignature = signature;
|
|
414
442
|
}
|
|
415
443
|
onLoad();
|
|
416
444
|
setupWebpackV5Loaders({
|
|
@@ -429,7 +457,6 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
429
457
|
options: this.options,
|
|
430
458
|
appType: this.appType,
|
|
431
459
|
runtimeState,
|
|
432
|
-
refreshRuntimeState,
|
|
433
460
|
debug
|
|
434
461
|
});
|
|
435
462
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.13__@swc+core@1.15.11_@swc_f8079344adc4b1859e6989f440e01c9c/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);
|
|
@@ -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 _chunkDBAAU4LKjs = require('./chunk-DBAAU4LK.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, _chunkDBAAU4LKjs.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 @@ import {
|
|
|
3
3
|
} from "./chunk-F2CKKG6Q.mjs";
|
|
4
4
|
import {
|
|
5
5
|
pluginName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-D3I6GQUV.mjs";
|
|
7
7
|
|
|
8
8
|
// src/shared/mpx.ts
|
|
9
9
|
import path2 from "path";
|
|
@@ -199,6 +199,41 @@ function hasLoaderEntry(entries, target) {
|
|
|
199
199
|
}
|
|
200
200
|
return entries.some((entry) => entry.loader?.includes?.(target));
|
|
201
201
|
}
|
|
202
|
+
function toChunkFiles(files) {
|
|
203
|
+
if (!files) {
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
if (Array.isArray(files)) {
|
|
207
|
+
return files;
|
|
208
|
+
}
|
|
209
|
+
return Array.from(files);
|
|
210
|
+
}
|
|
211
|
+
function createAssetHashByChunkMap(chunks) {
|
|
212
|
+
const partsByFile = /* @__PURE__ */ new Map();
|
|
213
|
+
for (const chunk of chunks) {
|
|
214
|
+
const hash = typeof chunk.hash === "string" ? chunk.hash : void 0;
|
|
215
|
+
if (!hash) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const chunkId = String(chunk.id ?? chunk.name ?? "");
|
|
219
|
+
for (const file of toChunkFiles(chunk.files)) {
|
|
220
|
+
if (!file) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
let parts = partsByFile.get(file);
|
|
224
|
+
if (!parts) {
|
|
225
|
+
parts = [];
|
|
226
|
+
partsByFile.set(file, parts);
|
|
227
|
+
}
|
|
228
|
+
parts.push(`${chunkId}:${hash}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const hashByFile = /* @__PURE__ */ new Map();
|
|
232
|
+
for (const [file, parts] of partsByFile.entries()) {
|
|
233
|
+
hashByFile.set(file, parts.sort().join("|"));
|
|
234
|
+
}
|
|
235
|
+
return hashByFile;
|
|
236
|
+
}
|
|
202
237
|
|
|
203
238
|
// src/bundlers/webpack/shared/loader-anchors.ts
|
|
204
239
|
var MPX_STRIP_CONDITIONAL_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/strip-conditional-loader";
|
|
@@ -247,5 +282,6 @@ export {
|
|
|
247
282
|
getCacheKey,
|
|
248
283
|
isCssLikeModuleResource,
|
|
249
284
|
hasLoaderEntry,
|
|
285
|
+
createAssetHashByChunkMap,
|
|
250
286
|
createLoaderAnchorFinders
|
|
251
287
|
};
|
|
@@ -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 _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUCDOKKRHjs = require('./chunk-UCDOKKRH.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 = _chunkIIDSY4XZjs.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(_chunkUCDOKKRHjs.pluginName, (factory) => {
|
|
158
|
+
factory.hooks.beforeResolve.tap(_chunkUCDOKKRHjs.pluginName, (data) => {
|
|
159
159
|
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
160
160
|
});
|
|
161
161
|
});
|
|
@@ -199,6 +199,41 @@ function hasLoaderEntry(entries, target) {
|
|
|
199
199
|
}
|
|
200
200
|
return entries.some((entry) => _optionalChain([entry, 'access', _5 => _5.loader, 'optionalAccess', _6 => _6.includes, 'optionalCall', _7 => _7(target)]));
|
|
201
201
|
}
|
|
202
|
+
function toChunkFiles(files) {
|
|
203
|
+
if (!files) {
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
if (Array.isArray(files)) {
|
|
207
|
+
return files;
|
|
208
|
+
}
|
|
209
|
+
return Array.from(files);
|
|
210
|
+
}
|
|
211
|
+
function createAssetHashByChunkMap(chunks) {
|
|
212
|
+
const partsByFile = /* @__PURE__ */ new Map();
|
|
213
|
+
for (const chunk of chunks) {
|
|
214
|
+
const hash = typeof chunk.hash === "string" ? chunk.hash : void 0;
|
|
215
|
+
if (!hash) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const chunkId = String(_nullishCoalesce(_nullishCoalesce(chunk.id, () => ( chunk.name)), () => ( "")));
|
|
219
|
+
for (const file of toChunkFiles(chunk.files)) {
|
|
220
|
+
if (!file) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
let parts = partsByFile.get(file);
|
|
224
|
+
if (!parts) {
|
|
225
|
+
parts = [];
|
|
226
|
+
partsByFile.set(file, parts);
|
|
227
|
+
}
|
|
228
|
+
parts.push(`${chunkId}:${hash}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const hashByFile = /* @__PURE__ */ new Map();
|
|
232
|
+
for (const [file, parts] of partsByFile.entries()) {
|
|
233
|
+
hashByFile.set(file, parts.sort().join("|"));
|
|
234
|
+
}
|
|
235
|
+
return hashByFile;
|
|
236
|
+
}
|
|
202
237
|
|
|
203
238
|
// src/bundlers/webpack/shared/loader-anchors.ts
|
|
204
239
|
var MPX_STRIP_CONDITIONAL_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/strip-conditional-loader";
|
|
@@ -248,4 +283,5 @@ function createLoaderAnchorFinders(appType) {
|
|
|
248
283
|
|
|
249
284
|
|
|
250
285
|
|
|
251
|
-
|
|
286
|
+
|
|
287
|
+
exports.isMpx = isMpx; exports.ensureMpxTailwindcssAliases = ensureMpxTailwindcssAliases; exports.patchMpxLoaderResolve = patchMpxLoaderResolve; exports.setupMpxTailwindcssRedirect = setupMpxTailwindcssRedirect; exports.injectMpxCssRewritePreRules = injectMpxCssRewritePreRules; exports.applyTailwindcssCssImportRewrite = applyTailwindcssCssImportRewrite; exports.getCacheKey = getCacheKey; exports.isCssLikeModuleResource = isCssLikeModuleResource; exports.hasLoaderEntry = hasLoaderEntry; exports.createAssetHashByChunkMap = createAssetHashByChunkMap; exports.createLoaderAnchorFinders = createLoaderAnchorFinders;
|