weapp-tailwindcss 4.8.10 → 4.8.12

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 (46) hide show
  1. package/dist/{chunk-MNZW5VG5.js → chunk-243FNJFQ.js} +127 -127
  2. package/dist/{chunk-YXT3T3LH.js → chunk-3DQN7M5U.js} +2 -2
  3. package/dist/{chunk-BZXRUB2B.mjs → chunk-4H3RCNUP.mjs} +2 -2
  4. package/dist/{chunk-XXO2FHP7.mjs → chunk-6LYLDH5F.mjs} +1 -1
  5. package/dist/{chunk-CFFV3OIP.js → chunk-A5JYBYB2.js} +1 -1
  6. package/dist/{chunk-YM3HBJ3Q.js → chunk-AVR4TFX3.js} +7 -7
  7. package/dist/{chunk-B7QESXH4.mjs → chunk-AVUQQ4GH.mjs} +4 -4
  8. package/dist/{chunk-INF2Q5LI.js → chunk-CGCWO2U6.js} +6 -6
  9. package/dist/{chunk-IXK4ZWFR.mjs → chunk-HHSKDU3Z.mjs} +28 -6
  10. package/dist/{chunk-HFAC5AYM.mjs → chunk-HMFOJPZG.mjs} +2 -2
  11. package/dist/{chunk-JCG2LT63.mjs → chunk-K2Y3FXU7.mjs} +109 -109
  12. package/dist/{chunk-SXBK4NF4.mjs → chunk-MDZGOZZP.mjs} +1 -1
  13. package/dist/{chunk-XP5623NL.js → chunk-WIET7TXZ.js} +5 -5
  14. package/dist/{chunk-VMX23GDK.js → chunk-WILVISNS.js} +28 -28
  15. package/dist/{chunk-OBOKBKZQ.mjs → chunk-XSRP6OF5.mjs} +2 -2
  16. package/dist/{chunk-W7H4R6CP.js → chunk-ZADOXTZC.js} +42 -20
  17. package/dist/{chunk-OACITA4W.js → chunk-ZSI6C3R4.js} +22 -22
  18. package/dist/cli.js +326 -172
  19. package/dist/cli.mjs +303 -149
  20. package/dist/core.js +10 -10
  21. package/dist/core.mjs +4 -4
  22. package/dist/css-macro/postcss.js +1 -1
  23. package/dist/css-macro/postcss.mjs +1 -1
  24. package/dist/css-macro.js +1 -1
  25. package/dist/css-macro.mjs +1 -1
  26. package/dist/defaults.js +1 -1
  27. package/dist/defaults.mjs +1 -1
  28. package/dist/gulp.js +6 -6
  29. package/dist/gulp.mjs +5 -5
  30. package/dist/index.js +10 -10
  31. package/dist/index.mjs +8 -8
  32. package/dist/postcss-html-transform.js +1 -1
  33. package/dist/postcss-html-transform.mjs +1 -1
  34. package/dist/presets.js +4 -4
  35. package/dist/presets.mjs +2 -2
  36. package/dist/reset.js +1 -1
  37. package/dist/reset.mjs +1 -1
  38. package/dist/types.js +1 -1
  39. package/dist/types.mjs +1 -1
  40. package/dist/vite.js +7 -7
  41. package/dist/vite.mjs +5 -5
  42. package/dist/webpack.js +8 -8
  43. package/dist/webpack.mjs +6 -6
  44. package/dist/webpack4.js +31 -31
  45. package/dist/webpack4.mjs +5 -5
  46. package/package.json +4 -4
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkW7H4R6CPjs = require('./chunk-W7H4R6CP.js');
6
+ var _chunkZADOXTZCjs = require('./chunk-ZADOXTZC.js');
7
7
 
8
8
 
9
9
  var _chunk3URI7W6Xjs = require('./chunk-3URI7W6X.js');
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
187
187
  // package.json
