weapp-tailwindcss 4.8.11 → 4.8.13
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-FM3FLOYY.js → chunk-3S6VRBOM.js} +5 -5
- package/dist/{chunk-HHSKDU3Z.mjs → chunk-3VIPMWAG.mjs} +22 -24
- package/dist/{chunk-LAVN5SDT.mjs → chunk-4E2U7YIQ.mjs} +2 -2
- package/dist/{chunk-3NLDVPXD.mjs → chunk-7MREZHFO.mjs} +2 -2
- package/dist/{chunk-6LNKARWD.js → chunk-B7643BFR.js} +28 -28
- package/dist/{chunk-22ETJBBT.js → chunk-BLTNVVBH.js} +127 -127
- package/dist/{chunk-FGNKGESE.mjs → chunk-CSDB62E5.mjs} +4 -4
- package/dist/{chunk-2SG4SGMQ.js → chunk-G4UFQ3CK.js} +7 -7
- package/dist/{chunk-45BMEACS.js → chunk-J4MI4EJO.js} +16 -18
- package/dist/{chunk-TWF4BQKE.mjs → chunk-JSV4IYLL.mjs} +2 -2
- package/dist/{chunk-CFFV3OIP.js → chunk-MB4BR57E.js} +1 -1
- package/dist/{chunk-W6ASDRWZ.mjs → chunk-OPA2EYQV.mjs} +1 -1
- package/dist/{chunk-SXBK4NF4.mjs → chunk-SM5V25IN.mjs} +1 -1
- package/dist/{chunk-DLSEDDLQ.js → chunk-U6O2TOS7.js} +22 -22
- package/dist/{chunk-BSGZZCLH.mjs → chunk-WHELJMZL.mjs} +109 -109
- package/dist/{chunk-FAKEMDGU.js → chunk-XX7SUSE7.js} +6 -6
- package/dist/{chunk-YXT3T3LH.js → chunk-Z6E242OH.js} +2 -2
- package/dist/cli.js +240 -168
- package/dist/cli.mjs +217 -145
- package/dist/core.js +10 -10
- package/dist/core.mjs +4 -4
- 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.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/index.js +10 -10
- package/dist/index.mjs +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.d.mts +14 -10
- package/dist/presets.d.ts +14 -10
- package/dist/presets.js +68 -64
- package/dist/presets.mjs +69 -65
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +5 -5
- package/dist/webpack.js +8 -8
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.js +31 -31
- package/dist/webpack4.mjs +5 -5
- package/package.json +5 -5
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkJ4MI4EJOjs = require('./chunk-J4MI4EJO.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.
|
|
190
|
+
version: "4.8.13",
|
|
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/
|
|
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(
|
|
546
|
+
const packageRoot = _nullishCoalesce(_chunkJ4MI4EJOjs.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',
|
|
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',
|
|
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',
|
|
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',
|
|
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',
|
|
640
|
+
source: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _13 => _13.source]), () => ( "cli")),
|
|
539
641
|
tailwindcssBasedir: normalizedBase,
|
|
540
|
-
cwd: _optionalChain([options, 'optionalAccess',
|
|
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',
|
|
543
|
-
recordKey: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
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',
|
|
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',
|
|
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',
|
|
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',
|
|
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',
|
|
625
|
-
source: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
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 =
|
|
2774
|
+
const twPatcher = _chunkJ4MI4EJOjs.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
|
-
|
|
2782
|
-
const cssCalcOptions =
|
|
2781
|
+
_chunkJ4MI4EJOjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2782
|
+
const cssCalcOptions = _chunkJ4MI4EJOjs.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 =
|
|
2801
|
+
const nextPatcher = _chunkJ4MI4EJOjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2802
2802
|
Object.assign(previousPatcher, nextPatcher);
|
|
2803
2803
|
ctx.twPatcher = previousPatcher;
|
|
2804
2804
|
return previousPatcher;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getCacheKey,
|
|
5
5
|
hasLoaderEntry,
|
|
6
6
|
isCssLikeModuleResource
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OPA2EYQV.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-
|
|
24
|
+
} from "./chunk-7MREZHFO.mjs";
|
|
25
25
|
import {
|
|
26
26
|
collectRuntimeClassSet,
|
|
27
27
|
createDebug,
|
|
28
28
|
getCompilerContext,
|
|
29
29
|
pluginName,
|
|
30
30
|
refreshTailwindRuntimeState
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WHELJMZL.mjs";
|
|
32
32
|
import {
|
|
33
33
|
getGroupedEntries
|
|
34
34
|
} from "./chunk-ZNKIYZRQ.mjs";
|
|
35
35
|
import {
|
|
36
36
|
__dirname
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SM5V25IN.mjs";
|
|
38
38
|
|
|
39
39
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
40
40
|
import fs from "fs";
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk3S6VRBOMjs = require('./chunk-3S6VRBOM.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkBLTNVVBHjs = require('./chunk-BLTNVVBH.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 =
|
|
20
|
+
var debug = _chunkBLTNVVBHjs.createDebug.call(void 0, );
|
|
21
21
|
var Transform = _stream2.default.Transform;
|
|
22
22
|
function createPlugins(options = {}) {
|
|
23
|
-
const opts =
|
|
23
|
+
const opts = _chunkBLTNVVBHjs.getCompilerContext.call(void 0, options);
|
|
24
24
|
const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
|
|
25
|
-
const patchRecorderState =
|
|
25
|
+
const patchRecorderState = _chunk3S6VRBOMjs.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
|
|
39
|
+
await _chunkBLTNVVBHjs.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
|
|
47
|
+
runtimeSet = await _chunkBLTNVVBHjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force, skipRefresh: force });
|
|
48
48
|
runtimeSetInitialized = true;
|
|
49
49
|
return runtimeSet;
|
|
50
50
|
}
|
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkMB4BR57Ejs = require('./chunk-MB4BR57E.js');
|
|
7
7
|
|
|
8
|
-
// src/
|
|
9
|
-
var _fs = require('fs');
|
|
10
|
-
var _module = require('module');
|
|
11
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
12
|
-
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
13
|
-
var _url = require('url');
|
|
8
|
+
// src/logger/index.ts
|
|
14
9
|
var _logger = require('@weapp-tailwindcss/logger');
|
|
15
10
|
|
|
16
11
|
// src/context/workspace.ts
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
var _fs = require('fs');
|
|
13
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
19
14
|
var IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
20
15
|
"node_modules",
|
|
21
16
|
".git",
|
|
@@ -210,10 +205,10 @@ function applyV4CssCalcDefaults(cssCalc, patcher) {
|
|
|
210
205
|
|
|
211
206
|
// src/tailwindcss/patcher.ts
|
|
212
207
|
|
|
208
|
+
var _module = require('module');
|
|
213
209
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
210
|
+
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
211
|
+
var _url = require('url');
|
|
217
212
|
|
|
218
213
|
var _shared = require('@weapp-tailwindcss/shared');
|
|
219
214
|
var _tailwindcsspatch = require('tailwindcss-patch');
|
|
@@ -239,7 +234,7 @@ function resolveModuleFromPaths(specifier, paths) {
|
|
|
239
234
|
return void 0;
|
|
240
235
|
}
|
|
241
236
|
try {
|
|
242
|
-
const req = _module.createRequire.call(void 0,
|
|
237
|
+
const req = _module.createRequire.call(void 0, _chunkMB4BR57Ejs.importMetaUrl);
|
|
243
238
|
return req.resolve(specifier, { paths });
|
|
244
239
|
} catch (e3) {
|
|
245
240
|
return void 0;
|
|
@@ -339,11 +334,11 @@ function createDefaultResolvePaths(basedir) {
|
|
|
339
334
|
const cwd = _process2.default.cwd();
|
|
340
335
|
appendNodeModules(paths, cwd);
|
|
341
336
|
try {
|
|
342
|
-
const modulePath = _url.fileURLToPath.call(void 0,
|
|
337
|
+
const modulePath = _url.fileURLToPath.call(void 0, _chunkMB4BR57Ejs.importMetaUrl);
|
|
343
338
|
const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
|
|
344
339
|
paths.add(candidate);
|
|
345
340
|
} catch (e4) {
|
|
346
|
-
paths.add(
|
|
341
|
+
paths.add(_chunkMB4BR57Ejs.importMetaUrl);
|
|
347
342
|
}
|
|
348
343
|
if (paths.size === 0) {
|
|
349
344
|
fallbackCandidates = fallbackCandidates.filter(Boolean);
|
|
@@ -861,6 +856,12 @@ function tryCreateMultiTailwindcssPatcher(groups, options) {
|
|
|
861
856
|
}
|
|
862
857
|
|
|
863
858
|
// src/context/tailwindcss.ts
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
864
865
|
var ENV_BASEDIR_KEYS = [
|
|
865
866
|
"WEAPP_TAILWINDCSS_BASEDIR",
|
|
866
867
|
"WEAPP_TAILWINDCSS_BASE_DIR",
|
|
@@ -1117,9 +1118,6 @@ function createTailwindcssPatcherFromContext(ctx) {
|
|
|
1117
1118
|
);
|
|
1118
1119
|
}
|
|
1119
1120
|
|
|
1120
|
-
// src/logger/index.ts
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
1121
|
|
|
1124
1122
|
|
|
1125
1123
|
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-RRHPTTCP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
setupPatchRecorder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7MREZHFO.mjs";
|
|
7
7
|
import {
|
|
8
8
|
collectRuntimeClassSet,
|
|
9
9
|
createDebug,
|
|
10
10
|
getCompilerContext,
|
|
11
11
|
refreshTailwindRuntimeState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WHELJMZL.mjs";
|
|
13
13
|
|
|
14
14
|
// src/bundlers/gulp/index.ts
|
|
15
15
|
import { Buffer } from "buffer";
|
|
@@ -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.
|
|
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.4__@swc+core@1.15.7_@swc+h_167688d692077c8a2d82cc2e420b5ebb/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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.4__@swc+core@1.15.7_@swc+h_167688d692077c8a2d82cc2e420b5ebb/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);
|