weapp-tailwindcss 4.10.0 → 4.10.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-VZX2RV6M.js → chunk-3R7FDZJL.js} +31 -38
- package/dist/{chunk-JA6PNN27.js → chunk-6VKE7EWV.js} +28 -27
- package/dist/{chunk-6QU7CMAG.mjs → chunk-ACNOEKQI.mjs} +1 -1
- package/dist/{chunk-F6VHIO5B.mjs → chunk-BZCCVPSU.mjs} +1 -1
- package/dist/{chunk-PDP4OIKN.js → chunk-HJVZ4TO3.js} +3 -3
- package/dist/{chunk-VTIOEDOK.js → chunk-I35XJD75.js} +223 -97
- package/dist/{chunk-TNAPEHNW.mjs → chunk-LHBUALTK.mjs} +4 -3
- package/dist/{chunk-HFXMZGPW.js → chunk-M2ATX5ZS.js} +3 -3
- package/dist/{chunk-Q5IGGG5W.mjs → chunk-MPVAZKRB.mjs} +189 -63
- package/dist/{chunk-ZP6TLVZX.mjs → chunk-N6JOG5K3.mjs} +3 -2
- package/dist/{chunk-DA2K4ZIE.js → chunk-NPZ5QQC7.js} +8 -7
- package/dist/{chunk-D67CTJV5.mjs → chunk-WJU62RPV.mjs} +13 -20
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +22 -17
- package/dist/core.mjs +17 -12
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/gulp.d.mts +1 -1
- package/dist/gulp.d.ts +1 -1
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/{index-B6U7MoOM.d.ts → index-t_VBjwYm.d.mts} +13 -6
- package/dist/{index-B6U7MoOM.d.mts → index-t_VBjwYm.d.ts} +13 -6
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/presets.d.mts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/types.d.mts +17 -4
- package/dist/types.d.ts +17 -4
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +3 -3
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +5 -5
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +27 -26
- package/dist/webpack4.mjs +4 -3
- package/package.json +4 -4
package/dist/webpack4.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkHJVZ4TO3js = require('./chunk-HJVZ4TO3.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 _chunkM2ATX5ZSjs = require('./chunk-M2ATX5ZS.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkI35XJD75js = require('./chunk-I35XJD75.js');
|
|
34
34
|
require('./chunk-5APD2MNV.js');
|
|
35
35
|
require('./chunk-5U24PLVV.js');
|
|
36
36
|
|
|
@@ -59,7 +59,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
59
59
|
runtimeState,
|
|
60
60
|
debug: debug2
|
|
61
61
|
} = options;
|
|
62
|
-
compiler.hooks.emit.tapPromise(
|
|
62
|
+
compiler.hooks.emit.tapPromise(_chunkI35XJD75js.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 = _chunkHJVZ4TO3js.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();
|
|
@@ -125,7 +125,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
125
125
|
};
|
|
126
126
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
127
127
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
128
|
-
const runtimeSet = await
|
|
128
|
+
const runtimeSet = await _chunkI35XJD75js.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
129
129
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
130
130
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
131
131
|
forceCollect: true,
|
|
@@ -170,7 +170,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
170
170
|
const jsTaskFactories = [];
|
|
171
171
|
if (Array.isArray(groupedEntries.js)) {
|
|
172
172
|
for (const [file] of groupedEntries.js) {
|
|
173
|
-
const cacheKey =
|
|
173
|
+
const cacheKey = _chunkHJVZ4TO3js.getCacheKey.call(void 0, file);
|
|
174
174
|
const assetSource = compilation.assets[file];
|
|
175
175
|
if (!assetSource) {
|
|
176
176
|
continue;
|
|
@@ -198,6 +198,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
198
198
|
const currentSource = typeof currentValue === "string" ? currentValue : _nullishCoalesce(_optionalChain([currentValue, 'optionalAccess', _6 => _6.toString, 'call', _7 => _7()]), () => ( ""));
|
|
199
199
|
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, {
|
|
200
200
|
staleClassNameFallback,
|
|
201
|
+
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
201
202
|
filename: absoluteFile,
|
|
202
203
|
moduleGraph: moduleGraphOptions,
|
|
203
204
|
babelParserOptions: {
|
|
@@ -280,9 +281,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
280
281
|
getClassSetInLoader,
|
|
281
282
|
debug: debug2
|
|
282
283
|
} = options;
|
|
283
|
-
const isMpxApp =
|
|
284
|
+
const isMpxApp = _chunkHJVZ4TO3js.isMpx.call(void 0, appType);
|
|
284
285
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
285
|
-
|
|
286
|
+
_chunkHJVZ4TO3js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
286
287
|
}
|
|
287
288
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
288
289
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -295,12 +296,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
296
|
const classSetLoaderOptions = {
|
|
296
297
|
getClassSet: getClassSetInLoader
|
|
297
298
|
};
|
|
298
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
299
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkHJVZ4TO3js.createLoaderAnchorFinders.call(void 0, appType);
|
|
299
300
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
300
301
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
301
302
|
} : void 0;
|
|
302
303
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
303
|
-
|
|
304
|
+
_chunkHJVZ4TO3js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
304
305
|
}
|
|
305
306
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
306
307
|
loader: runtimeClassSetLoader,
|
|
@@ -319,19 +320,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
319
320
|
type: null
|
|
320
321
|
};
|
|
321
322
|
};
|
|
322
|
-
compiler.hooks.compilation.tap(
|
|
323
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
323
|
+
compiler.hooks.compilation.tap(_chunkI35XJD75js.pluginName, (compilation) => {
|
|
324
|
+
compilation.hooks.normalModuleLoader.tap(_chunkI35XJD75js.pluginName, (_loaderContext, module) => {
|
|
324
325
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
325
326
|
if (!hasRuntimeLoader) {
|
|
326
327
|
return;
|
|
327
328
|
}
|
|
328
|
-
if (shouldRewriteCssImports &&
|
|
329
|
-
|
|
329
|
+
if (shouldRewriteCssImports && _chunkHJVZ4TO3js.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
330
|
+
_chunkHJVZ4TO3js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
330
331
|
}
|
|
331
332
|
const loaderEntries = module.loaders || [];
|
|
332
333
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
333
334
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
334
|
-
const isCssModule =
|
|
335
|
+
const isCssModule = _chunkHJVZ4TO3js.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
335
336
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
336
337
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
337
338
|
}
|
|
@@ -365,7 +366,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
365
366
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
|
-
if (runtimeClassSetLoaderExists && !
|
|
369
|
+
if (runtimeClassSetLoaderExists && !_chunkHJVZ4TO3js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
369
370
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
370
371
|
if (anchorIndex === -1) {
|
|
371
372
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -379,11 +380,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
379
380
|
}
|
|
380
381
|
|
|
381
382
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
382
|
-
var debug =
|
|
383
|
+
var debug = _chunkI35XJD75js.createDebug.call(void 0, );
|
|
383
384
|
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
384
385
|
var UnifiedWebpackPluginV4 = class {
|
|
385
386
|
constructor(options = {}) {
|
|
386
|
-
this.options =
|
|
387
|
+
this.options = _chunkI35XJD75js.getCompilerContext.call(void 0, options);
|
|
387
388
|
this.appType = this.options.appType;
|
|
388
389
|
}
|
|
389
390
|
apply(compiler) {
|
|
@@ -399,19 +400,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
399
400
|
const disabledOptions = _chunkIIDSY4XZjs.resolveDisabledOptions.call(void 0, disabled);
|
|
400
401
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
401
402
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
402
|
-
const isMpxApp =
|
|
403
|
+
const isMpxApp = _chunkHJVZ4TO3js.isMpx.call(void 0, this.appType);
|
|
403
404
|
if (shouldRewriteCssImports) {
|
|
404
|
-
|
|
405
|
+
_chunkHJVZ4TO3js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
405
406
|
pkgDir: weappTailwindcssPackageDir,
|
|
406
407
|
enabled: true,
|
|
407
408
|
appType: this.appType
|
|
408
409
|
});
|
|
409
|
-
|
|
410
|
+
_chunkHJVZ4TO3js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
410
411
|
}
|
|
411
412
|
if (disabledOptions.plugin) {
|
|
412
413
|
return;
|
|
413
414
|
}
|
|
414
|
-
const patchRecorderState =
|
|
415
|
+
const patchRecorderState = _chunkM2ATX5ZSjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
415
416
|
source: "runtime",
|
|
416
417
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
417
418
|
});
|
|
@@ -423,17 +424,17 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
423
424
|
};
|
|
424
425
|
let runtimeSetPrepared = false;
|
|
425
426
|
let runtimeSetSignature;
|
|
426
|
-
compiler.hooks.compilation.tap(
|
|
427
|
+
compiler.hooks.compilation.tap(_chunkI35XJD75js.pluginName, () => {
|
|
427
428
|
runtimeSetPrepared = false;
|
|
428
429
|
});
|
|
429
430
|
async function getClassSetInLoader() {
|
|
430
431
|
if (runtimeSetPrepared) {
|
|
431
432
|
return;
|
|
432
433
|
}
|
|
433
|
-
const signature =
|
|
434
|
+
const signature = _chunkI35XJD75js.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
434
435
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
435
436
|
runtimeSetPrepared = true;
|
|
436
|
-
await
|
|
437
|
+
await _chunkI35XJD75js.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
437
438
|
forceRefresh,
|
|
438
439
|
forceCollect: true,
|
|
439
440
|
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-ACNOEKQI.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-BZCCVPSU.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-MPVAZKRB.mjs";
|
|
34
34
|
import "./chunk-QOTLDKI4.mjs";
|
|
35
35
|
import "./chunk-3WUHHFLF.mjs";
|
|
36
36
|
import {
|
|
@@ -200,6 +200,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
200
200
|
const currentSource = typeof currentValue === "string" ? currentValue : currentValue?.toString() ?? "";
|
|
201
201
|
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, {
|
|
202
202
|
staleClassNameFallback,
|
|
203
|
+
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
203
204
|
filename: absoluteFile,
|
|
204
205
|
moduleGraph: moduleGraphOptions,
|
|
205
206
|
babelParserOptions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.2",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -181,12 +181,12 @@
|
|
|
181
181
|
"lru-cache": "10.4.3",
|
|
182
182
|
"magic-string": "0.30.21",
|
|
183
183
|
"semver": "~7.7.4",
|
|
184
|
-
"tailwindcss-patch": "^8.7.
|
|
184
|
+
"tailwindcss-patch": "^8.7.1",
|
|
185
185
|
"webpack-sources": "3.3.4",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
|
+
"@weapp-tailwindcss/postcss": "2.1.5",
|
|
187
188
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
|
-
"@weapp-tailwindcss/shared": "1.1.2"
|
|
189
|
-
"@weapp-tailwindcss/postcss": "2.1.5"
|
|
189
|
+
"@weapp-tailwindcss/shared": "1.1.2"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|