188
188
  var package_default = {
189
189
  name: "weapp-tailwindcss",
190
- version: "4.8.10",
190
+ version: "4.8.12",
191
191
  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!",
192
192
  author: "ice breaker <1324318532@qq.com>",
193
193
  license: "MIT",
@@ -411,17 +411,119 @@ var DEFAULT_RUNTIME_PACKAGE_REPLACEMENTS = {
411
411
  "tailwind-variants": "@weapp-tailwindcss/variants"
412
412
  };
413
413
 
414
- // src/tailwindcss/targets.ts
415
-
414
+ // src/context/index.ts
416
415
  var _promises = require('fs/promises');
417
- var _path = require('path'); var _path2 = _interopRequireDefault(_path);
418
- var _process = require('process'); var _process2 = _interopRequireDefault(_process);
419
416
  var _logger = require('@weapp-tailwindcss/logger');
420
417
 
418
+ // src/cache/index.ts
419
+ var _lrucache = require('lru-cache');
420
+
421
421
  // src/cache/md5.ts
422
422
  var _node = require('@weapp-tailwindcss/shared/node');
423
423
 
424
+ // src/cache/index.ts
425
+ function isProcessResult(value) {
426
+ return typeof value === "object" && value !== null && "result" in value;
427
+ }
428
+ function createCache(options) {
429
+ const disabled = options === false;
430
+ const hashMap = /* @__PURE__ */ new Map();
431
+ const instance = new (0, _lrucache.LRUCache)({
432
+ // 可能会添加和删除一些页面和组件, 先设定 1024 吧
433
+ max: 1024,
434
+ ttl: 0,
435
+ ttlAutopurge: false
436
+ });
437
+ const cache = {
438
+ hashMap,
439
+ instance,
440
+ hasHashKey(key) {
441
+ return hashMap.has(key);
442
+ },
443
+ getHashValue(key) {
444
+ return hashMap.get(key);
445
+ },
446
+ setHashValue(key, value) {
447
+ return hashMap.set(key, value);
448
+ },
449
+ get(key) {
450
+ return instance.get(key);
451
+ },
452
+ set(key, value) {
453
+ return instance.set(key, value);
454
+ },
455
+ computeHash(message) {
456
+ return _node.md5.call(void 0, message);
457
+ },
458
+ calcHashValueChanged(key, hash) {
459
+ const hit = hashMap.get(key);
460
+ if (hit) {
461
+ hashMap.set(key, {
462
+ changed: hash !== hit.hash,
463
+ hash
464
+ });
465
+ } else {
466
+ hashMap.set(key, {
467
+ changed: true,
468
+ hash
469
+ });
470
+ }
471
+ return cache;
472
+ },
473
+ has(key) {
474
+ return instance.has(key);
475
+ },
476
+ async process({
477
+ key,
478
+ hashKey,
479
+ rawSource,
480
+ hash,
481
+ resolveCache,
482
+ transform,
483
+ onCacheHit
484
+ }) {
485
+ if (disabled) {
486
+ const value2 = await transform();
487
+ return isProcessResult(value2) ? value2.result : value2;
488
+ }
489
+ const cacheHashKey = _nullishCoalesce(hashKey, () => ( key));
490
+ let hasChanged = true;
491
+ if (hash != null || rawSource != null) {
492
+ const nextHash = _nullishCoalesce(hash, () => ( cache.computeHash(rawSource)));
493
+ cache.calcHashValueChanged(cacheHashKey, nextHash);
494
+ const entry = cache.getHashValue(cacheHashKey);
495
+ hasChanged = _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _6 => _6.changed]), () => ( true));
496
+ }
497
+ const readCache = _nullishCoalesce(resolveCache, () => ( (() => cache.get(key))));
498
+ if (!hasChanged) {
499
+ const cached = readCache();
500
+ if (cached !== void 0) {
501
+ await _optionalChain([onCacheHit, 'optionalCall', _7 => _7(cached)]);
502
+ return cached;
503
+ }
504
+ }
505
+ const value = await transform();
506
+ const normalized = isProcessResult(value) ? value : { result: value };
507
+ const stored = _nullishCoalesce(normalized.cacheValue, () => ( normalized.result));
508
+ cache.set(key, stored);
509
+ return normalized.result;
510
+ }
511
+ };
512
+ return cache;
513
+ }
514
+ function initializeCache(cacheConfig) {
515
+ if (typeof cacheConfig === "boolean" || cacheConfig === void 0) {
516
+ return createCache(cacheConfig);
517
+ }
518
+ return cacheConfig;
519
+ }
520
+
424
521
  // src/tailwindcss/targets.ts
