weapp-tailwindcss 4.8.6 → 4.8.8
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-2E724WCE.js +138 -0
- package/dist/{chunk-YUMLYTPN.js → chunk-2KZ4VTIA.js} +19 -117
- package/dist/{chunk-67CD2S5L.mjs → chunk-3IP5JCFZ.mjs} +1 -1
- package/dist/{chunk-ZSTF2AEN.js → chunk-3URI7W6X.js} +11 -1
- package/dist/{chunk-3XGTIDA6.mjs → chunk-6TO3GT5S.mjs} +476 -190
- package/dist/chunk-BYXBJQAS.js +1 -0
- package/dist/{chunk-UUHV4D5B.js → chunk-E7PFK6BW.js} +122 -43
- package/dist/{chunk-OPM3REFF.mjs → chunk-FB3ASCHC.mjs} +2 -2
- package/dist/{chunk-AUKQJILC.mjs → chunk-IH3HQU7U.mjs} +191 -127
- package/dist/{chunk-M4KLNEHT.js → chunk-L5ER4544.js} +5 -5
- package/dist/{chunk-UTZLVU3M.js → chunk-M4NERJO7.js} +1 -1
- package/dist/{chunk-SR4OOLTF.mjs → chunk-M5UEOYBI.mjs} +2 -2
- package/dist/{chunk-RJRLVYVJ.js → chunk-P3AQCOOM.js} +471 -185
- package/dist/chunk-PVJDRL3I.mjs +138 -0
- package/dist/{chunk-DKPIYG24.mjs → chunk-QF65JGNW.mjs} +11 -1
- package/dist/{chunk-B2IA5GC7.mjs → chunk-RUXC4E2M.mjs} +8 -106
- package/dist/{chunk-JW7P34IH.mjs → chunk-RYGPCUUT.mjs} +65 -58
- package/dist/{chunk-KWRRSLTH.mjs → chunk-UTCO4JMJ.mjs} +104 -25
- package/dist/{chunk-BWKCXQQH.js → chunk-WF4UE272.js} +211 -147
- package/dist/{chunk-AB45L5FP.js → chunk-XHR5K5ZT.js} +57 -51
- package/dist/{chunk-PMCA6PRQ.js → chunk-Y5XG47XY.js} +7 -7
- package/dist/cli.js +39 -32
- package/dist/cli.mjs +12 -5
- package/dist/core.js +11 -11
- package/dist/core.mjs +5 -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.js +3 -3
- package/dist/defaults.mjs +2 -2
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +6 -6
- package/dist/index.js +11 -11
- package/dist/index.mjs +10 -10
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +4 -4
- package/dist/presets.mjs +2 -2
- package/dist/reset.js +1 -1
- package/dist/reset.mjs +1 -1
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +8 -8
- package/dist/vite.mjs +7 -7
- package/dist/{weapp-tw-runtime-loader.js → weapp-tw-css-import-rewrite-loader.js} +52 -15
- package/dist/weapp-tw-runtime-classset-loader.js +23 -0
- package/dist/webpack.d.mts +0 -1
- package/dist/webpack.d.ts +0 -1
- package/dist/webpack.js +9 -9
- package/dist/webpack.mjs +8 -8
- package/dist/webpack4.d.mts +0 -1
- package/dist/webpack4.d.ts +0 -1
- package/dist/webpack4.js +126 -44
- package/dist/webpack4.mjs +108 -26
- package/package.json +6 -6
- package/dist/chunk-EK7ECLBW.js +0 -61
- package/dist/chunk-NQS4LYVY.mjs +0 -61
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
|
|
3
|
+
var _chunkXHR5K5ZTjs = require('./chunk-XHR5K5ZT.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk2KZ4VTIAjs = require('./chunk-2KZ4VTIA.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkP3AQCOOMjs = require('./chunk-P3AQCOOM.js');
|
|
10
|
+
|
|
11
|
+
// src/bundlers/webpack/shared/css-imports.ts
|
|
12
|
+
var CSS_EXT_RE = /\.(?:css|scss|sass|less|styl|pcss)$/i;
|
|
13
|
+
function stripResourceQuery(file) {
|
|
14
|
+
let idx = file.indexOf("?");
|
|
15
|
+
if (idx === -1) {
|
|
16
|
+
idx = file.indexOf("&");
|
|
17
|
+
}
|
|
18
|
+
return idx === -1 ? file : file.slice(0, idx);
|
|
19
|
+
}
|
|
20
|
+
function rewriteTailwindcssRequestForCss(data, pkgDir, appType) {
|
|
21
|
+
if (!data) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const request = data.request;
|
|
25
|
+
if (!request) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (request !== "tailwindcss" && request !== "tailwindcss$" && !request.startsWith("tailwindcss/")) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const issuer = _optionalChain([data, 'access', _ => _.contextInfo, 'optionalAccess', _2 => _2.issuer]);
|
|
32
|
+
if (!issuer) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const normalizedIssuer = stripResourceQuery(issuer);
|
|
36
|
+
if (!CSS_EXT_RE.test(normalizedIssuer)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const resolved = _chunkXHR5K5ZTjs.resolveTailwindcssImport.call(void 0, request, pkgDir, { appType });
|
|
40
|
+
if (!resolved) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
data.request = resolved;
|
|
44
|
+
}
|
|
45
|
+
function applyTailwindcssCssImportRewrite(compiler, options) {
|
|
46
|
+
if (!options.enabled) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
compiler.hooks.normalModuleFactory.tap(_chunk2KZ4VTIAjs.pluginName, (factory) => {
|
|
50
|
+
factory.hooks.beforeResolve.tap(_chunk2KZ4VTIAjs.pluginName, (data) => {
|
|
51
|
+
rewriteTailwindcssRequestForCss(data, options.pkgDir, options.appType);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/bundlers/webpack/shared/loader-anchors.ts
|
|
57
|
+
var MPX_STRIP_CONDITIONAL_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/strip-conditional-loader";
|
|
58
|
+
var MPX_STYLE_COMPILER_LOADER = "@mpxjs/webpack-plugin/lib/style-compiler/index";
|
|
59
|
+
var MPX_REWRITE_PRECEDENCE_LOADERS = [
|
|
60
|
+
MPX_STYLE_COMPILER_LOADER,
|
|
61
|
+
MPX_STRIP_CONDITIONAL_LOADER
|
|
62
|
+
];
|
|
63
|
+
function createFinder(targets) {
|
|
64
|
+
return (entries) => entries.findIndex(
|
|
65
|
+
(entry) => targets.some((target) => _optionalChain([entry, 'optionalAccess', _3 => _3.loader, 'optionalAccess', _4 => _4.includes, 'optionalCall', _5 => _5(target)]))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function createPrioritizedFinder(targets) {
|
|
69
|
+
return (entries) => {
|
|
70
|
+
for (const target of targets) {
|
|
71
|
+
const idx = entries.findIndex((entry) => _optionalChain([entry, 'optionalAccess', _6 => _6.loader, 'optionalAccess', _7 => _7.includes, 'optionalCall', _8 => _8(target)]));
|
|
72
|
+
if (idx !== -1) {
|
|
73
|
+
return idx;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return -1;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function createLoaderAnchorFinders(appType) {
|
|
80
|
+
if (_chunkP3AQCOOMjs.isMpx.call(void 0, appType)) {
|
|
81
|
+
return {
|
|
82
|
+
findRewriteAnchor: createPrioritizedFinder(MPX_REWRITE_PRECEDENCE_LOADERS),
|
|
83
|
+
findClassSetAnchor: createFinder([MPX_STYLE_COMPILER_LOADER])
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const fallbackFinder = createFinder(["postcss-loader"]);
|
|
87
|
+
return {
|
|
88
|
+
findRewriteAnchor: fallbackFinder,
|
|
89
|
+
findClassSetAnchor: fallbackFinder
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// src/bundlers/webpack/BaseUnifiedPlugin/shared.ts
|
|
94
|
+
var MPX_STYLE_RESOURCE_QUERY_RE = /(?:\?|&)type=styles\b/;
|
|
95
|
+
function getCacheKey(filename) {
|
|
96
|
+
return filename;
|
|
97
|
+
}
|
|
98
|
+
function stripResourceQuery2(resource) {
|
|
99
|
+
if (typeof resource !== "string") {
|
|
100
|
+
return resource;
|
|
101
|
+
}
|
|
102
|
+
const queryIndex = resource.indexOf("?");
|
|
103
|
+
if (queryIndex !== -1) {
|
|
104
|
+
return resource.slice(0, queryIndex);
|
|
105
|
+
}
|
|
106
|
+
const hashIndex = resource.indexOf("#");
|
|
107
|
+
if (hashIndex !== -1) {
|
|
108
|
+
return resource.slice(0, hashIndex);
|
|
109
|
+
}
|
|
110
|
+
return resource;
|
|
111
|
+
}
|
|
112
|
+
function isCssLikeModuleResource(resource, cssMatcher, appType) {
|
|
113
|
+
if (typeof resource !== "string") {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
const normalizedResource = stripResourceQuery2(resource);
|
|
117
|
+
if (normalizedResource && cssMatcher(normalizedResource)) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
if (appType === "mpx") {
|
|
121
|
+
return MPX_STYLE_RESOURCE_QUERY_RE.test(resource);
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
function hasLoaderEntry(entries, target) {
|
|
126
|
+
if (!target) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
return entries.some((entry) => _optionalChain([entry, 'access', _9 => _9.loader, 'optionalAccess', _10 => _10.includes, 'optionalCall', _11 => _11(target)]));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
exports.applyTailwindcssCssImportRewrite = applyTailwindcssCssImportRewrite; exports.createLoaderAnchorFinders = createLoaderAnchorFinders; exports.getCacheKey = getCacheKey; exports.isCssLikeModuleResource = isCssLikeModuleResource; exports.hasLoaderEntry = hasLoaderEntry;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
3
|
|
|
4
|
-
var _chunkRJRLVYVJjs = require('./chunk-RJRLVYVJ.js');
|
|
5
4
|
|
|
6
5
|
|
|
7
|
-
var
|
|
6
|
+
var _chunkP3AQCOOMjs = require('./chunk-P3AQCOOM.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunk3URI7W6Xjs = require('./chunk-3URI7W6X.js');
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
|
|
@@ -181,7 +183,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
|
|
|
181
183
|
// package.json
|
|
182
184
|
var package_default = {
|
|
183
185
|
name: "weapp-tailwindcss",
|
|
184
|
-
version: "4.8.
|
|
186
|
+
version: "4.8.8",
|
|
185
187
|
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!",
|
|
186
188
|
author: "ice breaker <1324318532@qq.com>",
|
|
187
189
|
license: "MIT",
|
|
@@ -389,7 +391,7 @@ var package_default = {
|
|
|
389
391
|
semver: "~7.7.3",
|
|
390
392
|
"tailwindcss-patch": "catalog:tailwindcssPatch",
|
|
391
393
|
"webpack-sources": "3.3.3",
|
|
392
|
-
yaml: "^2.8.
|
|
394
|
+
yaml: "^2.8.2"
|
|
393
395
|
}
|
|
394
396
|
};
|
|
395
397
|
|
|
@@ -434,7 +436,7 @@ function formatRelativeToBase(targetPath, baseDir) {
|
|
|
434
436
|
}
|
|
435
437
|
function resolveRecordLocation(baseDir) {
|
|
436
438
|
const normalizedBase = _path2.default.normalize(baseDir);
|
|
437
|
-
const packageRoot = _nullishCoalesce(
|
|
439
|
+
const packageRoot = _nullishCoalesce(_chunkP3AQCOOMjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
|
|
438
440
|
const packageJsonPath = _path2.default.join(packageRoot, "package.json");
|
|
439
441
|
const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
|
|
440
442
|
const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
|
|
@@ -2721,121 +2723,24 @@ function applyLoggerLevel(logLevel) {
|
|
|
2721
2723
|
}
|
|
2722
2724
|
|
|
2723
2725
|
// src/context/index.ts
|
|
2724
|
-
var DEFAULT_CSS_CALC_CUSTOM_PROPERTIES = [];
|
|
2725
|
-
function includesToken(list, token) {
|
|
2726
|
-
return list.some((candidate) => {
|
|
2727
|
-
if (typeof token === "string") {
|
|
2728
|
-
if (typeof candidate === "string") {
|
|
2729
|
-
return candidate === token;
|
|
2730
|
-
}
|
|
2731
|
-
candidate.lastIndex = 0;
|
|
2732
|
-
return candidate.test(token);
|
|
2733
|
-
}
|
|
2734
|
-
if (typeof candidate === "string") {
|
|
2735
|
-
token.lastIndex = 0;
|
|
2736
|
-
return token.test(candidate);
|
|
2737
|
-
}
|
|
2738
|
-
return candidate.source === token.source && candidate.flags === token.flags;
|
|
2739
|
-
});
|
|
2740
|
-
}
|
|
2741
|
-
function ensureDefaultsIncluded(value) {
|
|
2742
|
-
if (value === true) {
|
|
2743
|
-
return {
|
|
2744
|
-
includeCustomProperties: [...DEFAULT_CSS_CALC_CUSTOM_PROPERTIES]
|
|
2745
|
-
};
|
|
2746
|
-
}
|
|
2747
|
-
if (Array.isArray(value)) {
|
|
2748
|
-
if (!DEFAULT_CSS_CALC_CUSTOM_PROPERTIES.length) {
|
|
2749
|
-
return value;
|
|
2750
|
-
}
|
|
2751
|
-
const missing = DEFAULT_CSS_CALC_CUSTOM_PROPERTIES.filter((token) => !includesToken(value, token));
|
|
2752
|
-
return missing.length > 0 ? [...value, ...missing] : value;
|
|
2753
|
-
}
|
|
2754
|
-
if (value && typeof value === "object") {
|
|
2755
|
-
const include = value.includeCustomProperties;
|
|
2756
|
-
if (!Array.isArray(include)) {
|
|
2757
|
-
return {
|
|
2758
|
-
...value,
|
|
2759
|
-
includeCustomProperties: [...DEFAULT_CSS_CALC_CUSTOM_PROPERTIES]
|
|
2760
|
-
};
|
|
2761
|
-
}
|
|
2762
|
-
if (!DEFAULT_CSS_CALC_CUSTOM_PROPERTIES.length) {
|
|
2763
|
-
return value;
|
|
2764
|
-
}
|
|
2765
|
-
const missing = DEFAULT_CSS_CALC_CUSTOM_PROPERTIES.filter((token) => !includesToken(include, token));
|
|
2766
|
-
return missing.length > 0 ? {
|
|
2767
|
-
...value,
|
|
2768
|
-
includeCustomProperties: [...include, ...missing]
|
|
2769
|
-
} : value;
|
|
2770
|
-
}
|
|
2771
|
-
return value;
|
|
2772
|
-
}
|
|
2773
|
-
function normalizeCssEntriesConfig(entries) {
|
|
2774
|
-
if (!entries) {
|
|
2775
|
-
return void 0;
|
|
2776
|
-
}
|
|
2777
|
-
if (typeof entries === "string") {
|
|
2778
|
-
const trimmed = entries.trim();
|
|
2779
|
-
return trimmed ? [trimmed] : void 0;
|
|
2780
|
-
}
|
|
2781
|
-
if (!Array.isArray(entries)) {
|
|
2782
|
-
return void 0;
|
|
2783
|
-
}
|
|
2784
|
-
const normalized = entries.map((entry) => typeof entry === "string" ? entry.trim() : "").filter((entry) => entry.length > 0);
|
|
2785
|
-
return normalized.length > 0 ? normalized : void 0;
|
|
2786
|
-
}
|
|
2787
|
-
function hasConfiguredCssEntries(ctx) {
|
|
2788
|
-
if (normalizeCssEntriesConfig(ctx.cssEntries)) {
|
|
2789
|
-
return true;
|
|
2790
|
-
}
|
|
2791
|
-
if (normalizeCssEntriesConfig(_optionalChain([ctx, 'access', _86 => _86.tailwindcss, 'optionalAccess', _87 => _87.v4, 'optionalAccess', _88 => _88.cssEntries]))) {
|
|
2792
|
-
return true;
|
|
2793
|
-
}
|
|
2794
|
-
const patcherOptions = ctx.tailwindcssPatcherOptions;
|
|
2795
|
-
if (patcherOptions) {
|
|
2796
|
-
if (normalizeCssEntriesConfig(_optionalChain([patcherOptions, 'access', _89 => _89.tailwind, 'optionalAccess', _90 => _90.v4, 'optionalAccess', _91 => _91.cssEntries]))) {
|
|
2797
|
-
return true;
|
|
2798
|
-
}
|
|
2799
|
-
if (normalizeCssEntriesConfig(_optionalChain([patcherOptions, 'access', _92 => _92.patch, 'optionalAccess', _93 => _93.tailwindcss, 'optionalAccess', _94 => _94.v4, 'optionalAccess', _95 => _95.cssEntries]))) {
|
|
2800
|
-
return true;
|
|
2801
|
-
}
|
|
2802
|
-
}
|
|
2803
|
-
return false;
|
|
2804
|
-
}
|
|
2805
|
-
var hasWarnedMissingCssEntries = false;
|
|
2806
|
-
function warnMissingCssEntries(ctx, patcher) {
|
|
2807
|
-
if (hasWarnedMissingCssEntries) {
|
|
2808
|
-
return;
|
|
2809
|
-
}
|
|
2810
|
-
if (_optionalChain([patcher, 'optionalAccess', _96 => _96.majorVersion]) !== 4) {
|
|
2811
|
-
return;
|
|
2812
|
-
}
|
|
2813
|
-
if (hasConfiguredCssEntries(ctx)) {
|
|
2814
|
-
return;
|
|
2815
|
-
}
|
|
2816
|
-
hasWarnedMissingCssEntries = true;
|
|
2817
|
-
_logger.logger.warn(
|
|
2818
|
-
'[tailwindcss@4] \u672A\u68C0\u6D4B\u5230 cssEntries \u914D\u7F6E\u3002\u8BF7\u4F20\u5165\u5305\u542B tailwindcss \u5F15\u7528\u7684 CSS \u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4F8B\u5982 cssEntries: ["/absolute/path/to/src/app.css"]\uFF0C\u5426\u5219 tailwindcss \u751F\u6210\u7684\u7C7B\u540D\u4E0D\u4F1A\u53C2\u4E0E\u8F6C\u8BD1\u3002'
|
|
2819
|
-
);
|
|
2820
|
-
}
|
|
2821
2726
|
async function clearTailwindcssPatcherCache(patcher, options) {
|
|
2822
2727
|
if (!patcher) {
|
|
2823
2728
|
return;
|
|
2824
2729
|
}
|
|
2825
|
-
const cacheOptions = _optionalChain([patcher, 'access',
|
|
2730
|
+
const cacheOptions = _optionalChain([patcher, 'access', _86 => _86.options, 'optionalAccess', _87 => _87.cache]);
|
|
2826
2731
|
if (cacheOptions == null || typeof cacheOptions === "object" && cacheOptions.enabled === false) {
|
|
2827
2732
|
return;
|
|
2828
2733
|
}
|
|
2829
2734
|
const cachePaths = /* @__PURE__ */ new Map();
|
|
2830
2735
|
const normalizedCacheOptions = typeof cacheOptions === "object" ? cacheOptions : void 0;
|
|
2831
|
-
if (_optionalChain([normalizedCacheOptions, 'optionalAccess',
|
|
2736
|
+
if (_optionalChain([normalizedCacheOptions, 'optionalAccess', _88 => _88.path])) {
|
|
2832
2737
|
cachePaths.set(normalizedCacheOptions.path, false);
|
|
2833
2738
|
}
|
|
2834
|
-
const privateCachePath = _optionalChain([patcher, 'optionalAccess',
|
|
2739
|
+
const privateCachePath = _optionalChain([patcher, 'optionalAccess', _89 => _89.cacheStore, 'optionalAccess', _90 => _90.options, 'optionalAccess', _91 => _91.path]);
|
|
2835
2740
|
if (privateCachePath) {
|
|
2836
2741
|
cachePaths.set(privateCachePath, false);
|
|
2837
2742
|
}
|
|
2838
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2743
|
+
if (_optionalChain([options, 'optionalAccess', _92 => _92.removeDirectory]) && _optionalChain([normalizedCacheOptions, 'optionalAccess', _93 => _93.dir])) {
|
|
2839
2744
|
cachePaths.set(normalizedCacheOptions.dir, true);
|
|
2840
2745
|
}
|
|
2841
2746
|
if (!cachePaths.size) {
|
|
@@ -2846,7 +2751,7 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2846
2751
|
await _promises.rm.call(void 0, cachePath, { force: true, recursive });
|
|
2847
2752
|
} catch (error) {
|
|
2848
2753
|
const err = error;
|
|
2849
|
-
if (_optionalChain([err, 'optionalAccess',
|
|
2754
|
+
if (_optionalChain([err, 'optionalAccess', _94 => _94.code]) === "ENOENT") {
|
|
2850
2755
|
continue;
|
|
2851
2756
|
}
|
|
2852
2757
|
_logger.logger.debug("failed to clear tailwindcss patcher cache: %s %O", cachePath, err);
|
|
@@ -2856,23 +2761,20 @@ async function clearTailwindcssPatcherCache(patcher, options) {
|
|
|
2856
2761
|
function createInternalCompilerContext(opts) {
|
|
2857
2762
|
const ctx = _chunkUW3WHSZ5js.defuOverrideArray.call(void 0,
|
|
2858
2763
|
opts,
|
|
2859
|
-
|
|
2764
|
+
_chunk3URI7W6Xjs.getDefaultOptions.call(void 0, ),
|
|
2860
2765
|
{}
|
|
2861
2766
|
);
|
|
2862
2767
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
2863
2768
|
applyLoggerLevel(ctx.logLevel);
|
|
2864
|
-
const twPatcher =
|
|
2769
|
+
const twPatcher = _chunkP3AQCOOMjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2865
2770
|
logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
|
|
2866
|
-
if (_optionalChain([twPatcher, 'access',
|
|
2771
|
+
if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
|
|
2867
2772
|
_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)))}`);
|
|
2868
2773
|
} else {
|
|
2869
2774
|
_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`);
|
|
2870
2775
|
}
|
|
2871
|
-
warnMissingCssEntries(ctx, twPatcher);
|
|
2872
|
-
|
|
2873
|
-
if (twPatcher.majorVersion === 4 && cssCalcOptions) {
|
|
2874
|
-
cssCalcOptions = ensureDefaultsIncluded(cssCalcOptions);
|
|
2875
|
-
}
|
|
2776
|
+
_chunkP3AQCOOMjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
|
|
2777
|
+
const cssCalcOptions = _chunkP3AQCOOMjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
|
|
2876
2778
|
ctx.cssCalc = cssCalcOptions;
|
|
2877
2779
|
const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
|
|
2878
2780
|
const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
|
|
@@ -2887,11 +2789,11 @@ function createInternalCompilerContext(opts) {
|
|
|
2887
2789
|
ctx.twPatcher = twPatcher;
|
|
2888
2790
|
const refreshTailwindcssPatcher = async (options) => {
|
|
2889
2791
|
const previousPatcher = ctx.twPatcher;
|
|
2890
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2792
|
+
if (_optionalChain([options, 'optionalAccess', _97 => _97.clearCache]) !== false) {
|
|
2891
2793
|
await clearTailwindcssPatcherCache(previousPatcher);
|
|
2892
2794
|
}
|
|
2893
2795
|
invalidateRuntimeClassSet(previousPatcher);
|
|
2894
|
-
const nextPatcher =
|
|
2796
|
+
const nextPatcher = _chunkP3AQCOOMjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
|
|
2895
2797
|
Object.assign(previousPatcher, nextPatcher);
|
|
2896
2798
|
ctx.twPatcher = previousPatcher;
|
|
2897
2799
|
return previousPatcher;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.3_@swc+
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.1__@swc+core@1.15.3_@swc+h_608bab04d60812eb190cd7b30c36eaf7/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);
|
|
@@ -7,10 +7,20 @@ var _escape = require('@weapp-core/escape');
|
|
|
7
7
|
var CSS_FILE_PATTERN = /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/;
|
|
8
8
|
var HTML_FILE_PATTERN = /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/;
|
|
9
9
|
var JS_FILE_PATTERN = /.+\.[cm]?js?$/;
|
|
10
|
+
function normalizePath(p) {
|
|
11
|
+
return p.replace(/\\/g, "/");
|
|
12
|
+
}
|
|
13
|
+
var MPX_STYLES_DIR_PATTERN = /(?:^|\/)styles\/.*\.(?:wx|ac|jx|tt|q|c|ty)ss$/i;
|
|
10
14
|
var MAIN_CSS_CHUNK_MATCHERS = {
|
|
11
15
|
"uni-app": (file) => file.startsWith("common/main") || file.startsWith("app"),
|
|
12
16
|
"uni-app-vite": (file) => file.startsWith("app") || file.startsWith("common/main"),
|
|
13
|
-
"mpx": (file) =>
|
|
17
|
+
"mpx": (file) => {
|
|
18
|
+
const normalized = normalizePath(file);
|
|
19
|
+
if (normalized.startsWith("app")) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return MPX_STYLES_DIR_PATTERN.test(normalized);
|
|
23
|
+
},
|
|
14
24
|
"taro": (file) => file.startsWith("app"),
|
|
15
25
|
"remax": (file) => file.startsWith("app"),
|
|
16
26
|
"rax": (file) => file.startsWith("bundle"),
|