weapp-tailwindcss 4.10.0-beta.2 → 4.10.0-beta.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-GFJYJ6WV.js → chunk-2BHX22WT.js} +27 -27
- package/dist/{chunk-D3I6GQUV.mjs → chunk-2VVKFR3W.mjs} +13 -3
- package/dist/{chunk-YS2V3XY2.js → chunk-4EMVQ5H2.js} +15 -15
- package/dist/{chunk-3RGU475C.js → chunk-5APD2MNV.js} +163 -77
- package/dist/{chunk-UCDOKKRH.js → chunk-AAVDJYEE.js} +24 -14
- package/dist/{chunk-F7FBGRWS.js → chunk-NDRBH7DO.js} +7 -7
- package/dist/{chunk-AGF55OIE.mjs → chunk-PBA2SZ3H.mjs} +2 -2
- package/dist/{chunk-FIJF6OL7.mjs → chunk-Q6NT6TZQ.mjs} +2 -2
- package/dist/{chunk-7D27E7TU.mjs → chunk-QOTLDKI4.mjs} +131 -45
- package/dist/{chunk-QOWSZHYT.js → chunk-RHQJLGBF.js} +3 -3
- package/dist/{chunk-2KAM7AAG.mjs → chunk-SLXV5ZYJ.mjs} +2 -2
- package/dist/{chunk-Q7TIBSU2.mjs → chunk-TIZBA67F.mjs} +1 -1
- package/dist/{chunk-7ATL22KK.mjs → chunk-TYYAOYEJ.mjs} +3 -3
- package/dist/{chunk-FLJBD5TW.js → chunk-VEJYEJ4V.js} +5 -5
- package/dist/cli.js +45 -45
- package/dist/cli.mjs +9 -9
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +3 -3
- 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 +5 -5
- package/dist/gulp.mjs +4 -4
- package/dist/{index-vGuAfNvT.d.mts → index-v0opId0x.d.mts} +1 -1
- package/dist/{index-vGuAfNvT.d.ts → index-v0opId0x.d.ts} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/presets.d.mts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +8 -8
- package/dist/presets.mjs +5 -5
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +27 -27
- package/dist/webpack4.mjs +4 -4
- package/package.json +3 -3
package/dist/webpack4.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkRHQJLGBFjs = require('./chunk-RHQJLGBF.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -23,15 +23,15 @@ var _chunkIIDSY4XZjs = require('./chunk-IIDSY4XZ.js');
|
|
|
23
23
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkVEJYEJ4Vjs = require('./chunk-VEJYEJ4V.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
34
|
-
require('./chunk-
|
|
33
|
+
var _chunkAAVDJYEEjs = require('./chunk-AAVDJYEE.js');
|
|
34
|
+
require('./chunk-5APD2MNV.js');
|
|
35
35
|
require('./chunk-LBZCKOMT.js');
|
|
36
36
|
|
|
37
37
|
|
|
@@ -53,7 +53,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
53
53
|
runtimeState,
|
|
54
54
|
debug: debug2
|
|
55
55
|
} = options;
|
|
56
|
-
compiler.hooks.emit.tapPromise(
|
|
56
|
+
compiler.hooks.emit.tapPromise(_chunkAAVDJYEEjs.pluginName, async (compilation) => {
|
|
57
57
|
await runtimeState.patchPromise;
|
|
58
58
|
compilerOptions.onStart();
|
|
59
59
|
debug2("start");
|
|
@@ -62,7 +62,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
62
62
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const assetHashByChunk =
|
|
65
|
+
const assetHashByChunk = _chunkRHQJLGBFjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
66
66
|
const assets = compilation.assets;
|
|
67
67
|
const entries = Object.entries(assets);
|
|
68
68
|
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
@@ -118,7 +118,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
const groupedEntries = _chunkDYLQ6UOIjs.getGroupedEntries.call(void 0, entries, compilerOptions);
|
|
121
|
-
const runtimeSet = await
|
|
121
|
+
const runtimeSet = await _chunkAAVDJYEEjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
122
122
|
forceCollect: false,
|
|
123
123
|
allowEmpty: false
|
|
124
124
|
});
|
|
@@ -161,7 +161,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
161
161
|
const jsTaskFactories = [];
|
|
162
162
|
if (Array.isArray(groupedEntries.js)) {
|
|
163
163
|
for (const [file] of groupedEntries.js) {
|
|
164
|
-
const cacheKey =
|
|
164
|
+
const cacheKey = _chunkRHQJLGBFjs.getCacheKey.call(void 0, file);
|
|
165
165
|
const assetSource = compilation.assets[file];
|
|
166
166
|
if (!assetSource) {
|
|
167
167
|
continue;
|
|
@@ -270,9 +270,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
270
270
|
getClassSetInLoader,
|
|
271
271
|
debug: debug2
|
|
272
272
|
} = options;
|
|
273
|
-
const isMpxApp =
|
|
273
|
+
const isMpxApp = _chunkRHQJLGBFjs.isMpx.call(void 0, appType);
|
|
274
274
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
275
|
-
|
|
275
|
+
_chunkRHQJLGBFjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
276
276
|
}
|
|
277
277
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
278
278
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -285,12 +285,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
285
285
|
const classSetLoaderOptions = {
|
|
286
286
|
getClassSet: getClassSetInLoader
|
|
287
287
|
};
|
|
288
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
288
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkRHQJLGBFjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
289
289
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
290
290
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
291
291
|
} : void 0;
|
|
292
292
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
293
|
-
|
|
293
|
+
_chunkRHQJLGBFjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
294
294
|
}
|
|
295
295
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
296
296
|
loader: runtimeClassSetLoader,
|
|
@@ -309,19 +309,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
309
309
|
type: null
|
|
310
310
|
};
|
|
311
311
|
};
|
|
312
|
-
compiler.hooks.compilation.tap(
|
|
313
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
312
|
+
compiler.hooks.compilation.tap(_chunkAAVDJYEEjs.pluginName, (compilation) => {
|
|
313
|
+
compilation.hooks.normalModuleLoader.tap(_chunkAAVDJYEEjs.pluginName, (_loaderContext, module) => {
|
|
314
314
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
315
315
|
if (!hasRuntimeLoader) {
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
if (shouldRewriteCssImports &&
|
|
319
|
-
|
|
318
|
+
if (shouldRewriteCssImports && _chunkRHQJLGBFjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
319
|
+
_chunkRHQJLGBFjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
320
320
|
}
|
|
321
321
|
const loaderEntries = module.loaders || [];
|
|
322
322
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
323
323
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
324
|
-
const isCssModule =
|
|
324
|
+
const isCssModule = _chunkRHQJLGBFjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
325
325
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
326
326
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
327
327
|
}
|
|
@@ -355,7 +355,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
355
355
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
if (runtimeClassSetLoaderExists && !
|
|
358
|
+
if (runtimeClassSetLoaderExists && !_chunkRHQJLGBFjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
359
359
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
360
360
|
if (anchorIndex === -1) {
|
|
361
361
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -369,11 +369,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
372
|
-
var debug =
|
|
372
|
+
var debug = _chunkAAVDJYEEjs.createDebug.call(void 0, );
|
|
373
373
|
var weappTailwindcssPackageDir = _chunkIIDSY4XZjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
374
374
|
var UnifiedWebpackPluginV4 = class {
|
|
375
375
|
constructor(options = {}) {
|
|
376
|
-
this.options =
|
|
376
|
+
this.options = _chunkAAVDJYEEjs.getCompilerContext.call(void 0, options);
|
|
377
377
|
this.appType = this.options.appType;
|
|
378
378
|
}
|
|
379
379
|
apply(compiler) {
|
|
@@ -389,19 +389,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
389
389
|
const disabledOptions = _chunkIIDSY4XZjs.resolveDisabledOptions.call(void 0, disabled);
|
|
390
390
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
391
391
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
392
|
-
const isMpxApp =
|
|
392
|
+
const isMpxApp = _chunkRHQJLGBFjs.isMpx.call(void 0, this.appType);
|
|
393
393
|
if (shouldRewriteCssImports) {
|
|
394
|
-
|
|
394
|
+
_chunkRHQJLGBFjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
395
395
|
pkgDir: weappTailwindcssPackageDir,
|
|
396
396
|
enabled: true,
|
|
397
397
|
appType: this.appType
|
|
398
398
|
});
|
|
399
|
-
|
|
399
|
+
_chunkRHQJLGBFjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
400
400
|
}
|
|
401
401
|
if (disabledOptions.plugin) {
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
|
-
const patchRecorderState =
|
|
404
|
+
const patchRecorderState = _chunkVEJYEJ4Vjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
405
405
|
source: "runtime",
|
|
406
406
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
407
407
|
});
|
|
@@ -413,17 +413,17 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
413
413
|
};
|
|
414
414
|
let runtimeSetPrepared = false;
|
|
415
415
|
let runtimeSetSignature;
|
|
416
|
-
compiler.hooks.compilation.tap(
|
|
416
|
+
compiler.hooks.compilation.tap(_chunkAAVDJYEEjs.pluginName, () => {
|
|
417
417
|
runtimeSetPrepared = false;
|
|
418
418
|
});
|
|
419
419
|
async function getClassSetInLoader() {
|
|
420
420
|
if (runtimeSetPrepared) {
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
|
-
const signature =
|
|
423
|
+
const signature = _chunkAAVDJYEEjs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
424
424
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
425
425
|
runtimeSetPrepared = true;
|
|
426
|
-
await
|
|
426
|
+
await _chunkAAVDJYEEjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
427
427
|
forceRefresh,
|
|
428
428
|
forceCollect: true,
|
|
429
429
|
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-TIZBA67F.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
} from "./chunk-RRHPTTCP.mjs";
|
|
24
24
|
import {
|
|
25
25
|
setupPatchRecorder
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PBA2SZ3H.mjs";
|
|
27
27
|
import {
|
|
28
28
|
createDebug,
|
|
29
29
|
ensureRuntimeClassSet,
|
|
30
30
|
getCompilerContext,
|
|
31
31
|
getRuntimeClassSetSignature,
|
|
32
32
|
pluginName
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-2VVKFR3W.mjs";
|
|
34
|
+
import "./chunk-QOTLDKI4.mjs";
|
|
35
35
|
import "./chunk-EGOFMIDI.mjs";
|
|
36
36
|
import {
|
|
37
37
|
getGroupedEntries
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.10.0-beta.
|
|
3
|
+
"version": "4.10.0-beta.3",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"@babel/parser": "~7.29.0",
|
|
168
168
|
"@babel/traverse": "~7.29.0",
|
|
169
169
|
"@babel/types": "~7.29.0",
|
|
170
|
-
"@tailwindcss-mangle/config": "^6.1.
|
|
170
|
+
"@tailwindcss-mangle/config": "^6.1.1",
|
|
171
171
|
"@vue/compiler-dom": "^3.5.28",
|
|
172
172
|
"@vue/compiler-sfc": "^3.5.28",
|
|
173
173
|
"@weapp-core/escape": "~7.0.0",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"lru-cache": "10.4.3",
|
|
182
182
|
"magic-string": "0.30.21",
|
|
183
183
|
"semver": "~7.7.4",
|
|
184
|
-
"tailwindcss-patch": "^8.
|
|
184
|
+
"tailwindcss-patch": "^8.7.0",
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
187
|
"@weapp-tailwindcss/shared": "1.1.2",
|