weapp-tailwindcss 4.12.0-alpha.3 → 4.12.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.
Files changed (44) hide show
  1. package/dist/{chunk-L3O54VR6.js → chunk-24AGZQVR.js} +2 -2
  2. package/dist/{chunk-6VMGUTN6.mjs → chunk-57SOQCAU.mjs} +4 -4
  3. package/dist/{chunk-I5H5RDWS.mjs → chunk-5ZYHNDEK.mjs} +61 -23
  4. package/dist/{chunk-P2X2S444.js → chunk-DUHYLR2R.js} +7 -7
  5. package/dist/{chunk-UVMAPQU7.js → chunk-FS2NOOEB.js} +5 -5
  6. package/dist/{chunk-OSWTWMAK.js → chunk-HVNGIKLS.js} +33 -23
  7. package/dist/{chunk-2PFYPSPO.js → chunk-JZQBZHN5.js} +39 -39
  8. package/dist/{chunk-J6FIO3RO.mjs → chunk-KGTVD4EP.mjs} +19 -9
  9. package/dist/{chunk-HL3US2OT.mjs → chunk-NNOQDMUP.mjs} +1 -1
  10. package/dist/{chunk-SON7XE3T.js → chunk-OFB2KBRP.js} +146 -108
  11. package/dist/{chunk-AYJ4HLWZ.mjs → chunk-PCDYXXSK.mjs} +11 -4
  12. package/dist/{chunk-ONLKZIRQ.js → chunk-RKISS72P.js} +1 -1
  13. package/dist/{chunk-6MIA3KYY.mjs → chunk-RRQZL7FQ.mjs} +1 -1
  14. package/dist/{chunk-XHTCHZVE.mjs → chunk-XZP3MREK.mjs} +1 -1
  15. package/dist/{chunk-NIS74SI6.js → chunk-ZAA5ZG3D.js} +60 -53
  16. package/dist/cli.js +7 -7
  17. package/dist/cli.mjs +7 -7
  18. package/dist/core.js +9 -9
  19. package/dist/core.mjs +3 -3
  20. package/dist/css-macro/postcss.js +1 -1
  21. package/dist/css-macro/postcss.mjs +1 -1
  22. package/dist/css-macro.js +1 -1
  23. package/dist/css-macro.mjs +1 -1
  24. package/dist/defaults.js +1 -1
  25. package/dist/defaults.mjs +1 -1
  26. package/dist/gulp.js +5 -5
  27. package/dist/gulp.mjs +4 -4
  28. package/dist/index.js +9 -9
  29. package/dist/index.mjs +7 -7
  30. package/dist/postcss-html-transform.js +1 -1
  31. package/dist/postcss-html-transform.mjs +1 -1
  32. package/dist/presets.js +6 -6
  33. package/dist/presets.mjs +2 -2
  34. package/dist/reset.js +1 -1
  35. package/dist/reset.mjs +1 -1
  36. package/dist/types.js +1 -1
  37. package/dist/types.mjs +1 -1
  38. package/dist/vite.js +6 -6
  39. package/dist/vite.mjs +4 -4
  40. package/dist/webpack.js +7 -7
  41. package/dist/webpack.mjs +5 -5
  42. package/dist/webpack4.js +35 -35
  43. package/dist/webpack4.mjs +4 -4
  44. package/package.json +8 -8
@@ -11,14 +11,14 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkUVMAPQU7js = require('./chunk-UVMAPQU7.js');
14
+ var _chunkFS2NOOEBjs = require('./chunk-FS2NOOEB.js');
15
15
 
16
16
 
17
17
 
18
18
 
19
19
 
20
20
 
21
- var _chunkL3O54VR6js = require('./chunk-L3O54VR6.js');
21
+ var _chunk24AGZQVRjs = require('./chunk-24AGZQVR.js');
22
22
 
23
23
 
24
24
  var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
@@ -29,11 +29,11 @@ var _chunkOF6MFURRjs = require('./chunk-OF6MFURR.js');
29
29
 
30
30
 
31
31
 
