weapp-tailwindcss 4.11.1 → 4.11.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-6YV5WADN.js → chunk-3QHYEMEW.js} +28 -28
- package/dist/{chunk-4O2J5ZM6.mjs → chunk-AB2RGZQO.mjs} +90 -44
- package/dist/{chunk-Q2HTQFI4.js → chunk-AV3XB6EQ.js} +3 -3
- package/dist/{chunk-ZUV5AZRB.mjs → chunk-JIERVBTX.mjs} +1 -1
- package/dist/{chunk-Y6JUVWRU.js → chunk-SUKOZ6OG.js} +6 -6
- package/dist/{chunk-SSASUP5F.js → chunk-TT5WHNGS.js} +58 -12
- package/dist/{chunk-SV55AOBL.mjs → chunk-VGPAKLMZ.mjs} +2 -2
- package/dist/{chunk-KX2JVTVM.mjs → chunk-W3DXDWYC.mjs} +1 -1
- package/dist/{chunk-VOCOKTZW.js → chunk-WJIRXC26.js} +25 -25
- package/dist/{chunk-WSMWD4MC.mjs → chunk-ZZ36BKM5.mjs} +1 -1
- package/dist/cli.js +114 -81
- package/dist/cli.mjs +114 -81
- package/dist/core.js +6 -6
- package/dist/core.mjs +1 -1
- package/dist/gulp.js +3 -3
- package/dist/gulp.mjs +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/vite.js +3 -3
- package/dist/vite.mjs +2 -2
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +3 -3
- package/dist/webpack4.js +24 -24
- package/dist/webpack4.mjs +2 -2
- package/package.json +1 -1
package/dist/vite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkWJIRXC26js = require('./chunk-WJIRXC26.js');
|
|
4
4
|
require('./chunk-7LKMJZD2.js');
|
|
5
5
|
require('./chunk-OF6MFURR.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-TT5WHNGS.js');
|
|
7
7
|
require('./chunk-QK6VNNNL.js');
|
|
8
8
|
require('./chunk-A5PB4KZT.js');
|
|
9
9
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -11,4 +11,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkWJIRXC26js.UnifiedViteWeappTailwindcssPlugin; exports.weappTailwindcss = _chunkWJIRXC26js.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W3DXDWYC.mjs";
|
|
4
4
|
import "./chunk-F2CKKG6Q.mjs";
|
|
5
5
|
import "./chunk-76S2EME4.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-AB2RGZQO.mjs";
|
|
7
7
|
import "./chunk-OMARW5NC.mjs";
|
|
8
8
|
import "./chunk-XAKAD2CR.mjs";
|
|
9
9
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunk3QHYEMEWjs = require('./chunk-3QHYEMEW.js');
|
|
5
|
+
require('./chunk-AV3XB6EQ.js');
|
|
6
6
|
require('./chunk-7LKMJZD2.js');
|
|
7
7
|
require('./chunk-OF6MFURR.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-TT5WHNGS.js');
|
|
9
9
|
require('./chunk-QK6VNNNL.js');
|
|
10
10
|
require('./chunk-A5PB4KZT.js');
|
|
11
11
|
require('./chunk-DYLQ6UOI.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-CRDOWYG4.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunk3QHYEMEWjs.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunk3QHYEMEWjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunk3QHYEMEWjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-VGPAKLMZ.mjs";
|
|
5
|
+
import "./chunk-JIERVBTX.mjs";
|
|
6
6
|
import "./chunk-F2CKKG6Q.mjs";
|
|
7
7
|
import "./chunk-76S2EME4.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-AB2RGZQO.mjs";
|
|
9
9
|
import "./chunk-OMARW5NC.mjs";
|
|
10
10
|
import "./chunk-XAKAD2CR.mjs";
|
|
11
11
|
import "./chunk-OOHJLO5M.mjs";
|
package/dist/webpack4.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkAV3XB6EQjs = require('./chunk-AV3XB6EQ.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkTT5WHNGSjs = require('./chunk-TT5WHNGS.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkQK6VNNNLjs = require('./chunk-QK6VNNNL.js');
|
|
@@ -59,7 +59,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
59
59
|
debug: debug2
|
|
60
60
|
} = options;
|
|
61
61
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
62
|
-
compiler.hooks.emit.tapPromise(
|
|
62
|
+
compiler.hooks.emit.tapPromise(_chunkTT5WHNGSjs.pluginName, async (compilation) => {
|
|
63
63
|
await runtimeState.patchPromise;
|
|
64
64
|
compilerOptions.onStart();
|
|
65
65
|
debug2("start");
|
|
@@ -68,7 +68,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
68
68
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const assetHashByChunk =
|
|
71
|
+
const assetHashByChunk = _chunkAV3XB6EQjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
72
72
|
const assets = compilation.assets;
|
|
73
73
|
const entries = Object.entries(assets);
|
|
74
74
|
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
@@ -145,7 +145,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
145
145
|
return created;
|
|
146
146
|
};
|
|
147
147
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
148
|
-
const runtimeSet = await
|
|
148
|
+
const runtimeSet = await _chunkTT5WHNGSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
149
149
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
150
150
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
151
151
|
forceCollect: true,
|
|
@@ -191,7 +191,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
191
191
|
const jsTaskFactories = [];
|
|
192
192
|
if (Array.isArray(groupedEntries.js)) {
|
|
193
193
|
for (const [file] of groupedEntries.js) {
|
|
194
|
-
const cacheKey =
|
|
194
|
+
const cacheKey = _chunkAV3XB6EQjs.getCacheKey.call(void 0, file);
|
|
195
195
|
const assetSource = compilation.assets[file];
|
|
196
196
|
if (!assetSource) {
|
|
197
197
|
continue;
|
|
@@ -295,9 +295,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
295
|
getClassSetInLoader,
|
|
296
296
|
debug: debug2
|
|
297
297
|
} = options;
|
|
298
|
-
const isMpxApp =
|
|
298
|
+
const isMpxApp = _chunkAV3XB6EQjs.isMpx.call(void 0, appType);
|
|
299
299
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
300
|
-
|
|
300
|
+
_chunkAV3XB6EQjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
301
301
|
}
|
|
302
302
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
303
303
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -310,12 +310,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
310
310
|
const classSetLoaderOptions = {
|
|
311
311
|
getClassSet: getClassSetInLoader
|
|
312
312
|
};
|
|
313
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
313
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkAV3XB6EQjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
314
314
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
315
315
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
316
316
|
} : void 0;
|
|
317
317
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
318
|
-
|
|
318
|
+
_chunkAV3XB6EQjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
319
319
|
}
|
|
320
320
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
321
321
|
loader: runtimeClassSetLoader,
|
|
@@ -334,19 +334,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
334
334
|
type: null
|
|
335
335
|
};
|
|
336
336
|
};
|
|
337
|
-
compiler.hooks.compilation.tap(
|
|
338
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
337
|
+
compiler.hooks.compilation.tap(_chunkTT5WHNGSjs.pluginName, (compilation) => {
|
|
338
|
+
compilation.hooks.normalModuleLoader.tap(_chunkTT5WHNGSjs.pluginName, (_loaderContext, module) => {
|
|
339
339
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
340
340
|
if (!hasRuntimeLoader) {
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
if (shouldRewriteCssImports &&
|
|
344
|
-
|
|
343
|
+
if (shouldRewriteCssImports && _chunkAV3XB6EQjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
344
|
+
_chunkAV3XB6EQjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
345
345
|
}
|
|
346
346
|
const loaderEntries = module.loaders || [];
|
|
347
347
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
348
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
349
|
-
const isCssModule =
|
|
349
|
+
const isCssModule = _chunkAV3XB6EQjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
350
350
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
351
351
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
352
352
|
}
|
|
@@ -380,7 +380,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
380
380
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
if (runtimeClassSetLoaderExists && !
|
|
383
|
+
if (runtimeClassSetLoaderExists && !_chunkAV3XB6EQjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
384
384
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
385
385
|
if (anchorIndex === -1) {
|
|
386
386
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -394,11 +394,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
397
|
-
var debug =
|
|
397
|
+
var debug = _chunkTT5WHNGSjs.createDebug.call(void 0, );
|
|
398
398
|
var weappTailwindcssPackageDir = _chunk7LKMJZD2js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
399
399
|
var UnifiedWebpackPluginV4 = class {
|
|
400
400
|
constructor(options = {}) {
|
|
401
|
-
this.options =
|
|
401
|
+
this.options = _chunkTT5WHNGSjs.getCompilerContext.call(void 0, options);
|
|
402
402
|
this.appType = this.options.appType;
|
|
403
403
|
}
|
|
404
404
|
apply(compiler) {
|
|
@@ -414,19 +414,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
414
414
|
const disabledOptions = _chunk7LKMJZD2js.resolveDisabledOptions.call(void 0, disabled);
|
|
415
415
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
416
416
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
417
|
-
const isMpxApp =
|
|
417
|
+
const isMpxApp = _chunkAV3XB6EQjs.isMpx.call(void 0, this.appType);
|
|
418
418
|
if (shouldRewriteCssImports) {
|
|
419
|
-
|
|
419
|
+
_chunkAV3XB6EQjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
420
420
|
pkgDir: weappTailwindcssPackageDir,
|
|
421
421
|
enabled: true,
|
|
422
422
|
appType: this.appType
|
|
423
423
|
});
|
|
424
|
-
|
|
424
|
+
_chunkAV3XB6EQjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
425
425
|
}
|
|
426
426
|
if (disabledOptions.plugin) {
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const patchRecorderState =
|
|
429
|
+
const patchRecorderState = _chunkTT5WHNGSjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
430
430
|
source: "runtime",
|
|
431
431
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
432
432
|
});
|
|
@@ -438,7 +438,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
438
438
|
};
|
|
439
439
|
let runtimeSetPrepared = false;
|
|
440
440
|
let runtimeSetSignature;
|
|
441
|
-
compiler.hooks.compilation.tap(
|
|
441
|
+
compiler.hooks.compilation.tap(_chunkTT5WHNGSjs.pluginName, () => {
|
|
442
442
|
runtimeSetPrepared = false;
|
|
443
443
|
});
|
|
444
444
|
async function getClassSetInLoader() {
|
|
@@ -448,7 +448,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
448
448
|
const signature = _chunkQK6VNNNLjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
449
449
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
450
450
|
runtimeSetPrepared = true;
|
|
451
|
-
await
|
|
451
|
+
await _chunkTT5WHNGSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
452
452
|
forceRefresh,
|
|
453
453
|
forceCollect: true,
|
|
454
454
|
clearCache: forceRefresh,
|
package/dist/webpack4.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isMpx,
|
|
11
11
|
patchMpxLoaderResolve,
|
|
12
12
|
setupMpxTailwindcssRedirect
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JIERVBTX.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getCompilerContext,
|
|
28
28
|
pluginName,
|
|
29
29
|
setupPatchRecorder
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-AB2RGZQO.mjs";
|
|
31
31
|
import {
|
|
32
32
|
getRuntimeClassSetSignature
|
|
33
33
|
} from "./chunk-OMARW5NC.mjs";
|
package/package.json
CHANGED