522
+
523
+
524
+ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
525
+ var _process = require('process'); var _process2 = _interopRequireDefault(_process);
526
+
425
527
  var PATCH_INFO_FILENAME = "tailwindcss-target.json";
426
528
  var PATCH_INFO_CACHE_RELATIVE_PATH = _path2.default.join("node_modules", ".cache", "weapp-tailwindcss", PATCH_INFO_FILENAME);
427
529
  var PATCH_INFO_LEGACY_RELATIVE_PATH = _path2.default.join(".tw-patch", PATCH_INFO_FILENAME);
@@ -441,7 +543,7 @@ function formatRelativeToBase(targetPath, baseDir) {
441
543
  }
442
544
  function resolveRecordLocation(baseDir) {
443
545
  const normalizedBase = _path2.default.normalize(baseDir);
444
- const packageRoot = _nullishCoalesce(_chunkW7H4R6CPjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
546
+ const packageRoot = _nullishCoalesce(_chunkZADOXTZCjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
445
547
  const packageJsonPath = _path2.default.join(packageRoot, "package.json");
446
548
  const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
447
549
  const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
@@ -468,9 +570,9 @@ function getRecordFileCandidates(baseDir) {
468
570
  return [...candidates];
469
571
  }
470
572
  function logTailwindcssTarget(kind, patcher, baseDir) {
471
- const packageInfo = _optionalChain([patcher, 'optionalAccess', _6 => _6.packageInfo]);
573
+ const packageInfo = _optionalChain([patcher, 'optionalAccess', _8 => _8.packageInfo]);
472
574
  const label = kind === "cli" ? "weapp-tw patch" : "tailwindcss-patcher";
473
- if (!_optionalChain([packageInfo, 'optionalAccess', _7 => _7.rootPath])) {
575
+ if (!_optionalChain([packageInfo, 'optionalAccess', _9 => _9.rootPath])) {
474
576
  _logger.logger.warn(
475
577
  "%s \u672A\u627E\u5230 Tailwind CSS \u4F9D\u8D56\uFF0C\u8BF7\u68C0\u67E5\u5728 %s \u662F\u5426\u5DF2\u5B89\u88C5 tailwindcss",
476
578
  label,
@@ -525,22 +627,22 @@ function readPatchTargetRecord(baseDir) {
525
627
  return void 0;
526
628
  }
527
629
  async function saveCliPatchTargetRecord(baseDir, patcher, options) {
528
- if (!baseDir || !_optionalChain([patcher, 'optionalAccess', _8 => _8.packageInfo, 'optionalAccess', _9 => _9.rootPath])) {
630
+ if (!baseDir || !_optionalChain([patcher, 'optionalAccess', _10 => _10.packageInfo, 'optionalAccess', _11 => _11.rootPath])) {
529
631
  return void 0;
530
632
  }
531
633
  const normalizedBase = _path2.default.normalize(baseDir);
532
634
  const location = resolveRecordLocation(normalizedBase);
533
- const recordPath = _optionalChain([options, 'optionalAccess', _10 => _10.recordPath]) ? _path2.default.normalize(options.recordPath) : location.recordPath;
635
+ const recordPath = _optionalChain([options, 'optionalAccess', _12 => _12.recordPath]) ? _path2.default.normalize(options.recordPath) : location.recordPath;
534
636
  const record = {
535
637
  tailwindPackagePath: _path2.default.normalize(patcher.packageInfo.rootPath),
536
638
  packageVersion: patcher.packageInfo.version,
537
639
  recordedAt: (/* @__PURE__ */ new Date()).toISOString(),
538
- source: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _11 => _11.source]), () => ( "cli")),
640
+ source: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _13 => _13.source]), () => ( "cli")),
539
641
  tailwindcssBasedir: normalizedBase,
540
- cwd: _optionalChain([options, 'optionalAccess', _12 => _12.cwd]) ? _path2.default.normalize(options.cwd) : normalizedBase,
642
+ cwd: _optionalChain([options, 'optionalAccess', _14 => _14.cwd]) ? _path2.default.normalize(options.cwd) : normalizedBase,
541
643
  patchVersion: WEAPP_TW_VERSION,
542
- packageJsonPath: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _13 => _13.packageJsonPath]), () => ( location.packageJsonPath)),
543
- recordKey: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _14 => _14.recordKey]), () => ( location.recordKey))
644
+ packageJsonPath: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _15 => _15.packageJsonPath]), () => ( location.packageJsonPath)),
645
+ recordKey: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _16 => _16.recordKey]), () => ( location.recordKey))
544
646
  };
