weapp-tailwindcss 5.0.0-next.25 → 5.0.0-next.27
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/{auto-B11j1XiD.js → auto-DP-qtQzE.js} +5 -7
- package/dist/{auto-AduSz49t.mjs → auto-XyKTOP7B.mjs} +4 -6
- package/dist/{bundle-state-CBouNDzi.mjs → bundle-state-7DRnJcJp.mjs} +1 -2
- package/dist/{bundle-state-BY7PWHAc.js → bundle-state-Nn90UQDa.js} +3 -4
- package/dist/bundlers/vite/index.d.ts +5 -2
- package/dist/bundlers/vite/serve-css-generation.d.ts +11 -0
- package/dist/bundlers/vite/source-candidates.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/cli.js +9 -11
- package/dist/cli.mjs +9 -11
- package/dist/core.js +1 -2
- package/dist/core.mjs +1 -1
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +4 -4
- package/dist/css-macro.mjs +3 -3
- package/dist/{defaults-B-1EEhdL.mjs → defaults-8xrgzxFY.mjs} +1 -1
- package/dist/{defaults-C10hYUch.js → defaults-C5w9OOrj.js} +1 -2
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/{generator-CtqzN9L-.mjs → generator-CbpjNxJh.mjs} +1 -1
- package/dist/{generator-DTPePQZ9.js → generator-DRNbzjx5.js} +2 -2
- package/dist/generator.js +2 -3
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +6 -6
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-CERcE0fP.js → incremental-runtime-class-set-BQPhkSov.js} +48 -14
- package/dist/{incremental-runtime-class-set-BlJ86j-A.mjs → incremental-runtime-class-set-C4JgSgRY.mjs} +48 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -6
- package/dist/index.mjs +5 -5
- package/dist/{postcss-BAO9tGi5.js → postcss-Br1eOaFd.js} +3 -3
- package/dist/{postcss-DYktK8_T.mjs → postcss-C7BMYpEF.mjs} +4 -4
- package/dist/{postcss-DXkxsPNg.js → postcss-CiYLsqZn.js} +4 -4
- package/dist/{postcss-CYPHxj7a.mjs → postcss-YetooK6S.mjs} +2 -2
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-ezN3ovAq.js → precheck-B6xigu7s.js} +2005 -13
- package/dist/{precheck-B4CpMt_w.mjs → precheck-uG16Cqaj.mjs} +1998 -12
- package/dist/presets/index.d.ts +1 -0
- package/dist/presets.js +19 -6
- package/dist/presets.mjs +17 -6
- package/dist/reset.js +1 -1
- package/dist/{source-candidates-DoyOltpZ.mjs → source-candidates-CX2ozpKM.mjs} +49 -7
- package/dist/{source-candidates-0jPRIPmC.js → source-candidates-DeK5b9i9.js} +50 -8
- package/dist/{tailwindcss-ujlr9Iad.mjs → tailwindcss-C7dJHZ0G.mjs} +2 -2
- package/dist/{tailwindcss-nQetCaPp.js → tailwindcss-DEEtJf4u.js} +3 -3
- package/dist/{utils-CSA174-I.js → utils-nta4tfFs.js} +1 -1
- package/dist/{v3-engine-Bbsrez2w.js → v3-engine-B_33V3Lu.js} +12 -4
- package/dist/{v3-engine-COw08vWd.mjs → v3-engine-DcvCCHfs.mjs} +11 -3
- package/dist/{vite-DE8Vfzal.js → vite-Bg18XZZc.js} +169 -22
- package/dist/{vite-hZsQAY1a.mjs → vite-DOmiMftw.mjs} +168 -21
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +53 -22
- package/dist/weapp-tw-runtime-classset-loader.js +1 -1
- package/dist/{webpack-c2WJnCJI.mjs → webpack-BdrjJf41.mjs} +17 -13
- package/dist/{webpack-CTJcw_sX.js → webpack-BzPDhzSz.js} +18 -14
- package/dist/webpack.d.ts +1 -3
- package/dist/webpack.js +3 -4
- package/dist/webpack.mjs +2 -2
- package/package.json +9 -7
- /package/dist/{chunk-8l464Juk.js → chunk-D6vf50IK.js} +0 -0
- /package/dist/{logger-Dr7IvyH2.mjs → logger-BNzxZbZj.mjs} +0 -0
- /package/dist/{logger-Cdzl3p8j.js → logger-TlKT3xmR.js} +0 -0
- /package/dist/{runtime-registry-CdCV3Opt.js → runtime-registry-DpcR3IHI.js} +0 -0
- /package/dist/{utils-B2SJgA1L.mjs → utils-DsaS975I.mjs} +0 -0
package/dist/presets/index.d.ts
CHANGED
package/dist/presets.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_chunk = require("./chunk-
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_utils = require("./utils-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
-
require("./logger-
|
|
2
|
+
const require_chunk = require("./chunk-D6vf50IK.js");
|
|
3
|
+
const require_v3_engine = require("./v3-engine-B_33V3Lu.js");
|
|
4
|
+
const require_utils = require("./utils-nta4tfFs.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-DEEtJf4u.js");
|
|
6
|
+
require("./logger-TlKT3xmR.js");
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
node_path = require_chunk.__toESM(node_path);
|
|
7
9
|
let node_process = require("node:process");
|
|
8
10
|
node_process = require_chunk.__toESM(node_process);
|
|
9
11
|
let local_pkg = require("local-pkg");
|
|
@@ -42,6 +44,11 @@ function createBasePreset(options = {}) {
|
|
|
42
44
|
return (0, _weapp_tailwindcss_shared.defuOverrideArray)((0, _weapp_tailwindcss_shared.defuOverrideArray)(userOptions, rawOptions ?? {}), preset);
|
|
43
45
|
}
|
|
44
46
|
//#endregion
|
|
47
|
+
//#region src/presets/hbuilderx.ts
|
|
48
|
+
function hbuilderx(options = {}) {
|
|
49
|
+
return createBasePreset({ ...options });
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
45
52
|
//#region src/presets/uni-app.ts
|
|
46
53
|
function uniApp(options = {}) {
|
|
47
54
|
const uniPlatform = node_process.default.env["UNI_PLATFORM"];
|
|
@@ -61,7 +68,11 @@ function resolveTailwindResolveOptions(base, resolve) {
|
|
|
61
68
|
const currentPaths = Array.isArray(resolve?.paths) ? resolve.paths : [];
|
|
62
69
|
return {
|
|
63
70
|
...resolve ?? {},
|
|
64
|
-
paths: [...new Set([
|
|
71
|
+
paths: [...new Set([
|
|
72
|
+
node_path.default.join(base, "node_modules"),
|
|
73
|
+
base,
|
|
74
|
+
...currentPaths
|
|
75
|
+
])]
|
|
65
76
|
};
|
|
66
77
|
}
|
|
67
78
|
function resolveInstalledTailwindDefaults(resolve) {
|
|
@@ -102,6 +113,7 @@ function uniAppX(options) {
|
|
|
102
113
|
rem2rpx: options.rem2rpx,
|
|
103
114
|
unitsToPx: options.unitsToPx,
|
|
104
115
|
unitConversion: options.unitConversion,
|
|
116
|
+
appType: "uni-app-x",
|
|
105
117
|
tailwindcssBasedir: options.base,
|
|
106
118
|
tailwindcssPatcherOptions: {
|
|
107
119
|
projectRoot: options.base,
|
|
@@ -127,6 +139,7 @@ function uniAppX(options) {
|
|
|
127
139
|
}
|
|
128
140
|
//#endregion
|
|
129
141
|
exports.createBasePreset = createBasePreset;
|
|
142
|
+
exports.hbuilderx = hbuilderx;
|
|
130
143
|
exports.normalizeCssEntries = normalizeCssEntries;
|
|
131
144
|
exports.uniApp = uniApp;
|
|
132
145
|
exports.uniAppX = uniAppX;
|
package/dist/presets.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { q as omitUndefined } from "./v3-engine-
|
|
2
|
-
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
4
|
-
import { t as logger } from "./logger-
|
|
1
|
+
import { q as omitUndefined } from "./v3-engine-DcvCCHfs.mjs";
|
|
2
|
+
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-C7dJHZ0G.mjs";
|
|
4
|
+
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
|
+
import path from "node:path";
|
|
5
6
|
import process from "node:process";
|
|
6
7
|
import { getPackageInfoSync } from "local-pkg";
|
|
7
8
|
//#region src/presets/shared.ts
|
|
@@ -37,6 +38,11 @@ function createBasePreset(options = {}) {
|
|
|
37
38
|
return defuOverrideArray(defuOverrideArray(userOptions, rawOptions ?? {}), preset);
|
|
38
39
|
}
|
|
39
40
|
//#endregion
|
|
41
|
+
//#region src/presets/hbuilderx.ts
|
|
42
|
+
function hbuilderx(options = {}) {
|
|
43
|
+
return createBasePreset({ ...options });
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
40
46
|
//#region src/presets/uni-app.ts
|
|
41
47
|
function uniApp(options = {}) {
|
|
42
48
|
const uniPlatform = process.env["UNI_PLATFORM"];
|
|
@@ -56,7 +62,11 @@ function resolveTailwindResolveOptions(base, resolve) {
|
|
|
56
62
|
const currentPaths = Array.isArray(resolve?.paths) ? resolve.paths : [];
|
|
57
63
|
return {
|
|
58
64
|
...resolve ?? {},
|
|
59
|
-
paths: [...new Set([
|
|
65
|
+
paths: [...new Set([
|
|
66
|
+
path.join(base, "node_modules"),
|
|
67
|
+
base,
|
|
68
|
+
...currentPaths
|
|
69
|
+
])]
|
|
60
70
|
};
|
|
61
71
|
}
|
|
62
72
|
function resolveInstalledTailwindDefaults(resolve) {
|
|
@@ -97,6 +107,7 @@ function uniAppX(options) {
|
|
|
97
107
|
rem2rpx: options.rem2rpx,
|
|
98
108
|
unitsToPx: options.unitsToPx,
|
|
99
109
|
unitConversion: options.unitConversion,
|
|
110
|
+
appType: "uni-app-x",
|
|
100
111
|
tailwindcssBasedir: options.base,
|
|
101
112
|
tailwindcssPatcherOptions: {
|
|
102
113
|
projectRoot: options.base,
|
|
@@ -121,4 +132,4 @@ function uniAppX(options) {
|
|
|
121
132
|
});
|
|
122
133
|
}
|
|
123
134
|
//#endregion
|
|
124
|
-
export { createBasePreset, normalizeCssEntries, uniApp, uniAppX };
|
|
135
|
+
export { createBasePreset, hbuilderx, normalizeCssEntries, uniApp, uniAppX };
|
package/dist/reset.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_chunk = require("./chunk-
|
|
5
|
+
const require_chunk = require("./chunk-D6vf50IK.js");
|
|
6
6
|
let _weapp_tailwindcss_reset = require("@weapp-tailwindcss/reset");
|
|
7
7
|
_weapp_tailwindcss_reset = require_chunk.__toESM(_weapp_tailwindcss_reset);
|
|
8
8
|
Object.defineProperty(exports, "default", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as resolveSourceScanPath, N as isFileMatchedByTailwindSourceEntries, k as FULL_SOURCE_SCAN_EXTENSION_RE, z as toPosixPath } from "./v3-engine-
|
|
1
|
+
import { L as resolveSourceScanPath, N as isFileMatchedByTailwindSourceEntries, k as FULL_SOURCE_SCAN_EXTENSION_RE, z as toPosixPath } from "./v3-engine-DcvCCHfs.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { extractSourceCandidates, resolveProjectSourceFiles } from "tailwindcss-patch";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
@@ -22,12 +22,22 @@ const TAILWIND_V4_IGNORED_CONTENT_DIRS = [
|
|
|
22
22
|
"venv"
|
|
23
23
|
];
|
|
24
24
|
const TAILWIND_V4_IGNORED_EXTENSIONS = [
|
|
25
|
+
"css",
|
|
25
26
|
"less",
|
|
27
|
+
"postcss",
|
|
28
|
+
"pcss",
|
|
26
29
|
"lock",
|
|
27
30
|
"sass",
|
|
28
31
|
"scss",
|
|
29
32
|
"styl",
|
|
30
|
-
"
|
|
33
|
+
"stylus",
|
|
34
|
+
"log",
|
|
35
|
+
"wxss",
|
|
36
|
+
"acss",
|
|
37
|
+
"jxss",
|
|
38
|
+
"ttss",
|
|
39
|
+
"qss",
|
|
40
|
+
"tyss"
|
|
31
41
|
];
|
|
32
42
|
const TAILWIND_V4_IGNORED_FILES = [
|
|
33
43
|
"package-lock.json",
|
|
@@ -68,8 +78,8 @@ function normalizeScanEntries(root, entries, outDirIgnore) {
|
|
|
68
78
|
function shouldApplyDefaultIgnoredSources(entries) {
|
|
69
79
|
return entries?.length === void 0 ? false : entries.length > 0 && entries.every((entry) => entry.negated);
|
|
70
80
|
}
|
|
71
|
-
function createDefaultIgnoredSources(root, outDirIgnore, entries) {
|
|
72
|
-
return [
|
|
81
|
+
function createDefaultIgnoredSources(root, outDirIgnore, entries, explicit) {
|
|
82
|
+
return [...!explicit || shouldApplyDefaultIgnoredSources(entries) ? [
|
|
73
83
|
...TAILWIND_V4_IGNORED_CONTENT_DIRS.map((pattern) => ({
|
|
74
84
|
base: root,
|
|
75
85
|
pattern: `**/${pattern}/**`,
|
|
@@ -119,6 +129,7 @@ function createSourceCandidateCollector() {
|
|
|
119
129
|
const candidatesById = /* @__PURE__ */ new Map();
|
|
120
130
|
const scanCandidatesById = /* @__PURE__ */ new Map();
|
|
121
131
|
const transformCandidatesById = /* @__PURE__ */ new Map();
|
|
132
|
+
const cssCandidatesById = /* @__PURE__ */ new Map();
|
|
122
133
|
const candidateCount = /* @__PURE__ */ new Map();
|
|
123
134
|
let inlineIncludedCandidates = /* @__PURE__ */ new Set();
|
|
124
135
|
let inlineExcludedCandidates = /* @__PURE__ */ new Set();
|
|
@@ -135,6 +146,18 @@ function createSourceCandidateCollector() {
|
|
|
135
146
|
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
136
147
|
replaceScanLayer(normalizedId, nextCandidates);
|
|
137
148
|
}
|
|
149
|
+
async function syncCss(id, source) {
|
|
150
|
+
const normalizedId = cleanUrl(id);
|
|
151
|
+
const contentCacheKey = createSourceCandidateContentCacheKey("css", source);
|
|
152
|
+
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
153
|
+
if (cachedCandidates) {
|
|
154
|
+
replaceCssLayer(normalizedId, new Set(cachedCandidates));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const nextCandidates = new Set(await extractSourceCandidates(source, "css"));
|
|
158
|
+
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
159
|
+
replaceCssLayer(normalizedId, nextCandidates);
|
|
160
|
+
}
|
|
138
161
|
async function merge(id, source) {
|
|
139
162
|
const normalizedId = cleanUrl(id);
|
|
140
163
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
@@ -153,11 +176,11 @@ function createSourceCandidateCollector() {
|
|
|
153
176
|
transformCandidatesById.delete(normalizedId);
|
|
154
177
|
await syncFile(normalizedId);
|
|
155
178
|
}
|
|
156
|
-
async function scanRoot({ entries, root, outDir }) {
|
|
179
|
+
async function scanRoot({ entries, explicit, root, outDir }) {
|
|
157
180
|
const resolvedRoot = path.resolve(root);
|
|
158
181
|
const outDirIgnore = resolveOutDirIgnorePattern(resolvedRoot, outDir);
|
|
159
182
|
const scanEntries = normalizeScanEntries(resolvedRoot, entries, outDirIgnore);
|
|
160
|
-
const ignoredSources = createDefaultIgnoredSources(resolvedRoot, outDirIgnore, entries);
|
|
183
|
+
const ignoredSources = createDefaultIgnoredSources(resolvedRoot, outDirIgnore, entries, explicit);
|
|
161
184
|
const files = await resolveProjectSourceFiles({
|
|
162
185
|
cwd: resolvedRoot,
|
|
163
186
|
...scanEntries === void 0 ? {} : { sources: scanEntries },
|
|
@@ -189,9 +212,19 @@ function createSourceCandidateCollector() {
|
|
|
189
212
|
else transformCandidatesById.set(normalizedId, nextCandidates);
|
|
190
213
|
recompute(normalizedId);
|
|
191
214
|
}
|
|
215
|
+
function replaceCssLayer(id, nextCandidates) {
|
|
216
|
+
const normalizedId = cleanUrl(id);
|
|
217
|
+
if (nextCandidates.size === 0) cssCandidatesById.delete(normalizedId);
|
|
218
|
+
else cssCandidatesById.set(normalizedId, nextCandidates);
|
|
219
|
+
recompute(normalizedId);
|
|
220
|
+
}
|
|
192
221
|
function recompute(id) {
|
|
193
222
|
const normalizedId = cleanUrl(id);
|
|
194
|
-
replaceFinal(normalizedId, new Set([
|
|
223
|
+
replaceFinal(normalizedId, new Set([
|
|
224
|
+
...scanCandidatesById.get(normalizedId) ?? [],
|
|
225
|
+
...transformCandidatesById.get(normalizedId) ?? [],
|
|
226
|
+
...cssCandidatesById.get(normalizedId) ?? []
|
|
227
|
+
]));
|
|
195
228
|
}
|
|
196
229
|
function syncInline(inlineCandidates) {
|
|
197
230
|
inlineIncludedCandidates = new Set(inlineCandidates?.included ?? []);
|
|
@@ -201,6 +234,7 @@ function createSourceCandidateCollector() {
|
|
|
201
234
|
const normalizedId = cleanUrl(id);
|
|
202
235
|
scanCandidatesById.delete(normalizedId);
|
|
203
236
|
transformCandidatesById.delete(normalizedId);
|
|
237
|
+
cssCandidatesById.delete(normalizedId);
|
|
204
238
|
const previousCandidates = candidatesById.get(normalizedId);
|
|
205
239
|
if (!previousCandidates) return;
|
|
206
240
|
removeCandidateSet(candidateCount, previousCandidates);
|
|
@@ -226,6 +260,7 @@ function createSourceCandidateCollector() {
|
|
|
226
260
|
candidatesById.clear();
|
|
227
261
|
scanCandidatesById.clear();
|
|
228
262
|
transformCandidatesById.clear();
|
|
263
|
+
cssCandidatesById.clear();
|
|
229
264
|
candidateCount.clear();
|
|
230
265
|
inlineIncludedCandidates.clear();
|
|
231
266
|
inlineExcludedCandidates.clear();
|
|
@@ -233,6 +268,7 @@ function createSourceCandidateCollector() {
|
|
|
233
268
|
function snapshot() {
|
|
234
269
|
return {
|
|
235
270
|
candidatesById: [...candidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
271
|
+
cssCandidatesById: [...cssCandidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
236
272
|
scanCandidatesById: [...scanCandidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
237
273
|
transformCandidatesById: [...transformCandidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
238
274
|
inlineExcludedCandidates: [...inlineExcludedCandidates],
|
|
@@ -254,6 +290,11 @@ function createSourceCandidateCollector() {
|
|
|
254
290
|
if (candidateSet.size === 0) continue;
|
|
255
291
|
transformCandidatesById.set(id, candidateSet);
|
|
256
292
|
}
|
|
293
|
+
for (const [id, candidates] of snapshot.cssCandidatesById ?? []) {
|
|
294
|
+
const candidateSet = new Set(candidates);
|
|
295
|
+
if (candidateSet.size === 0) continue;
|
|
296
|
+
cssCandidatesById.set(id, candidateSet);
|
|
297
|
+
}
|
|
257
298
|
for (const [id, candidates] of snapshot.candidatesById) {
|
|
258
299
|
const candidateSet = new Set(candidates);
|
|
259
300
|
if (candidateSet.size === 0) continue;
|
|
@@ -263,6 +304,7 @@ function createSourceCandidateCollector() {
|
|
|
263
304
|
}
|
|
264
305
|
return {
|
|
265
306
|
sync,
|
|
307
|
+
syncCss,
|
|
266
308
|
merge,
|
|
267
309
|
syncFile,
|
|
268
310
|
syncCurrentFile,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
1
|
+
const require_chunk = require("./chunk-D6vf50IK.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-B_33V3Lu.js");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_chunk.__toESM(node_path);
|
|
5
5
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
@@ -24,12 +24,22 @@ const TAILWIND_V4_IGNORED_CONTENT_DIRS = [
|
|
|
24
24
|
"venv"
|
|
25
25
|
];
|
|
26
26
|
const TAILWIND_V4_IGNORED_EXTENSIONS = [
|
|
27
|
+
"css",
|
|
27
28
|
"less",
|
|
29
|
+
"postcss",
|
|
30
|
+
"pcss",
|
|
28
31
|
"lock",
|
|
29
32
|
"sass",
|
|
30
33
|
"scss",
|
|
31
34
|
"styl",
|
|
32
|
-
"
|
|
35
|
+
"stylus",
|
|
36
|
+
"log",
|
|
37
|
+
"wxss",
|
|
38
|
+
"acss",
|
|
39
|
+
"jxss",
|
|
40
|
+
"ttss",
|
|
41
|
+
"qss",
|
|
42
|
+
"tyss"
|
|
33
43
|
];
|
|
34
44
|
const TAILWIND_V4_IGNORED_FILES = [
|
|
35
45
|
"package-lock.json",
|
|
@@ -70,8 +80,8 @@ function normalizeScanEntries(root, entries, outDirIgnore) {
|
|
|
70
80
|
function shouldApplyDefaultIgnoredSources(entries) {
|
|
71
81
|
return entries?.length === void 0 ? false : entries.length > 0 && entries.every((entry) => entry.negated);
|
|
72
82
|
}
|
|
73
|
-
function createDefaultIgnoredSources(root, outDirIgnore, entries) {
|
|
74
|
-
return [
|
|
83
|
+
function createDefaultIgnoredSources(root, outDirIgnore, entries, explicit) {
|
|
84
|
+
return [...!explicit || shouldApplyDefaultIgnoredSources(entries) ? [
|
|
75
85
|
...TAILWIND_V4_IGNORED_CONTENT_DIRS.map((pattern) => ({
|
|
76
86
|
base: root,
|
|
77
87
|
pattern: `**/${pattern}/**`,
|
|
@@ -121,6 +131,7 @@ function createSourceCandidateCollector() {
|
|
|
121
131
|
const candidatesById = /* @__PURE__ */ new Map();
|
|
122
132
|
const scanCandidatesById = /* @__PURE__ */ new Map();
|
|
123
133
|
const transformCandidatesById = /* @__PURE__ */ new Map();
|
|
134
|
+
const cssCandidatesById = /* @__PURE__ */ new Map();
|
|
124
135
|
const candidateCount = /* @__PURE__ */ new Map();
|
|
125
136
|
let inlineIncludedCandidates = /* @__PURE__ */ new Set();
|
|
126
137
|
let inlineExcludedCandidates = /* @__PURE__ */ new Set();
|
|
@@ -137,6 +148,18 @@ function createSourceCandidateCollector() {
|
|
|
137
148
|
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
138
149
|
replaceScanLayer(normalizedId, nextCandidates);
|
|
139
150
|
}
|
|
151
|
+
async function syncCss(id, source) {
|
|
152
|
+
const normalizedId = cleanUrl(id);
|
|
153
|
+
const contentCacheKey = createSourceCandidateContentCacheKey("css", source);
|
|
154
|
+
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
155
|
+
if (cachedCandidates) {
|
|
156
|
+
replaceCssLayer(normalizedId, new Set(cachedCandidates));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const nextCandidates = new Set(await (0, tailwindcss_patch.extractSourceCandidates)(source, "css"));
|
|
160
|
+
sourceCandidateContentCache.set(contentCacheKey, [...nextCandidates]);
|
|
161
|
+
replaceCssLayer(normalizedId, nextCandidates);
|
|
162
|
+
}
|
|
140
163
|
async function merge(id, source) {
|
|
141
164
|
const normalizedId = cleanUrl(id);
|
|
142
165
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
@@ -155,11 +178,11 @@ function createSourceCandidateCollector() {
|
|
|
155
178
|
transformCandidatesById.delete(normalizedId);
|
|
156
179
|
await syncFile(normalizedId);
|
|
157
180
|
}
|
|
158
|
-
async function scanRoot({ entries, root, outDir }) {
|
|
181
|
+
async function scanRoot({ entries, explicit, root, outDir }) {
|
|
159
182
|
const resolvedRoot = node_path.default.resolve(root);
|
|
160
183
|
const outDirIgnore = resolveOutDirIgnorePattern(resolvedRoot, outDir);
|
|
161
184
|
const scanEntries = normalizeScanEntries(resolvedRoot, entries, outDirIgnore);
|
|
162
|
-
const ignoredSources = createDefaultIgnoredSources(resolvedRoot, outDirIgnore, entries);
|
|
185
|
+
const ignoredSources = createDefaultIgnoredSources(resolvedRoot, outDirIgnore, entries, explicit);
|
|
163
186
|
const files = await (0, tailwindcss_patch.resolveProjectSourceFiles)({
|
|
164
187
|
cwd: resolvedRoot,
|
|
165
188
|
...scanEntries === void 0 ? {} : { sources: scanEntries },
|
|
@@ -191,9 +214,19 @@ function createSourceCandidateCollector() {
|
|
|
191
214
|
else transformCandidatesById.set(normalizedId, nextCandidates);
|
|
192
215
|
recompute(normalizedId);
|
|
193
216
|
}
|
|
217
|
+
function replaceCssLayer(id, nextCandidates) {
|
|
218
|
+
const normalizedId = cleanUrl(id);
|
|
219
|
+
if (nextCandidates.size === 0) cssCandidatesById.delete(normalizedId);
|
|
220
|
+
else cssCandidatesById.set(normalizedId, nextCandidates);
|
|
221
|
+
recompute(normalizedId);
|
|
222
|
+
}
|
|
194
223
|
function recompute(id) {
|
|
195
224
|
const normalizedId = cleanUrl(id);
|
|
196
|
-
replaceFinal(normalizedId, new Set([
|
|
225
|
+
replaceFinal(normalizedId, new Set([
|
|
226
|
+
...scanCandidatesById.get(normalizedId) ?? [],
|
|
227
|
+
...transformCandidatesById.get(normalizedId) ?? [],
|
|
228
|
+
...cssCandidatesById.get(normalizedId) ?? []
|
|
229
|
+
]));
|
|
197
230
|
}
|
|
198
231
|
function syncInline(inlineCandidates) {
|
|
199
232
|
inlineIncludedCandidates = new Set(inlineCandidates?.included ?? []);
|
|
@@ -203,6 +236,7 @@ function createSourceCandidateCollector() {
|
|
|
203
236
|
const normalizedId = cleanUrl(id);
|
|
204
237
|
scanCandidatesById.delete(normalizedId);
|
|
205
238
|
transformCandidatesById.delete(normalizedId);
|
|
239
|
+
cssCandidatesById.delete(normalizedId);
|
|
206
240
|
const previousCandidates = candidatesById.get(normalizedId);
|
|
207
241
|
if (!previousCandidates) return;
|
|
208
242
|
removeCandidateSet(candidateCount, previousCandidates);
|
|
@@ -228,6 +262,7 @@ function createSourceCandidateCollector() {
|
|
|
228
262
|
candidatesById.clear();
|
|
229
263
|
scanCandidatesById.clear();
|
|
230
264
|
transformCandidatesById.clear();
|
|
265
|
+
cssCandidatesById.clear();
|
|
231
266
|
candidateCount.clear();
|
|
232
267
|
inlineIncludedCandidates.clear();
|
|
233
268
|
inlineExcludedCandidates.clear();
|
|
@@ -235,6 +270,7 @@ function createSourceCandidateCollector() {
|
|
|
235
270
|
function snapshot() {
|
|
236
271
|
return {
|
|
237
272
|
candidatesById: [...candidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
273
|
+
cssCandidatesById: [...cssCandidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
238
274
|
scanCandidatesById: [...scanCandidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
239
275
|
transformCandidatesById: [...transformCandidatesById.entries()].map(([id, candidates]) => [id, [...candidates]]),
|
|
240
276
|
inlineExcludedCandidates: [...inlineExcludedCandidates],
|
|
@@ -256,6 +292,11 @@ function createSourceCandidateCollector() {
|
|
|
256
292
|
if (candidateSet.size === 0) continue;
|
|
257
293
|
transformCandidatesById.set(id, candidateSet);
|
|
258
294
|
}
|
|
295
|
+
for (const [id, candidates] of snapshot.cssCandidatesById ?? []) {
|
|
296
|
+
const candidateSet = new Set(candidates);
|
|
297
|
+
if (candidateSet.size === 0) continue;
|
|
298
|
+
cssCandidatesById.set(id, candidateSet);
|
|
299
|
+
}
|
|
259
300
|
for (const [id, candidates] of snapshot.candidatesById) {
|
|
260
301
|
const candidateSet = new Set(candidates);
|
|
261
302
|
if (candidateSet.size === 0) continue;
|
|
@@ -265,6 +306,7 @@ function createSourceCandidateCollector() {
|
|
|
265
306
|
}
|
|
266
307
|
return {
|
|
267
308
|
sync,
|
|
309
|
+
syncCss,
|
|
268
310
|
merge,
|
|
269
311
|
syncFile,
|
|
270
312
|
syncCurrentFile,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as normalizeStringListOption, H as readInstalledPackageMajorVersion, J as findNearestPackageRoot, V as createTailwindcssPatcher, X as findWorkspaceRoot, Y as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, q as omitUndefined } from "./v3-engine-
|
|
2
|
-
import { n as defuOverrideArray } from "./utils-
|
|
1
|
+
import { G as normalizeStringListOption, H as readInstalledPackageMajorVersion, J as findNearestPackageRoot, V as createTailwindcssPatcher, X as findWorkspaceRoot, Y as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, q as omitUndefined } from "./v3-engine-DcvCCHfs.mjs";
|
|
2
|
+
import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
require("./utils-
|
|
1
|
+
const require_chunk = require("./chunk-D6vf50IK.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-B_33V3Lu.js");
|
|
3
|
+
require("./utils-nta4tfFs.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_module = require("node:module");
|
|
6
6
|
let node_path = require("node:path");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const require_auto = require("./auto-
|
|
1
|
+
const require_chunk = require("./chunk-D6vf50IK.js");
|
|
2
|
+
const require_auto = require("./auto-DP-qtQzE.js");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
5
5
|
let node_module = require("node:module");
|
|
@@ -2496,9 +2496,17 @@ async function resolveViteSourceScanEntries(options, patcher, scanOptions = {})
|
|
|
2496
2496
|
const cssInlineCandidates = [];
|
|
2497
2497
|
const dependencies = /* @__PURE__ */ new Set();
|
|
2498
2498
|
let explicit = false;
|
|
2499
|
+
let readableCssEntryCount = 0;
|
|
2499
2500
|
for (const cssEntry of cssEntries) {
|
|
2500
2501
|
addSourceScanDependency(dependencies, cssEntry);
|
|
2501
|
-
|
|
2502
|
+
let css;
|
|
2503
|
+
try {
|
|
2504
|
+
css = (0, node_fs.readFileSync)(cssEntry, "utf8");
|
|
2505
|
+
} catch {
|
|
2506
|
+
continue;
|
|
2507
|
+
}
|
|
2508
|
+
readableCssEntryCount++;
|
|
2509
|
+
const resolved = await resolveTailwindV4EntriesFromCssCached(css, node_path.default.dirname(cssEntry));
|
|
2502
2510
|
if (resolved) {
|
|
2503
2511
|
entries.push(...resolved.entries);
|
|
2504
2512
|
cssInlineCandidates.push(resolved.inlineCandidates);
|
|
@@ -2507,7 +2515,7 @@ async function resolveViteSourceScanEntries(options, patcher, scanOptions = {})
|
|
|
2507
2515
|
}
|
|
2508
2516
|
}
|
|
2509
2517
|
const inlineCandidates = mergeTailwindInlineSourceCandidates(cssInlineCandidates);
|
|
2510
|
-
if (entries.length > 0 || inlineCandidates || explicit ||
|
|
2518
|
+
if (entries.length > 0 || inlineCandidates || explicit || readableCssEntryCount > 0) return createResolvedViteSourceScan({
|
|
2511
2519
|
entries: explicit ? entries : entries.length > 0 ? entries : void 0,
|
|
2512
2520
|
explicit,
|
|
2513
2521
|
inlineCandidates
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as transformCssMacroCss, n as hasCssMacroTailwindPlugin, o as withCssMacroStyleOptions, r as hasCssMacroTailwindV4Directive, t as hasCssMacroStyleOptions } from "./auto-
|
|
1
|
+
import { a as transformCssMacroCss, n as hasCssMacroTailwindPlugin, o as withCssMacroStyleOptions, r as hasCssMacroTailwindV4Directive, t as hasCssMacroStyleOptions } from "./auto-XyKTOP7B.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
4
4
|
import postcss from "postcss";
|
|
@@ -2488,9 +2488,17 @@ async function resolveViteSourceScanEntries(options, patcher, scanOptions = {})
|
|
|
2488
2488
|
const cssInlineCandidates = [];
|
|
2489
2489
|
const dependencies = /* @__PURE__ */ new Set();
|
|
2490
2490
|
let explicit = false;
|
|
2491
|
+
let readableCssEntryCount = 0;
|
|
2491
2492
|
for (const cssEntry of cssEntries) {
|
|
2492
2493
|
addSourceScanDependency(dependencies, cssEntry);
|
|
2493
|
-
|
|
2494
|
+
let css;
|
|
2495
|
+
try {
|
|
2496
|
+
css = readFileSync(cssEntry, "utf8");
|
|
2497
|
+
} catch {
|
|
2498
|
+
continue;
|
|
2499
|
+
}
|
|
2500
|
+
readableCssEntryCount++;
|
|
2501
|
+
const resolved = await resolveTailwindV4EntriesFromCssCached(css, path.dirname(cssEntry));
|
|
2494
2502
|
if (resolved) {
|
|
2495
2503
|
entries.push(...resolved.entries);
|
|
2496
2504
|
cssInlineCandidates.push(resolved.inlineCandidates);
|
|
@@ -2499,7 +2507,7 @@ async function resolveViteSourceScanEntries(options, patcher, scanOptions = {})
|
|
|
2499
2507
|
}
|
|
2500
2508
|
}
|
|
2501
2509
|
const inlineCandidates = mergeTailwindInlineSourceCandidates(cssInlineCandidates);
|
|
2502
|
-
if (entries.length > 0 || inlineCandidates || explicit ||
|
|
2510
|
+
if (entries.length > 0 || inlineCandidates || explicit || readableCssEntryCount > 0) return createResolvedViteSourceScan({
|
|
2503
2511
|
entries: explicit ? entries : entries.length > 0 ? entries : void 0,
|
|
2504
2512
|
explicit,
|
|
2505
2513
|
inlineCandidates
|