weapp-tailwindcss 4.11.2 → 4.12.0-next.0
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/README.md +38 -0
- package/dist/{chunk-WJIRXC26.js → chunk-5ONE75V7.js} +117 -119
- package/dist/{chunk-OMARW5NC.mjs → chunk-AYJ4HLWZ.mjs} +4 -2
- package/dist/{chunk-VGPAKLMZ.mjs → chunk-F5XJWJYO.mjs} +12 -7
- package/dist/{chunk-SUKOZ6OG.js → chunk-FMK6SFQQ.js} +10 -6
- package/dist/{chunk-TT5WHNGS.js → chunk-GC7WXUOW.js} +136 -77
- package/dist/{chunk-W3DXDWYC.mjs → chunk-GD4SQMVF.mjs} +49 -51
- package/dist/{chunk-7LKMJZD2.js → chunk-GMKSBLNY.js} +2 -2
- package/dist/{chunk-EFBQ4SQR.mjs → chunk-HL3US2OT.mjs} +1 -1
- package/dist/{chunk-3QHYEMEW.js → chunk-LVSUBDJC.js} +45 -40
- package/dist/{chunk-QK6VNNNL.js → chunk-NIS74SI6.js} +8 -6
- package/dist/{chunk-CRDOWYG4.js → chunk-ONLKZIRQ.js} +1 -1
- package/dist/{chunk-AB2RGZQO.mjs → chunk-QNRJCEZN.mjs} +131 -72
- package/dist/{chunk-ZZ36BKM5.mjs → chunk-UUJWDME4.mjs} +6 -2
- package/dist/{chunk-AV3XB6EQ.js → chunk-WSS26HZS.js} +5 -5
- package/dist/{chunk-JIERVBTX.mjs → chunk-ZR3KN3FG.mjs} +1 -1
- package/dist/cli.js +8 -1
- package/dist/cli.mjs +8 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +14 -9
- package/dist/core.mjs +10 -5
- 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.d.mts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +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-CoXntW_P.d.mts → index-BXrmQelt.d.mts} +29 -1
- package/dist/{index-CoXntW_P.d.ts → index-BXrmQelt.d.ts} +29 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- 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.d.mts +8 -1
- package/dist/presets.d.ts +8 -1
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +3 -2
- package/dist/reset.d.mts +1 -31
- package/dist/reset.d.ts +3 -32
- package/dist/reset.js +3 -160
- package/dist/reset.mjs +3 -160
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +6 -6
- package/dist/vite.mjs +4 -4
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.d.mts +1 -1
- package/dist/webpack4.d.ts +1 -1
- package/dist/webpack4.js +41 -36
- package/dist/webpack4.mjs +12 -7
- package/package.json +8 -4
package/dist/webpack4.js
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkWSS26HZSjs = require('./chunk-WSS26HZS.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkGMKSBLNYjs = require('./chunk-GMKSBLNY.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
@@ -27,15 +27,16 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var _chunkTT5WHNGSjs = require('./chunk-TT5WHNGS.js');
|
|
31
30
|
|
|
31
|
+
var _chunkGC7WXUOWjs = require('./chunk-GC7WXUOW.js');
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
var _chunkNIS74SI6js = require('./chunk-NIS74SI6.js');
|
|
34
35
|
require('./chunk-A5PB4KZT.js');
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
|
|
38
|
-
require('./chunk-
|
|
39
|
+
require('./chunk-ONLKZIRQ.js');
|
|
39
40
|
|
|
40
41
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
41
42
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -59,7 +60,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
59
60
|
debug: debug2
|
|
60
61
|
} = options;
|
|
61
62
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
62
|
-
compiler.hooks.emit.tapPromise(
|
|
63
|
+
compiler.hooks.emit.tapPromise(_chunkGC7WXUOWjs.pluginName, async (compilation) => {
|
|
63
64
|
await runtimeState.patchPromise;
|
|
64
65
|
compilerOptions.onStart();
|
|
65
66
|
debug2("start");
|
|
@@ -68,20 +69,20 @@ function setupWebpackV4EmitHook(options) {
|
|
|
68
69
|
compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
const assetHashByChunk =
|
|
72
|
+
const assetHashByChunk = _chunkWSS26HZSjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
|
|
72
73
|
const assets = compilation.assets;
|
|
73
74
|
const entries = Object.entries(assets);
|
|
74
75
|
const outputDir = _optionalChain([compiler, 'access', _ => _.options, 'optionalAccess', _2 => _2.output, 'optionalAccess', _3 => _3.path]) ? _path2.default.resolve(compiler.options.output.path) : _process2.default.cwd();
|
|
75
76
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
76
77
|
for (const [file] of entries) {
|
|
77
78
|
if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
|
|
78
|
-
const absolute =
|
|
79
|
+
const absolute = _chunkGMKSBLNYjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
79
80
|
jsAssets.set(absolute, file);
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
const moduleGraphOptions = {
|
|
83
84
|
resolve(specifier, importer) {
|
|
84
|
-
return
|
|
85
|
+
return _chunkGMKSBLNYjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
85
86
|
},
|
|
86
87
|
load: (id) => {
|
|
87
88
|
const assetName = jsAssets.get(id);
|
|
@@ -145,7 +146,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
145
146
|
return created;
|
|
146
147
|
};
|
|
147
148
|
const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
|
|
148
|
-
const runtimeSet = await
|
|
149
|
+
const runtimeSet = await _chunkGC7WXUOWjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
149
150
|
// webpack 的 script-only 热更新可能不会触发 runtime classset loader,
|
|
150
151
|
// 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
|
|
151
152
|
forceCollect: true,
|
|
@@ -191,14 +192,14 @@ function setupWebpackV4EmitHook(options) {
|
|
|
191
192
|
const jsTaskFactories = [];
|
|
192
193
|
if (Array.isArray(groupedEntries.js)) {
|
|
193
194
|
for (const [file] of groupedEntries.js) {
|
|
194
|
-
const cacheKey =
|
|
195
|
+
const cacheKey = _chunkWSS26HZSjs.getCacheKey.call(void 0, file);
|
|
195
196
|
const assetSource = compilation.assets[file];
|
|
196
197
|
if (!assetSource) {
|
|
197
198
|
continue;
|
|
198
199
|
}
|
|
199
200
|
const initialValue = assetSource.source();
|
|
200
201
|
const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
|
|
201
|
-
const absoluteFile =
|
|
202
|
+
const absoluteFile = _chunkGMKSBLNYjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
202
203
|
const chunkHash = assetHashByChunk.get(file);
|
|
203
204
|
const sourceAwareHash = chunkHash ? `${chunkHash}:${compilerOptions.cache.computeHash(initialRawSource)}` : void 0;
|
|
204
205
|
jsTaskFactories.push(async () => {
|
|
@@ -218,7 +219,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
218
219
|
const currentAsset = compilation.assets[file];
|
|
219
220
|
const currentValue = _optionalChain([currentAsset, 'optionalAccess', _4 => _4.source, 'call', _5 => _5()]);
|
|
220
221
|
const currentSource = typeof currentValue === "string" ? currentValue : _nullishCoalesce(_optionalChain([currentValue, 'optionalAccess', _6 => _6.toString, 'call', _7 => _7()]), () => ( ""));
|
|
221
|
-
const
|
|
222
|
+
const handlerOptions = {
|
|
222
223
|
staleClassNameFallback,
|
|
223
224
|
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
224
225
|
filename: absoluteFile,
|
|
@@ -226,7 +227,11 @@ function setupWebpackV4EmitHook(options) {
|
|
|
226
227
|
babelParserOptions: {
|
|
227
228
|
sourceFilename: absoluteFile
|
|
228
229
|
}
|
|
229
|
-
}
|
|
230
|
+
};
|
|
231
|
+
if (_chunkGC7WXUOWjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
|
|
232
|
+
return { result: new (0, _webpacksources.ConcatSource)(currentSource) };
|
|
233
|
+
}
|
|
234
|
+
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
230
235
|
const source = new (0, _webpacksources.ConcatSource)(code);
|
|
231
236
|
compilerOptions.onUpdate(file, currentSource, code);
|
|
232
237
|
debug2("js handle: %s", file);
|
|
@@ -272,7 +277,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
272
277
|
);
|
|
273
278
|
}
|
|
274
279
|
}
|
|
275
|
-
|
|
280
|
+
_chunkGMKSBLNYjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
276
281
|
await Promise.all(tasks);
|
|
277
282
|
debug2("end");
|
|
278
283
|
compilerOptions.onEnd();
|
|
@@ -295,9 +300,9 @@ function setupWebpackV4Loaders(options) {
|
|
|
295
300
|
getClassSetInLoader,
|
|
296
301
|
debug: debug2
|
|
297
302
|
} = options;
|
|
298
|
-
const isMpxApp =
|
|
303
|
+
const isMpxApp = _chunkWSS26HZSjs.isMpx.call(void 0, appType);
|
|
299
304
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
300
|
-
|
|
305
|
+
_chunkWSS26HZSjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
|
|
301
306
|
}
|
|
302
307
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
303
308
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -310,12 +315,12 @@ function setupWebpackV4Loaders(options) {
|
|
|
310
315
|
const classSetLoaderOptions = {
|
|
311
316
|
getClassSet: getClassSetInLoader
|
|
312
317
|
};
|
|
313
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
318
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkWSS26HZSjs.createLoaderAnchorFinders.call(void 0, appType);
|
|
314
319
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
315
320
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
316
321
|
} : void 0;
|
|
317
322
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
318
|
-
|
|
323
|
+
_chunkWSS26HZSjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
319
324
|
}
|
|
320
325
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
321
326
|
loader: runtimeClassSetLoader,
|
|
@@ -334,19 +339,19 @@ function setupWebpackV4Loaders(options) {
|
|
|
334
339
|
type: null
|
|
335
340
|
};
|
|
336
341
|
};
|
|
337
|
-
compiler.hooks.compilation.tap(
|
|
338
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
342
|
+
compiler.hooks.compilation.tap(_chunkGC7WXUOWjs.pluginName, (compilation) => {
|
|
343
|
+
compilation.hooks.normalModuleLoader.tap(_chunkGC7WXUOWjs.pluginName, (_loaderContext, module) => {
|
|
339
344
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
340
345
|
if (!hasRuntimeLoader) {
|
|
341
346
|
return;
|
|
342
347
|
}
|
|
343
|
-
if (shouldRewriteCssImports &&
|
|
344
|
-
|
|
348
|
+
if (shouldRewriteCssImports && _chunkWSS26HZSjs.isMpx.call(void 0, appType) && typeof _loaderContext.resolve === "function") {
|
|
349
|
+
_chunkWSS26HZSjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, true);
|
|
345
350
|
}
|
|
346
351
|
const loaderEntries = module.loaders || [];
|
|
347
352
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
348
353
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
349
|
-
const isCssModule =
|
|
354
|
+
const isCssModule = _chunkWSS26HZSjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
|
|
350
355
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
351
356
|
debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
352
357
|
}
|
|
@@ -380,7 +385,7 @@ function setupWebpackV4Loaders(options) {
|
|
|
380
385
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
381
386
|
}
|
|
382
387
|
}
|
|
383
|
-
if (runtimeClassSetLoaderExists && !
|
|
388
|
+
if (runtimeClassSetLoaderExists && !_chunkWSS26HZSjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
384
389
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
385
390
|
if (anchorIndex === -1) {
|
|
386
391
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -394,11 +399,11 @@ function setupWebpackV4Loaders(options) {
|
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
397
|
-
var debug =
|
|
398
|
-
var weappTailwindcssPackageDir =
|
|
402
|
+
var debug = _chunkGC7WXUOWjs.createDebug.call(void 0, );
|
|
403
|
+
var weappTailwindcssPackageDir = _chunkGMKSBLNYjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
399
404
|
var UnifiedWebpackPluginV4 = class {
|
|
400
405
|
constructor(options = {}) {
|
|
401
|
-
this.options =
|
|
406
|
+
this.options = _chunkGC7WXUOWjs.getCompilerContext.call(void 0, options);
|
|
402
407
|
this.appType = this.options.appType;
|
|
403
408
|
}
|
|
404
409
|
apply(compiler) {
|
|
@@ -411,22 +416,22 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
411
416
|
twPatcher: initialTwPatcher,
|
|
412
417
|
refreshTailwindcssPatcher
|
|
413
418
|
} = this.options;
|
|
414
|
-
const disabledOptions =
|
|
419
|
+
const disabledOptions = _chunkGMKSBLNYjs.resolveDisabledOptions.call(void 0, disabled);
|
|
415
420
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
416
421
|
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
417
|
-
const isMpxApp =
|
|
422
|
+
const isMpxApp = _chunkWSS26HZSjs.isMpx.call(void 0, this.appType);
|
|
418
423
|
if (shouldRewriteCssImports) {
|
|
419
|
-
|
|
424
|
+
_chunkWSS26HZSjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
420
425
|
pkgDir: weappTailwindcssPackageDir,
|
|
421
426
|
enabled: true,
|
|
422
427
|
appType: this.appType
|
|
423
428
|
});
|
|
424
|
-
|
|
429
|
+
_chunkWSS26HZSjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
425
430
|
}
|
|
426
431
|
if (disabledOptions.plugin) {
|
|
427
432
|
return;
|
|
428
433
|
}
|
|
429
|
-
const patchRecorderState =
|
|
434
|
+
const patchRecorderState = _chunkGC7WXUOWjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
430
435
|
source: "runtime",
|
|
431
436
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
432
437
|
});
|
|
@@ -438,17 +443,17 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
438
443
|
};
|
|
439
444
|
let runtimeSetPrepared = false;
|
|
440
445
|
let runtimeSetSignature;
|
|
441
|
-
compiler.hooks.compilation.tap(
|
|
446
|
+
compiler.hooks.compilation.tap(_chunkGC7WXUOWjs.pluginName, () => {
|
|
442
447
|
runtimeSetPrepared = false;
|
|
443
448
|
});
|
|
444
449
|
async function getClassSetInLoader() {
|
|
445
450
|
if (runtimeSetPrepared) {
|
|
446
451
|
return;
|
|
447
452
|
}
|
|
448
|
-
const signature =
|
|
453
|
+
const signature = _chunkNIS74SI6js.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
|
|
449
454
|
const forceRefresh = signature !== runtimeSetSignature;
|
|
450
455
|
runtimeSetPrepared = true;
|
|
451
|
-
await
|
|
456
|
+
await _chunkGC7WXUOWjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
|
|
452
457
|
forceRefresh,
|
|
453
458
|
forceCollect: true,
|
|
454
459
|
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-ZR3KN3FG.mjs";
|
|
14
14
|
import {
|
|
15
15
|
pushConcurrentTaskFactories,
|
|
16
16
|
resolveDisabledOptions,
|
|
@@ -26,18 +26,19 @@ import {
|
|
|
26
26
|
ensureRuntimeClassSet,
|
|
27
27
|
getCompilerContext,
|
|
28
28
|
pluginName,
|
|
29
|
-
setupPatchRecorder
|
|
30
|
-
|
|
29
|
+
setupPatchRecorder,
|
|
30
|
+
shouldSkipJsTransform
|
|
31
|
+
} from "./chunk-QNRJCEZN.mjs";
|
|
31
32
|
import {
|
|
32
33
|
getRuntimeClassSetSignature
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AYJ4HLWZ.mjs";
|
|
34
35
|
import "./chunk-XAKAD2CR.mjs";
|
|
35
36
|
import {
|
|
36
37
|
getGroupedEntries
|
|
37
38
|
} from "./chunk-OOHJLO5M.mjs";
|
|
38
39
|
import {
|
|
39
40
|
__dirname
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-HL3US2OT.mjs";
|
|
41
42
|
|
|
42
43
|
// src/bundlers/webpack/BaseUnifiedPlugin/v4.ts
|
|
43
44
|
import process3 from "process";
|
|
@@ -220,7 +221,7 @@ function setupWebpackV4EmitHook(options) {
|
|
|
220
221
|
const currentAsset = compilation.assets[file];
|
|
221
222
|
const currentValue = currentAsset?.source();
|
|
222
223
|
const currentSource = typeof currentValue === "string" ? currentValue : currentValue?.toString() ?? "";
|
|
223
|
-
const
|
|
224
|
+
const handlerOptions = {
|
|
224
225
|
staleClassNameFallback,
|
|
225
226
|
tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
|
|
226
227
|
filename: absoluteFile,
|
|
@@ -228,7 +229,11 @@ function setupWebpackV4EmitHook(options) {
|
|
|
228
229
|
babelParserOptions: {
|
|
229
230
|
sourceFilename: absoluteFile
|
|
230
231
|
}
|
|
231
|
-
}
|
|
232
|
+
};
|
|
233
|
+
if (shouldSkipJsTransform(currentSource, handlerOptions)) {
|
|
234
|
+
return { result: new ConcatSource(currentSource) };
|
|
235
|
+
}
|
|
236
|
+
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
232
237
|
const source = new ConcatSource(code);
|
|
233
238
|
compilerOptions.onUpdate(file, currentSource, code);
|
|
234
239
|
debug2("js handle: %s", file);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0-next.0",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -168,8 +168,8 @@
|
|
|
168
168
|
"@babel/traverse": "~7.29.0",
|
|
169
169
|
"@babel/types": "~7.29.0",
|
|
170
170
|
"@tailwindcss-mangle/config": "^7.0.0",
|
|
171
|
-
"@vue/compiler-dom": "^3.5.
|
|
172
|
-
"@vue/compiler-sfc": "^3.5.
|
|
171
|
+
"@vue/compiler-dom": "^3.5.33",
|
|
172
|
+
"@vue/compiler-sfc": "^3.5.33",
|
|
173
173
|
"@weapp-core/escape": "~7.0.0",
|
|
174
174
|
"@weapp-core/regex": "~1.0.1",
|
|
175
175
|
"cac": "6.7.14",
|
|
@@ -186,9 +186,13 @@
|
|
|
186
186
|
"webpack-sources": "3.3.4",
|
|
187
187
|
"yaml": "^2.8.3",
|
|
188
188
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
189
|
-
"@weapp-tailwindcss/postcss": "2.
|
|
189
|
+
"@weapp-tailwindcss/postcss": "2.2.0-next.0",
|
|
190
|
+
"@weapp-tailwindcss/reset": "0.1.0-next.0",
|
|
190
191
|
"@weapp-tailwindcss/shared": "1.1.3"
|
|
191
192
|
},
|
|
193
|
+
"devDependencies": {
|
|
194
|
+
"fast-check": "^4.7.0"
|
|
195
|
+
},
|
|
192
196
|
"scripts": {
|
|
193
197
|
"dev": "tsup --watch --sourcemap",
|
|
194
198
|
"build": "tsup && node scripts/ensure-escape-dts.mjs",
|