545
647
  try {
546
648
  await _promises.mkdir.call(void 0, _path2.default.dirname(recordPath), { recursive: true });
@@ -577,7 +679,7 @@ function findPatchTargetRecord(baseDir) {
577
679
  return void 0;
578
680
  }
579
681
  function createPatchTargetRecorder(baseDir, patcher, options) {
580
- if (!baseDir || !_optionalChain([patcher, 'optionalAccess', _15 => _15.packageInfo, 'optionalAccess', _16 => _16.rootPath]) || _optionalChain([options, 'optionalAccess', _17 => _17.recordTarget]) === false) {
682
+ if (!baseDir || !_optionalChain([patcher, 'optionalAccess', _17 => _17.packageInfo, 'optionalAccess', _18 => _18.rootPath]) || _optionalChain([options, 'optionalAccess', _19 => _19.recordTarget]) === false) {
581
683
  return void 0;
582
684
  }
583
685
  const normalizedBase = _path2.default.normalize(baseDir);
@@ -595,13 +697,13 @@ function createPatchTargetRecorder(baseDir, patcher, options) {
595
697
  reason = "migrate";
596
698
  } else if (!recorded.record.patchVersion || recorded.record.patchVersion !== WEAPP_TW_VERSION) {
597
699
  reason = "stale";
598
- } else if (_optionalChain([options, 'optionalAccess', _18 => _18.cwd]) && recorded.record.cwd && _path2.default.normalize(recorded.record.cwd) !== _path2.default.normalize(options.cwd)) {
700
+ } else if (_optionalChain([options, 'optionalAccess', _20 => _20.cwd]) && recorded.record.cwd && _path2.default.normalize(recorded.record.cwd) !== _path2.default.normalize(options.cwd)) {
599
701
  reason = "metadata";
600
- } else if (!recorded.record.cwd && _optionalChain([options, 'optionalAccess', _19 => _19.cwd])) {
702
+ } else if (!recorded.record.cwd && _optionalChain([options, 'optionalAccess', _21 => _21.cwd])) {
601
703
  reason = "metadata";
602
704
  }
603
705
  }
604
- const shouldPersist = _optionalChain([options, 'optionalAccess', _20 => _20.alwaysRecord]) || !recorded || Boolean(reason);
706
+ const shouldPersist = _optionalChain([options, 'optionalAccess', _22 => _22.alwaysRecord]) || !recorded || Boolean(reason);
605
707
  if (!shouldPersist) {
606
708
  return void 0;
607
709
  }
@@ -621,8 +723,8 @@ function createPatchTargetRecorder(baseDir, patcher, options) {
621
723
  break;
622
724
  }
623
725
  const onPatched = async () => saveCliPatchTargetRecord(normalizedBase, patcher, {
624
- cwd: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.cwd]), () => ( normalizedBase)),
625
- source: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _22 => _22.source]), () => ( "cli")),
726
+ cwd: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _23 => _23.cwd]), () => ( normalizedBase)),
727
+ source: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.source]), () => ( "cli")),
626
728
  recordPath: location.recordPath,
627
729
  recordKey: location.recordKey,
628
730
  packageJsonPath: location.packageJsonPath
@@ -635,108 +737,6 @@ function createPatchTargetRecorder(baseDir, patcher, options) {
635
737
  };
636
738
  }
637
739
 