32
- var _chunkOSWTWMAKjs = require('./chunk-OSWTWMAK.js');
32
+ var _chunkHVNGIKLSjs = require('./chunk-HVNGIKLS.js');
33
33
 
34
34
 
35
35
 
36
- var _chunkNIS74SI6js = require('./chunk-NIS74SI6.js');
36
+ var _chunkZAA5ZG3Djs = require('./chunk-ZAA5ZG3D.js');
37
37
 
38
38
 
39
39
  var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
@@ -64,10 +64,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
64
64
  const { Compilation, sources } = compiler.webpack;
65
65
  const { ConcatSource } = sources;
66
66
  const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
67
- compiler.hooks.compilation.tap(_chunkOSWTWMAKjs.pluginName, (compilation) => {
67
+ compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, (compilation) => {
68
68
  compilation.hooks.processAssets.tapPromise(
69
69
  {
70
- name: _chunkOSWTWMAKjs.pluginName,
70
+ name: _chunkHVNGIKLSjs.pluginName,
71
71
  stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
72
72
  },
73
73
  async (assets) => {
@@ -79,20 +79,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
79
79
  compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
80
80
  }
81
81
  }
82
- const assetHashByChunk = _chunkUVMAPQU7js.createAssetHashByChunkMap.call(void 0, compilation.chunks);
82
+ const assetHashByChunk = _chunkFS2NOOEBjs.createAssetHashByChunkMap.call(void 0, compilation.chunks);
83
83
  const entries = Object.entries(assets);
84
84
  const compilerOutputPath = _nullishCoalesce(_optionalChain([compilation, 'access', _ => _.compiler, 'optionalAccess', _2 => _2.outputPath]), () => ( compiler.outputPath));
85
85
  const outputDir = compilerOutputPath ? _path2.default.resolve(compilerOutputPath) : _nullishCoalesce(_optionalChain([compilation, 'access', _3 => _3.outputOptions, 'optionalAccess', _4 => _4.path]), () => ( _process2.default.cwd()));
86
86
  const jsAssets = /* @__PURE__ */ new Map();
87
87
  for (const [file] of entries) {
88
88
  if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
89
- const absolute = _chunkL3O54VR6js.toAbsoluteOutputPath.call(void 0, file, outputDir);
89
+ const absolute = _chunk24AGZQVRjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
90
90
  jsAssets.set(absolute, file);
91
91
  }
92
92
  }
93
93
  const moduleGraphOptions = {
94
94
  resolve(specifier, importer) {
95
- return _chunkL3O54VR6js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
95
+ return _chunk24AGZQVRjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
96
96
  },
97
97
  load: (id) => {
98
98
  const assetName = jsAssets.get(id);
@@ -158,7 +158,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
158
158
  const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
159
159
  const forceRuntimeRefresh = getRuntimeRefreshRequirement();
160
160
  debug2("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, _nullishCoalesce(runtimeState.twPatcher.majorVersion, () => ( "unknown")));
161
- const runtimeSet = await _chunkOSWTWMAKjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
161
+ const runtimeSet = await _chunkHVNGIKLSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
162
162
  forceRefresh: forceRuntimeRefresh,
163
163
  // webpack 的 script-only 热更新可能不会触发 runtime classset loader,
164
164
  // 这里强制收集可避免沿用上轮 class set,保证 JS 仅按最新集合精确命中。
@@ -208,12 +208,12 @@ function setupWebpackV5ProcessAssetsHook(options) {
208
208
  const jsTaskFactories = [];
209
209
  if (Array.isArray(groupedEntries.js)) {
210
210
  for (const [file] of groupedEntries.js) {
211
- const cacheKey = _chunkUVMAPQU7js.getCacheKey.call(void 0, file);
211
+ const cacheKey = _chunkFS2NOOEBjs.getCacheKey.call(void 0, file);
212
212
  const asset = compilation.getAsset(file);
213
213
  if (!asset) {
214
214
  continue;
215
215
  }
216
- const absoluteFile = _chunkL3O54VR6js.toAbsoluteOutputPath.call(void 0, file, outputDir);
216
+ const absoluteFile = _chunk24AGZQVRjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
217
217
  const initialSource = asset.source.source();
218
218
  const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
219
219
  const chunkHash = assetHashByChunk.get(file);
@@ -243,7 +243,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
243
243
  sourceFilename: absoluteFile
244
244
  }
245
245
  };
246
- if (_chunkOSWTWMAKjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
246
+ if (_chunkHVNGIKLSjs.shouldSkipJsTransform.call(void 0, currentSource, handlerOptions)) {
247
247
  return { result: new ConcatSource(currentSource) };
248
248
  }
249
249
  const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
@@ -292,7 +292,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
292
292
  );
293
293
  }
294
294
  }
295
- _chunkL3O54VR6js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
295
+ _chunk24AGZQVRjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
296
296
  await Promise.all(tasks);
297
297
  debug2("end");
298
298
  compilerOptions.onEnd();
@@ -318,9 +318,9 @@ function setupWebpackV5Loaders(options) {
318
318
  getRuntimeWatchDependencies,
319
319
  debug: debug2
320
320
  } = options;
321
- const isMpxApp = _chunkUVMAPQU7js.isMpx.call(void 0, appType);
321
+ const isMpxApp = _chunkFS2NOOEBjs.isMpx.call(void 0, appType);
322
322
  if (shouldRewriteCssImports && isMpxApp) {
323
- _chunkUVMAPQU7js.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
323
+ _chunkFS2NOOEBjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir2);
324
324
  }
325
325
  const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
326
326
  const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
@@ -334,12 +334,12 @@ function setupWebpackV5Loaders(options) {
334
334
  getClassSet: getClassSetInLoader,
335
335
  getWatchDependencies: getRuntimeWatchDependencies
336
336
  };
337
- const { findRewriteAnchor, findClassSetAnchor } = _chunkUVMAPQU7js.createLoaderAnchorFinders.call(void 0, appType);
337
+ const { findRewriteAnchor, findClassSetAnchor } = _chunkFS2NOOEBjs.createLoaderAnchorFinders.call(void 0, appType);
338
338
  const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
339
339
  rewriteCssImports: runtimeLoaderRewriteOptions
340
340
  } : void 0;
341
341
  if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
342
- _chunkUVMAPQU7js.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
342
+ _chunkFS2NOOEBjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
343
343
  }
344
344
  const createRuntimeClassSetLoaderEntry = () => ({
345
345
  loader: runtimeClassSetLoader,
@@ -359,17 +359,17 @@ function setupWebpackV5Loaders(options) {
359
359
  };
360
360
  };
361
361
  const { NormalModule } = compiler.webpack;
362
- compiler.hooks.compilation.tap(_chunkOSWTWMAKjs.pluginName, (compilation) => {
363
- NormalModule.getCompilationHooks(compilation).loader.tap(_chunkOSWTWMAKjs.pluginName, (_loaderContext, module) => {
362
+ compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, (compilation) => {
363
+ NormalModule.getCompilationHooks(compilation).loader.tap(_chunkHVNGIKLSjs.pluginName, (_loaderContext, module) => {
364
364
  const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
365
365
  if (!hasRuntimeLoader) {
366
366
  return;
367
367
  }
368
- _chunkUVMAPQU7js.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
368
+ _chunkFS2NOOEBjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir2, shouldRewriteCssImports && isMpxApp);
369
369
  const loaderEntries = module.loaders || [];
370
370
  let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
371
371
  const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
372
- const isCssModule = _chunkUVMAPQU7js.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
372
+ const isCssModule = _chunkFS2NOOEBjs.isCssLikeModuleResource.call(void 0, module.resource, compilerOptions.cssMatcher, appType);
373
373
  if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
374
374
  debug2("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
375
375
  }
@@ -401,7 +401,7 @@ function setupWebpackV5Loaders(options) {
401
401
  rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
402
402
  }
403
403
  }
404
- if (runtimeClassSetLoaderExists && !_chunkUVMAPQU7js.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
404
+ if (runtimeClassSetLoaderExists && !_chunkFS2NOOEBjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
405
405
  const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
406
406
  const anchorIndex = findClassSetAnchor(loaderEntries);
407
407
  if (anchorIndex === -1) {
@@ -416,11 +416,11 @@ function setupWebpackV5Loaders(options) {
416
416
  }
417
417
 
418
418
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
419
- var debug = _chunkOSWTWMAKjs.createDebug.call(void 0, );
420
- var weappTailwindcssPackageDir = _chunkL3O54VR6js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
419
+ var debug = _chunkHVNGIKLSjs.createDebug.call(void 0, );
420
+ var weappTailwindcssPackageDir = _chunk24AGZQVRjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
421
421
  var UnifiedWebpackPluginV5 = class {
422
422
  constructor(options = {}) {
423
- this.options = _chunkOSWTWMAKjs.getCompilerContext.call(void 0, options);
423
+ this.options = _chunkHVNGIKLSjs.getCompilerContext.call(void 0, options);
424
424
  this.appType = this.options.appType;
425
425
  }
426
426
  apply(compiler) {
@@ -433,22 +433,22 @@ var UnifiedWebpackPluginV5 = class {
433
433
  twPatcher: initialTwPatcher,
434
434
  refreshTailwindcssPatcher
435
435
  } = this.options;
436
- const disabledOptions = _chunkL3O54VR6js.resolveDisabledOptions.call(void 0, disabled);
436
+ const disabledOptions = _chunk24AGZQVRjs.resolveDisabledOptions.call(void 0, disabled);
437
437
  const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
438
438
  const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
439
- const isMpxApp = _chunkUVMAPQU7js.isMpx.call(void 0, this.appType);
439
+ const isMpxApp = _chunkFS2NOOEBjs.isMpx.call(void 0, this.appType);
440
440
  if (shouldRewriteCssImports) {
441
- _chunkUVMAPQU7js.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
441
+ _chunkFS2NOOEBjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
442
442
  pkgDir: weappTailwindcssPackageDir,
443
443
  enabled: true,
444
444
  appType: this.appType
445
445
  });
446
- _chunkUVMAPQU7js.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
446
+ _chunkFS2NOOEBjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
447
447
  }
448
448
  if (disabledOptions.plugin) {
449
449
  return;
450
450
  }
451
- const patchRecorderState = _chunkOSWTWMAKjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
451
+ const patchRecorderState = _chunkHVNGIKLSjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
452
452
  source: "runtime",
453
453
  cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
454
454
  });
@@ -467,7 +467,7 @@ var UnifiedWebpackPluginV5 = class {
467
467
  const updateRuntimeWatchDependencies = async () => {
468
468
  runtimeWatchDependencyFiles.clear();
469
469
  runtimeWatchDependencyContexts.clear();
470
- const tailwindOptions = _chunkNIS74SI6js.resolveTailwindcssOptions.call(void 0, runtimeState.twPatcher.options);
470
+ const tailwindOptions = _chunkZAA5ZG3Djs.resolveTailwindcssOptions.call(void 0, runtimeState.twPatcher.options);
471
471
  if (_optionalChain([tailwindOptions, 'optionalAccess', _13 => _13.config])) {
472
472
  runtimeWatchDependencyFiles.add(tailwindOptions.config);
473
473
  }
@@ -506,31 +506,31 @@ var UnifiedWebpackPluginV5 = class {
506
506
  runtimeMetadataPrepared = true;
507
507
  };
508
508
  const syncRuntimeRefreshRequirement = () => {
509
- runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || _chunkUVMAPQU7js.hasWatchChanges.call(void 0, compiler);
509
+ runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || _chunkFS2NOOEBjs.hasWatchChanges.call(void 0, compiler);
510
510
  };
511
511
  const resetRuntimePreparation = () => {
512
512
  runtimeSetPrepared = false;
513
513
  runtimeMetadataPrepared = false;
514
514
  syncRuntimeRefreshRequirement();
515
515
  };
516
- _optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(_chunkOSWTWMAKjs.pluginName, () => {
516
+ _optionalChain([compiler, 'access', _20 => _20.hooks, 'access', _21 => _21.invalid, 'optionalAccess', _22 => _22.tap, 'optionalCall', _23 => _23(_chunkHVNGIKLSjs.pluginName, () => {
517
517
  runtimeRefreshRequiredForCompilation = true;
518
518
  })]);
519
- _optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(_chunkOSWTWMAKjs.pluginName, syncRuntimeRefreshRequirement)]);
519
+ _optionalChain([compiler, 'access', _24 => _24.hooks, 'access', _25 => _25.watchRun, 'optionalAccess', _26 => _26.tap, 'optionalCall', _27 => _27(_chunkHVNGIKLSjs.pluginName, syncRuntimeRefreshRequirement)]);
520
520
  if (_optionalChain([compiler, 'access', _28 => _28.hooks, 'access', _29 => _29.thisCompilation, 'optionalAccess', _30 => _30.tap])) {
521
- compiler.hooks.thisCompilation.tap(_chunkOSWTWMAKjs.pluginName, resetRuntimePreparation);
521
+ compiler.hooks.thisCompilation.tap(_chunkHVNGIKLSjs.pluginName, resetRuntimePreparation);
522
522
  } else if (_optionalChain([compiler, 'access', _31 => _31.hooks, 'access', _32 => _32.compilation, 'optionalAccess', _33 => _33.tap])) {
523
- compiler.hooks.compilation.tap(_chunkOSWTWMAKjs.pluginName, resetRuntimePreparation);
523
+ compiler.hooks.compilation.tap(_chunkHVNGIKLSjs.pluginName, resetRuntimePreparation);
524
524
  }
525
525
  async function getClassSetInLoader() {
526
526
  if (runtimeSetPrepared) {
527
527
  return;
528
528
  }
529
- const signature = _chunkNIS74SI6js.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
529
+ const signature = _chunkZAA5ZG3Djs.getRuntimeClassSetSignature.call(void 0, runtimeState.twPatcher);
530
530
  const forceRefresh = runtimeRefreshRequiredForCompilation || signature !== runtimeSetSignature;
531
531
  debug("runtime loader ensure class set forceRefresh=%s watchDirty=%s signatureChanged=%s", forceRefresh, runtimeRefreshRequiredForCompilation, signature !== runtimeSetSignature);
532
532
  runtimeSetPrepared = true;
533
- await _chunkOSWTWMAKjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
533
+ await _chunkHVNGIKLSjs.ensureRuntimeClassSet.call(void 0, runtimeState, {
534
534
  forceRefresh,
535
535
  forceCollect: true,
536
536
  clearCache: forceRefresh,
@@ -9,7 +9,7 @@ import {
9
9
  logger,
10
10
  resolveUniAppXOptions,
11
11
  warnMissingCssEntries
12
- } from "./chunk-AYJ4HLWZ.mjs";
12
+ } from "./chunk-PCDYXXSK.mjs";
13
13
  import {
14
14
  getDefaultOptions
15
15
  } from "./chunk-XAKAD2CR.mjs";
@@ -469,7 +469,7 @@ import { logger as logger3 } from "@weapp-tailwindcss/logger";
469
469
  // package.json
470
470
  var package_default = {
471
471
  name: "weapp-tailwindcss",
472
- version: "4.12.0-alpha.3",
472
+ version: "4.12.0",
473
473
  description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
474
474
  author: "ice breaker <1324318532@qq.com>",
475
475
  license: "MIT",
@@ -662,10 +662,10 @@ var package_default = {
662
662
  },
663
663
  dependencies: {
664
664
  "@ast-core/escape": "~1.0.1",
665
- "@babel/parser": "~7.29.2",
665
+ "@babel/parser": "~7.29.3",
666
666
  "@babel/traverse": "~7.29.0",
667
667
  "@babel/types": "~7.29.0",
668
- "@tailwindcss-mangle/config": "^7.0.0",
668
+ "@tailwindcss-mangle/config": "^7.0.1",
669
669
  "@vue/compiler-dom": "catalog:vue3",
670
670
  "@vue/compiler-sfc": "catalog:vue3",
671
671
  "@weapp-core/escape": "~7.0.0",
@@ -686,7 +686,7 @@ var package_default = {
686
686
  semver: "~7.7.4",
687
687
  "tailwindcss-patch": "catalog:tailwindcssPatch",
688
688
  "webpack-sources": "3.3.4",
689
- yaml: "^2.8.3"
689
+ yaml: "^2.8.4"
690
690
  },
691
691
  devDependencies: {
692
692
  "fast-check": "^4.7.0"
@@ -1568,7 +1568,7 @@ function isClassLikeCallExpression(path5, valuePath) {
1568
1568
  if (!helperName || !CLASS_HELPER_IDENTIFIERS.has(normalizeKeyword(helperName))) {
1569
1569
  return false;
1570
1570
  }
1571
- return path5.get("arguments").includes(valuePath);
1571
+ return path5.get("arguments").some((argumentPath) => argumentPath.node === valuePath.node);
1572
1572
  }
1573
1573
  function isClassContextLiteralPath(path5) {
1574
1574
  let current = path5;
@@ -3003,6 +3003,7 @@ defaultEvalHandler = jsHandler;
3003
3003
 
3004
3004
  // src/js/index.ts
3005
3005
  var RESULT_CACHE_MAX = 512;
3006
+ var CACHEABLE_SOURCE_MAX_LENGTH = 512;
3006
3007
  var classNameSetIds = /* @__PURE__ */ new WeakMap();
3007
3008
  var nextClassNameSetId = 0;
3008
3009
  function getClassNameSetId(set) {
@@ -3056,6 +3057,15 @@ function hasDefinedOverrides(options) {
3056
3057
  }
3057
3058
  return false;
3058
3059
  }
3060
+ function shouldCacheJsResult(rawSource, options) {
3061
+ if (rawSource.length === 0 || rawSource.length > CACHEABLE_SOURCE_MAX_LENGTH) {
3062
+ return false;
3063
+ }
3064
+ if (options.moduleGraph || options.filename) {
3065
+ return false;
3066
+ }
3067
+ return true;
3068
+ }
3059
3069
  function createJsHandler(options) {
3060
3070
  const defaults = {
3061
3071
  escapeMap: options.escapeMap,
@@ -3100,14 +3110,14 @@ function createJsHandler(options) {
3100
3110
  return created;
3101
3111
  }
3102
3112
  function getCachedJsResult(rawSource, resolvedOptions) {
3103
- if (rawSource.length === 0) {
3113
+ if (!shouldCacheJsResult(rawSource, resolvedOptions)) {
3104
3114
  return void 0;
3105
3115
  }
3106
3116
  const key = `${getOptionsFingerprint(resolvedOptions)}:${md5(rawSource)}`;
3107
3117
  return resultCache.get(key);
3108
3118
  }
3109
3119
  function setCachedJsResult(rawSource, resolvedOptions, result) {
3110
- if (rawSource.length === 0 || result.error || result.linked) {
3120
+ if (!shouldCacheJsResult(rawSource, resolvedOptions) || result.error || result.linked) {
3111
3121
  return result;
3112
3122
  }
3113
3123
  const key = `${getOptionsFingerprint(resolvedOptions)}:${md5(rawSource)}`;
@@ -3512,7 +3522,7 @@ function handleEachClassFragment(ms, tokens, options = {}) {
3512
3522
  previousEnd = token.end;
3513
3523
  }
3514
3524
  if (tokens.length > 0) {
3515
- const lastToken = tokens.at(-1);
3525
+ const lastToken = tokens[tokens.length - 1];
3516
3526
  if (lastToken.end < ms.original.length) {
3517
3527
  updateWhitespaceGap(ms, lastToken.end, ms.original.length, options);
3518
3528
  }
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.2__@swc+core@1.15.32_@swc+_5ed6cbcda668e45f9f2d3d9f21b34c59/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.2__@swc+core@1.15.33_@swc+_bcceec21436c72f72b5a2f34a0f75238/node_modules/tsup/assets/esm_shims.js
2
2
  import path from "path";
3
3
  import { fileURLToPath } from "url";
4
4
  var getFilename = () => fileURLToPath(import.meta.url);