weapp-tailwindcss 4.10.0-beta.4 → 4.10.0-beta.5
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-RGXLY3HG.mjs → chunk-3XVUGMTY.mjs} +5 -1
- package/dist/{chunk-3A7VW4BZ.mjs → chunk-5RSRTTH3.mjs} +3 -3
- package/dist/{chunk-KAK3XMAW.mjs → chunk-BG6EFR2X.mjs} +1 -1
- package/dist/{chunk-OCV5QLZM.js → chunk-D3ZZ4SOD.js} +27 -27
- package/dist/{chunk-BFZDZRA5.js → chunk-DFA5DHMZ.js} +210 -141
- package/dist/{chunk-Y6OZDS7V.js → chunk-FVUZDDYH.js} +3 -3
- package/dist/{chunk-XCKQ4YQM.mjs → chunk-JZG57HLO.mjs} +2 -2
- package/dist/{chunk-OYR4XWM4.mjs → chunk-KTKHUVCE.mjs} +176 -107
- package/dist/{chunk-GQVBN7UT.js → chunk-NESY7YOD.js} +3 -3
- package/dist/{chunk-UELU5NFH.mjs → chunk-NPZ5M2RY.mjs} +2 -2
- package/dist/{chunk-WQPYYMRL.js → chunk-QXGGATQS.js} +7 -7
- package/dist/{chunk-JP45MK3F.mjs → chunk-SGPYGQ6Z.mjs} +1 -1
- package/dist/{chunk-NS3NEDWD.js → chunk-SR4GC2F4.js} +5 -1
- package/dist/{chunk-PLI5CO4U.js → chunk-VKW6VKJV.js} +15 -15
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.js +10 -8
- package/dist/core.mjs +5 -3
- package/dist/css-macro/postcss.js +7 -7
- package/dist/css-macro/postcss.mjs +5 -5
- package/dist/css-macro.js +4 -4
- package/dist/css-macro.mjs +1 -1
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +26 -26
- package/dist/webpack4.mjs +3 -3
- package/package.json +2 -2
|
@@ -8,7 +8,11 @@ function createNegativeMediaQuery(value) {
|
|
|
8
8
|
}
|
|
9
9
|
function normalComment(text) {
|
|
10
10
|
if (typeof text === "string") {
|
|
11
|
-
|
|
11
|
+
const normalized = text.replaceAll(/(?<!\\)_/g, " ").replaceAll(/\s+/g, " ").trim();
|
|
12
|
+
if (normalized.includes("\\")) {
|
|
13
|
+
return normalized;
|
|
14
|
+
}
|
|
15
|
+
return normalized.replaceAll(/\s*(\|\||&&)\s*/g, " $1 ").replaceAll(/\s+/g, " ").trim();
|
|
12
16
|
}
|
|
13
17
|
return text;
|
|
14
18
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isMpx,
|
|
11
11
|
patchMpxLoaderResolve,
|
|
12
12
|
setupMpxTailwindcssRedirect
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SGPYGQ6Z.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
} from "./chunk-RRHPTTCP.mjs";
|
|
24
24
|
import {
|
|
25
25
|
setupPatchRecorder
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BG6EFR2X.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-KTKHUVCE.mjs";
|
|
34
34
|
import {
|
|
35
35
|
getGroupedEntries
|
|
36
36
|
} from "./chunk-OOHJLO5M.mjs";
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkNESY7YODjs = require('./chunk-NESY7YOD.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -23,14 +23,14 @@ var _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
|
23
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkFVUZDDYHjs = require('./chunk-FVUZDDYH.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkDFA5DHMZjs = require('./chunk-DFA5DHMZ.js');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
@@ -51,10 +51,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
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(_chunkDFA5DHMZjs.pluginName, (compilation) => {
|
|
55
55
|
compilation.hooks.processAssets.tapPromise(
|
|
56
56
|
{
|
|
57
|
-
name:
|
|
57
|
+
name: _chunkDFA5DHMZjs.pluginName,
|
|
58
58
|
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
59
59
|
},
|
|
60
60
|
async (assets) => {
|
|
@@ -66,7 +66,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
66
66
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const assetHashByChunk =
|
|
69
|
+
const assetHashByChunk = _chunkNESY7YODjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
70
70
|
const entries = Object.entries(assets);
|
|
71
71
|
const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
|
|
72
72
|
const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
|
|
@@ -122,7 +122,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
125
|
-
const runtimeSet = await
|
|
125
|
+
const runtimeSet = await _chunkDFA5DHMZjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
126
126
|
forceCollect: false,
|
|
127
127
|
allowEmpty: false
|
|
128
128
|
});
|
|
@@ -165,7 +165,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
165
165
|
const jsTaskFactories = [];
|
|
166
166
|
if (Array.isArray(groupedEntries.js)) {
|
|
167
167
|
for (const [file] of groupedEntries.js) {
|
|
168
|
-
const cacheKey =
|
|
168
|
+
const cacheKey = _chunkNESY7YODjs.getCacheKey.call(void 0, file);
|
|
169
169
|
const asset = compilation.getAsset(file);
|
|
170
170
|
if (!asset) {
|
|
171
171
|
continue;
|
|
@@ -276,9 +276,9 @@ function setupWebpackV5Loaders(options) {
|
|
|
276
276
|
getClassSetInLoader,
|
|
277
277
|
debug: debug2
|
|
278
278
|
} = options;
|
|
279
|
-
const isMpxApp =
|
|
279
|
+
const isMpxApp = _chunkNESY7YODjs.isMpx.call(void 0, appType);
|
|
280
280
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
281
|
-
|
|
281
|
+
_chunkNESY7YODjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
282
282
|
}
|
|
283
283
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
284
284
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -291,12 +291,12 @@ function setupWebpackV5Loaders(options) {
|
|
|
291
291
|
const classSetLoaderOptions = {
|
|
292
292
|
getClassSet: getClassSetInLoader
|
|
293
293
|
};
|
|
294
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
294
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkNESY7YODjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
295
295
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
296
296
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
297
297
|
} : void 0;
|
|
298
298
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
299
|
-
|
|
299
|
+
_chunkNESY7YODjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
300
300
|
}
|
|
301
301
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
302
302
|
loader: runtimeClassSetLoader,
|
|
@@ -316,17 +316,17 @@ function setupWebpackV5Loaders(options) {
|
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
318
|
const { NormalModule } = compiler.webpack;
|
|
319
|
-
compiler.hooks.compilation.tap(
|
|
320
|
-
NormalModule.getCompilationHooks(compilation).loader.tap(
|
|
319
|
+
compiler.hooks.compilation.tap(_chunkDFA5DHMZjs.pluginName, (compilation) => {
|
|
320
|
+
NormalModule.getCompilationHooks(compilation).loader.tap(_chunkDFA5DHMZjs.pluginName, (_loaderContext, module) => {
|
|
321
321
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
322
322
|
if (!hasRuntimeLoader) {
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
_chunkNESY7YODjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
|
|
326
326
|
const loaderEntries = module.loaders || [];
|
|
327
327
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
328
328
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
329
|
-
const isCssModule =
|
|
329
|
+
const isCssModule = _chunkNESY7YODjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
330
330
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
331
331
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
332
332
|
}
|
|
@@ -358,7 +358,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
358
358
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
if (runtimeClassSetLoaderExists && !
|
|
361
|
+
if (runtimeClassSetLoaderExists && !_chunkNESY7YODjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
362
362
|
const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
|
|
363
363
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
364
364
|
if (anchorIndex === -1) {
|
|
@@ -373,11 +373,11 @@ function setupWebpackV5Loaders(options) {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
376
|
-
var debug =
|
|
376
|
+
var debug = _chunkDFA5DHMZjs.createDebug.call(void 0, );
|
|
377
377
|
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
378
378
|
var UnifiedWebpackPluginV5 = class {
|
|
379
379
|
constructor(options = {}) {
|
|
380
|
-
this.options =
|
|
380
|
+
this.options = _chunkDFA5DHMZjs.getCompilerContext.call(void 0, options);
|
|
381
381
|
this.appType = this.options.appType;
|
|
382
382
|
}
|
|
383
383
|
apply(compiler) {
|
|
@@ -393,19 +393,19 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
393
393
|
const disabledOptions = _chunkIIDSY4XZjs.resolveDisabledOptions.call(void 0, disabled);
|
|
394
394
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
395
395
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
396
|
-
const isMpxApp =
|
|
396
|
+
const isMpxApp = _chunkNESY7YODjs.isMpx.call(void 0, this.appType);
|
|
397
397
|
if (shouldRewriteCssImports) {
|
|
398
|
-
|
|
398
|
+
_chunkNESY7YODjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
399
399
|
pkgDir: weappTailwindcssPackageDir,
|
|
400
400
|
enabled: true,
|
|
401
401
|
appType: this.appType
|
|
402
402
|
});
|
|
403
|
-
|
|
403
|
+
_chunkNESY7YODjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
404
404
|
}
|
|
405
405
|
if (disabledOptions.plugin) {
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const patchRecorderState =
|
|
408
|
+
const patchRecorderState = _chunkFVUZDDYHjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
409
409
|
source: "runtime",
|
|
410
410
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
411
411
|
});
|
|
@@ -421,18 +421,18 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
421
421
|
runtimeSetPrepared = false;
|
|
422
422
|
};
|
|
423
423
|
if (_optionalChain([compiler, 'access', _13 => _13.hooks, 'access', _14 => _14.thisCompilation, 'optionalAccess', _15 => _15.tap])) {
|
|
424
|
-
compiler.hooks.thisCompilation.tap(
|
|
424
|
+
compiler.hooks.thisCompilation.tap(_chunkDFA5DHMZjs.pluginName, resetRuntimePreparation);
|
|
425
425
|
} else if (_optionalChain([compiler, 'access', _16 => _16.hooks, 'access', _17 => _17.compilation, 'optionalAccess', _18 => _18.tap])) {
|
|
426
|
-
compiler.hooks.compilation.tap(
|
|
426
|
+
compiler.hooks.compilation.tap(_chunkDFA5DHMZjs.pluginName, resetRuntimePreparation);
|
|
427
427
|
}
|
|
428
428
|
async function getClassSetInLoader() {
|
|
429
429
|
if (runtimeSetPrepared) {
|
|
430
430
|
return;
|
|
431
431
|
}
|
|
432
|
-
const signature =
|
|
432
|
+
const signature = _chunkDFA5DHMZjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
433
433
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
434
434
|
runtimeSetPrepared = true;
|
|
435
|
-
await
|
|
435
|
+
await _chunkDFA5DHMZjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
436
436
|
forceRefresh,
|
|
437
437
|
forceCollect: true,
|
|
438
438
|
clearCache: forceRefresh,
|