638
- // src/context/index.ts
639
-
640
-
641
-
642
- // src/cache/index.ts
643
- var _lrucache = require('lru-cache');
644
- function isProcessResult(value) {
645
- return typeof value === "object" && value !== null && "result" in value;
646
- }
647
- function createCache(options) {
648
- const disabled = options === false;
649
- const hashMap = /* @__PURE__ */ new Map();
650
- const instance = new (0, _lrucache.LRUCache)({
651
- // 可能会添加和删除一些页面和组件, 先设定 1024 吧
652
- max: 1024,
653
- ttl: 0,
654
- ttlAutopurge: false
655
- });
656
- const cache = {
657
- hashMap,
658
- instance,
659
- hasHashKey(key) {
660
- return hashMap.has(key);
661
- },
662
- getHashValue(key) {
663
- return hashMap.get(key);
664
- },
665
- setHashValue(key, value) {
666
- return hashMap.set(key, value);
667
- },
668
- get(key) {
669
- return instance.get(key);
670
- },
671
- set(key, value) {
672
- return instance.set(key, value);
673
- },
674
- computeHash(message) {
675
- return _node.md5.call(void 0, message);
676
- },
677
- calcHashValueChanged(key, hash) {
678
- const hit = hashMap.get(key);
679
- if (hit) {
680
- hashMap.set(key, {
681
- changed: hash !== hit.hash,
682
- hash
683
- });
684
- } else {
685
- hashMap.set(key, {
686
- changed: true,
687
- hash
688
- });
689
- }
690
- return cache;
691
- },
692
- has(key) {
693
- return instance.has(key);
694
- },
695
- async process({
696
- key,
697
- hashKey,
698
- rawSource,
699
- hash,
700
- resolveCache,
701
- transform,
702
- onCacheHit
703
- }) {
704
- if (disabled) {
705
- const value2 = await transform();
706
- return isProcessResult(value2) ? value2.result : value2;
707
- }
708
- const cacheHashKey = _nullishCoalesce(hashKey, () => ( key));
709
- let hasChanged = true;
710
- if (hash != null || rawSource != null) {
711
- const nextHash = _nullishCoalesce(hash, () => ( cache.computeHash(rawSource)));
712
- cache.calcHashValueChanged(cacheHashKey, nextHash);
713
- const entry = cache.getHashValue(cacheHashKey);
714
- hasChanged = _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _23 => _23.changed]), () => ( true));
715
- }
716
- const readCache = _nullishCoalesce(resolveCache, () => ( (() => cache.get(key))));
717
- if (!hasChanged) {
718
- const cached = readCache();
719
- if (cached !== void 0) {
720
- await _optionalChain([onCacheHit, 'optionalCall', _24 => _24(cached)]);
721
- return cached;
722
- }
723
- }
724
- const value = await transform();
725
- const normalized = isProcessResult(value) ? value : { result: value };
726
- const stored = _nullishCoalesce(normalized.cacheValue, () => ( normalized.result));
727
- cache.set(key, stored);
728
- return normalized.result;
729
- }
730
- };
731
- return cache;
732
- }
733
- function initializeCache(cacheConfig) {
734
- if (typeof cacheConfig === "boolean" || cacheConfig === void 0) {
735
- return createCache(cacheConfig);
736
- }
737
- return cacheConfig;
738
- }
739
-
740
740
  // src/context/compiler-context-cache.ts
741
741
  var _buffer = require('buffer');
742
742
 
@@ -2771,15 +2771,15 @@ function createInternalCompilerContext(opts) {
2771
2771
  );
2772
2772
  ctx.escapeMap = ctx.customReplaceDictionary;
2773
2773
  applyLoggerLevel(ctx.logLevel);
2774
- const twPatcher = _chunkW7H4R6CPjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2774
+ const twPatcher = _chunkZADOXTZCjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2775
2775
  logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
2776
2776
  if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
2777
2777
  _logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(twPatcher.packageInfo.version)))}`);
2778
2778
  } else {
2779
2779
  _logger.logger.warn(`${_logger.pc.cyanBright("Tailwind CSS")} \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u7248\u672C\u68C0\u6D4B\u4E0E\u8865\u4E01\u5E94\u7528\u3002`);
2780
2780
  }
2781
- _chunkW7H4R6CPjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
2782
- const cssCalcOptions = _chunkW7H4R6CPjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
2781
+ _chunkZADOXTZCjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
2782
+ const cssCalcOptions = _chunkZADOXTZCjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
2783
2783
  ctx.cssCalc = cssCalcOptions;
2784
2784
  const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
2785
2785
  const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
@@ -2798,7 +2798,7 @@ function createInternalCompilerContext(opts) {
2798
2798
  await clearTailwindcssPatcherCache(previousPatcher);
2799
2799
  }
2800
2800
  invalidateRuntimeClassSet(previousPatcher);
2801
- const nextPatcher = _chunkW7H4R6CPjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2801
+ const nextPatcher = _chunkZADOXTZCjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2802
2802
  Object.assign(previousPatcher, nextPatcher);
2803
2803
  ctx.twPatcher = previousPatcher;
2804
2804
  return previousPatcher;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkCFFV3OIPjs = require('./chunk-CFFV3OIP.js');
3
+ var _chunkA5JYBYB2js = require('./chunk-A5JYBYB2.js');
4
4
 
5
5
  // src/bundlers/shared/module-graph.ts
6
6
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
@@ -60,7 +60,7 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
60
60
  // src/utils/resolve-package.ts
61
61
  var _module = require('module'); var _module2 = _interopRequireDefault(_module);
62
62
 
63
- var require2 = _module.createRequire.call(void 0, _chunkCFFV3OIPjs.importMetaUrl);
63
+ var require2 = _module.createRequire.call(void 0, _chunkA5JYBYB2js.importMetaUrl);
64
64
  function resolvePackageDir(name) {
65
65
  const pkgPath = require2.resolve(`${name}/package.json`);
66
66
  return _path2.default.dirname(pkgPath);
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-RRHPTTCP.mjs";
12
12
  import {
13
13
  setupPatchRecorder
14
- } from "./chunk-OBOKBKZQ.mjs";
14
+ } from "./chunk-XSRP6OF5.mjs";
15
15
  import {
16
16
  collectRuntimeClassSet,
17
17
  createAttributeMatcher,
@@ -22,7 +22,7 @@ import {
22
22
  replaceWxml,
23
23
  toCustomAttributesEntities,
24
24
  vitePluginName
25
- } from "./chunk-JCG2LT63.mjs";
25
+ } from "./chunk-K2Y3FXU7.mjs";
26
26
  import {
27
27
  getGroupedEntries
28
28
  } from "./chunk-ZNKIYZRQ.mjs";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-HXYNNE6Q.mjs";
5
5
  import {
6
6
  pluginName
7
- } from "./chunk-JCG2LT63.mjs";
7
+ } from "./chunk-K2Y3FXU7.mjs";
8
8
 
9
9
  // src/bundlers/webpack/shared/css-imports.ts
10
10
  var CSS_EXT_RE = /\.(?:css|scss|sass|less|styl|pcss)$/i;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.2__@swc+core@1.15.3_@swc+h_b5f09ec5c50315727a8dc02bf80354c5/node_modules/tsup/assets/cjs_shims.js
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.3__@swc+core@1.15.3_@swc+h_c395c5c1ebaf3130b03087671664b901/node_modules/tsup/assets/cjs_shims.js
2
2
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
3
3
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
4
4
 
@@ -3,13 +3,13 @@
3
3
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
4
4
 
5
5
 
6
- var _chunkXP5623NLjs = require('./chunk-XP5623NL.js');
6
+ var _chunkWIET7TXZjs = require('./chunk-WIET7TXZ.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.js');
12
+ var _chunk243FNJFQjs = require('./chunk-243FNJFQ.js');
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  var _buffer = require('buffer');
@@ -17,12 +17,12 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
17
17
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
18
18
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
19
19
  var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
20
- var debug = _chunkMNZW5VG5js.createDebug.call(void 0, );
20
+ var debug = _chunk243FNJFQjs.createDebug.call(void 0, );
21
21
  var Transform = _stream2.default.Transform;
22
22
  function createPlugins(options = {}) {
23
- const opts = _chunkMNZW5VG5js.getCompilerContext.call(void 0, options);
23
+ const opts = _chunk243FNJFQjs.getCompilerContext.call(void 0, options);
24
24
  const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
25
- const patchRecorderState = _chunkXP5623NLjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
25
+ const patchRecorderState = _chunkWIET7TXZjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
26
26
  source: "runtime",
27
27
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
28
28
  });
@@ -36,7 +36,7 @@ function createPlugins(options = {}) {
36
36
  const MODULE_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"];
37
37
  let runtimeSetInitialized = false;
38
38
  async function refreshRuntimeState(force) {
39
- await _chunkMNZW5VG5js.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
39
+ await _chunk243FNJFQjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
40
40
  }
41
41
  async function refreshRuntimeSet(force = false) {
42
42
  await refreshRuntimeState(force);
@@ -44,7 +44,7 @@ function createPlugins(options = {}) {
44
44
  if (!force && runtimeSetInitialized && runtimeSet.size > 0) {
45
45
  return runtimeSet;
46
46
  }
47
- runtimeSet = await _chunkMNZW5VG5js.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
47
+ runtimeSet = await _chunk243FNJFQjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
48
48
  runtimeSetInitialized = true;
49
49
  return runtimeSet;
50
50
  }
@@ -4,7 +4,7 @@ import {
4
4
  getCacheKey,
5
5
  hasLoaderEntry,
6
6
  isCssLikeModuleResource
7
- } from "./chunk-XXO2FHP7.mjs";
7
+ } from "./chunk-6LYLDH5F.mjs";
8
8
  import {
9
9
  ensureMpxTailwindcssAliases,
10
10
  injectMpxCssRewritePreRules,
@@ -21,20 +21,20 @@ import {
21
21
  } from "./chunk-RRHPTTCP.mjs";
22
22
  import {
23
23
  setupPatchRecorder
24
- } from "./chunk-OBOKBKZQ.mjs";
24
+ } from "./chunk-XSRP6OF5.mjs";
25
25
  import {
26
26
  collectRuntimeClassSet,
27
27
  createDebug,
28
28
  getCompilerContext,
29
29
  pluginName,
30
30
  refreshTailwindRuntimeState
31
- } from "./chunk-JCG2LT63.mjs";
31
+ } from "./chunk-K2Y3FXU7.mjs";
32
32
  import {
33
33
  getGroupedEntries
34
34
  } from "./chunk-ZNKIYZRQ.mjs";
35
35
  import {
36
36
  __dirname
37
- } from "./chunk-SXBK4NF4.mjs";
37
+ } from "./chunk-MDZGOZZP.mjs";
38
38
 
39
39
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
40
40
  import fs from "fs";
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkYXT3T3LHjs = require('./chunk-YXT3T3LH.js');
4
+ var _chunk3DQN7M5Ujs = require('./chunk-3DQN7M5U.js');
5
5
 
6
6
 
7
- var _chunkMNZW5VG5js = require('./chunk-MNZW5VG5.js');
7
+ var _chunk243FNJFQjs = require('./chunk-243FNJFQ.js');
8
8
 
9
9
  // src/bundlers/webpack/shared/css-imports.ts
10
10
  var CSS_EXT_RE = /\.(?:css|scss|sass|less|styl|pcss)$/i;
@@ -34,7 +34,7 @@ function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
34
34
  if (!CSS_EXT_RE.test(normalizedIssuer)) {
35
35
  return;
36
36
  }
37
- const resolved = _chunkYXT3T3LHjs.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
37
+ const resolved = _chunk3DQN7M5Ujs.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
38
38
  if (!resolved) {
39
39
  return;
40
40
  }
@@ -44,8 +44,8 @@ function applyTailwindcssCssImportRewrite(compiler, options) {
44
44
  if (!options.enabled) {
45
45
  return;
46
46
  }
47
- compiler.hooks.normalModuleFactory.tap(_chunkMNZW5VG5js.pluginName, (factory) => {
48
- factory.hooks.beforeResolve.tap(_chunkMNZW5VG5js.pluginName, (data) => {
47
+ compiler.hooks.normalModuleFactory.tap(_chunk243FNJFQjs.pluginName, (factory) => {
48
+ factory.hooks.beforeResolve.tap(_chunk243FNJFQjs.pluginName, (data) => {
49
49
  rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
50
50
  });
51
51
  });
@@ -75,7 +75,7 @@ function createPrioritizedFinder(targets) {
75
75
  };
76
76
  }
77
77
  function createLoaderAnchorFinders(appType) {
78
- if (_chunkYXT3T3LHjs.isMpx.call(void 0, appType)) {
78
+ if (_chunk3DQN7M5Ujs.isMpx.call(void 0, appType)) {
79
79
  return {
80
80
  findRewriteAnchor: createPrioritizedFinder(MPX_REWRITE_PRECEDENCE_LOADERS),
81
81
  findClassSetAnchor: createFinder([MPX_STYLE_COMPILER_LOADER])
@@ -445,7 +445,7 @@ function createTailwindcssPatcher(options) {
445
445
  }
446
446
  const resolvePaths = createDefaultResolvePaths(cache.cwd ?? normalizedBasedir ?? process.cwd());
447
447
  const normalizedUserOptions = normalizeTailwindcssPatcherOptions(tailwindcssPatcherOptions);
448
- const extendLengthUnits = normalizeExtendLengthUnits(supportCustomLengthUnitsPatch);
448
+ const extendLengthUnits = normalizeExtendLengthUnits(supportCustomLengthUnitsPatch ?? true);
449
449
  const baseTailwindOptions = defuOverrideArray2(
450
450
  tailwindcss ?? {},
451
451
  {
@@ -730,12 +730,34 @@ function createPatcherForBase(baseDir, cssEntries, options) {
730
730
  baseDir,
731
731
  cssEntries ?? []
732
732
  );
733
- return createTailwindcssPatcher({
734
- basedir: baseDir,
735
- supportCustomLengthUnitsPatch: supportCustomLengthUnitsPatch ?? true,
736
- tailwindcss: mergedTailwindOptions,
737
- tailwindcssPatcherOptions: patchedOptions
733
+ const configuredPackageName = tailwindcss?.packageName || tailwindcssPatcherOptions?.tailwind?.packageName || tailwindcssPatcherOptions?.patch?.tailwindcss?.packageName;
734
+ const configuredVersion = tailwindcss?.version || tailwindcssPatcherOptions?.tailwind?.version || tailwindcssPatcherOptions?.patch?.tailwindcss?.version || mergedTailwindOptions.version;
735
+ const isTailwindcss4Package = (packageName) => Boolean(
736
+ packageName && (packageName === "tailwindcss4" || packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4"))
737
+ );
738
+ const isV4 = configuredVersion === 4 || mergedTailwindOptions.version === 4 || isTailwindcss4Package(configuredPackageName ?? mergedTailwindOptions.packageName);
739
+ const tailwindPackageConfigured = Boolean(configuredPackageName);
740
+ const shouldPatchV4PostcssPackage = isV4 && !tailwindPackageConfigured;
741
+ const packageCandidates = /* @__PURE__ */ new Set();
742
+ if (shouldPatchV4PostcssPackage) {
743
+ packageCandidates.add("@tailwindcss/postcss");
744
+ }
745
+ packageCandidates.add(
746
+ mergedTailwindOptions.packageName ?? configuredPackageName ?? "tailwindcss"
747
+ );
748
+ const patchers = Array.from(packageCandidates).map((packageName) => {
749
+ const tailwindOptionsForPackage = {
750
+ ...mergedTailwindOptions,
751
+ packageName
752
+ };
753
+ return createTailwindcssPatcher({
754
+ basedir: baseDir,
755
+ supportCustomLengthUnitsPatch: supportCustomLengthUnitsPatch ?? true,
756
+ tailwindcss: tailwindOptionsForPackage,
757
+ tailwindcssPatcherOptions: patchedOptions
758
+ });
738
759
  });
760
+ return patchers.length === 1 ? patchers[0] : createMultiTailwindcssPatcher(patchers);
739
761
  }
740
762
  function createMultiTailwindcssPatcher(patchers) {
741
763
  if (patchers.length <= 1) {
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-RRHPTTCP.mjs";
4
4
  import {
5
5
  setupPatchRecorder
6
- } from "./chunk-OBOKBKZQ.mjs";
6
+ } from "./chunk-XSRP6OF5.mjs";
7
7
  import {
8
8
  collectRuntimeClassSet,
9
9
  createDebug,
10
10
  getCompilerContext,
11
11
  refreshTailwindRuntimeState
12
- } from "./chunk-JCG2LT63.mjs";
12
+ } from "./chunk-K2Y3FXU7.mjs";
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  import { Buffer } from "buffer";