weapp-tailwindcss 5.0.11 → 5.0.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.
- package/dist/{bundle-state-CXzPknlT.mjs → bundle-state-BxMNKjBV.mjs} +2 -34
- package/dist/{bundle-state-BwtEqxvU.js → bundle-state-DU2ATDhw.js} +1 -39
- package/dist/bundlers/gulp/vinyl-transform.d.ts +1 -1
- package/dist/bundlers/shared/hmr-timing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/types.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +6 -0
- package/dist/bundlers/vite/weapp-vite-config.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +10 -8
- package/dist/cache/index.d.ts +4 -0
- package/dist/cli.js +7 -0
- package/dist/cli.mjs +7 -0
- package/dist/core.d.ts +7 -0
- package/dist/core.js +8 -5
- package/dist/core.mjs +8 -5
- package/dist/{generator-ChgOWNOj.js → generator-Cb1Zp3Al.js} +1 -1
- package/dist/{generator-h2XRiJ9-.mjs → generator-mvNFUvns.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-Be88jhoY.mjs → gulp-BfZpaYSQ.mjs} +97 -11
- package/dist/{gulp-CHtZF-oT.js → gulp-CxGZU0-v.js} +97 -11
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-BkivBZvN.js → hmr-timing-DFR51wgo.js} +61 -9
- package/dist/{hmr-timing-Ct5w4hdM.mjs → hmr-timing-DNjF8bWA.mjs} +49 -10
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +9 -10
- package/dist/postcss.mjs +7 -5
- package/dist/{precheck-CY9oaH49.js → precheck-30zNPRlI.js} +13 -3
- package/dist/{precheck-BpHxsWRd.mjs → precheck-CsFr1q2l.mjs} +14 -4
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/tailwindcss/source-scan.d.ts +1 -0
- package/dist/tailwindcss/v3-engine/generator.d.ts +17 -0
- package/dist/tailwindcss/v3-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v3-engine/types.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +19 -0
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/{tailwindcss-Bfy2egdX.mjs → tailwindcss-CK84uGBp.mjs} +1 -1
- package/dist/{tailwindcss-DbbAKAZP.js → tailwindcss-Clpkz1oR.js} +1 -1
- package/dist/{transform-Cd634UZV.js → transform-CaVEBOuR.js} +1 -1
- package/dist/{transform-r5evL6Hn.mjs → transform-Cju08-aJ.mjs} +1 -1
- package/dist/{v3-engine-D0yA9ZkF.js → v3-engine-CQE5JJNZ.js} +142 -29
- package/dist/{v3-engine-CFkP6dWF.mjs → v3-engine-DKBaKWGL.mjs} +131 -30
- package/dist/{vite-j9cB2Ff1.js → vite-BBGOjh9e.js} +289 -43
- package/dist/{vite-Bd8qf9dK.mjs → vite-CS5DE-HD.mjs} +288 -42
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +130 -31
- package/dist/{webpack-CJAOcYEO.js → webpack-DIWrcpRo.js} +93 -12
- package/dist/{webpack-DPdrcC2X.mjs → webpack-SPcri_D8.mjs} +92 -11
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_precheck = require("./precheck-
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CQE5JJNZ.js");
|
|
3
|
+
const require_precheck = require("./precheck-30zNPRlI.js");
|
|
4
|
+
const require_tailwindcss = require("./tailwindcss-Clpkz1oR.js");
|
|
5
|
+
const require_hmr_timing = require("./hmr-timing-DFR51wgo.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
node_fs = require_chunk.__toESM(node_fs);
|
|
8
8
|
let node_path = require("node:path");
|
|
@@ -58,7 +58,7 @@ function createGulpModuleGraphOptions(opts) {
|
|
|
58
58
|
},
|
|
59
59
|
filter(id) {
|
|
60
60
|
const relative = node_path.default.relative(node_process.default.cwd(), id);
|
|
61
|
-
return opts.jsMatcher(relative) || opts.wxsMatcher(relative);
|
|
61
|
+
return opts.jsMatcher?.(relative) === true || opts.wxsMatcher?.(relative) === true;
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
}
|
|
@@ -109,14 +109,17 @@ function createGulpRuntimeSnapshot(runtimeSourcesByFile, changedFiles) {
|
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/bundlers/gulp/vinyl-transform.ts
|
|
111
111
|
const Transform = node_stream.default.Transform;
|
|
112
|
-
function createVinylTransform(phase, handler) {
|
|
112
|
+
function createVinylTransform(phase, handler, getTimingDetails) {
|
|
113
113
|
return new Transform({
|
|
114
114
|
objectMode: true,
|
|
115
115
|
async transform(file, _encoding, callback) {
|
|
116
116
|
const hmrTimingStartedAt = performance.now();
|
|
117
117
|
try {
|
|
118
118
|
await handler(file);
|
|
119
|
-
require_hmr_timing.emitHmrTiming("gulp", phase, performance.now() - hmrTimingStartedAt, {
|
|
119
|
+
require_hmr_timing.emitHmrTiming("gulp", phase, performance.now() - hmrTimingStartedAt, {
|
|
120
|
+
file: file.relative || node_path.default.basename(file.path),
|
|
121
|
+
...getTimingDetails?.(file)
|
|
122
|
+
});
|
|
120
123
|
callback(null, file);
|
|
121
124
|
} catch (error) {
|
|
122
125
|
callback(error, file);
|
|
@@ -127,6 +130,69 @@ function createVinylTransform(phase, handler) {
|
|
|
127
130
|
//#endregion
|
|
128
131
|
//#region src/bundlers/gulp/index.ts
|
|
129
132
|
const debug = require_v3_engine.createDebug();
|
|
133
|
+
const GULP_RUNTIME_SOURCE_CACHE_MAX = 256;
|
|
134
|
+
const GULP_PROCESS_CACHE_MAX = 512;
|
|
135
|
+
function toMb(bytes) {
|
|
136
|
+
return Math.round(bytes / 1024 / 1024);
|
|
137
|
+
}
|
|
138
|
+
function touchMapEntry(map, key, value) {
|
|
139
|
+
map.delete(key);
|
|
140
|
+
map.set(key, value);
|
|
141
|
+
}
|
|
142
|
+
function pruneGulpRuntimeSourceCaches(sourceHashByFile, sourcesByFile) {
|
|
143
|
+
while (sourcesByFile.size > GULP_RUNTIME_SOURCE_CACHE_MAX) {
|
|
144
|
+
const oldestKey = sourcesByFile.keys().next().value;
|
|
145
|
+
if (typeof oldestKey !== "string") break;
|
|
146
|
+
sourcesByFile.delete(oldestKey);
|
|
147
|
+
sourceHashByFile.delete(oldestKey);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function rememberGulpProcessCacheKey(cacheKeys, key) {
|
|
151
|
+
cacheKeys.delete(key);
|
|
152
|
+
cacheKeys.add(key);
|
|
153
|
+
while (cacheKeys.size > GULP_PROCESS_CACHE_MAX) {
|
|
154
|
+
const oldestKey = cacheKeys.keys().next().value;
|
|
155
|
+
if (typeof oldestKey !== "string") break;
|
|
156
|
+
cacheKeys.delete(oldestKey);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function pruneGulpProcessCache(cache, cacheKeys) {
|
|
160
|
+
cache.prune?.({
|
|
161
|
+
cacheKeys,
|
|
162
|
+
hashKeys: cacheKeys
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function resolveGulpMemoryDebugStats(context) {
|
|
166
|
+
if (node_process.default.env["WEAPP_TW_HMR_MEMORY_DEBUG"] !== "1") return;
|
|
167
|
+
const memory = node_process.default.memoryUsage();
|
|
168
|
+
return {
|
|
169
|
+
phase: context.phase,
|
|
170
|
+
process: {
|
|
171
|
+
rssMb: toMb(memory.rss),
|
|
172
|
+
heapTotalMb: toMb(memory.heapTotal),
|
|
173
|
+
heapUsedMb: toMb(memory.heapUsed),
|
|
174
|
+
externalMb: toMb(memory.external),
|
|
175
|
+
arrayBuffersMb: toMb(memory.arrayBuffers)
|
|
176
|
+
},
|
|
177
|
+
runtime: {
|
|
178
|
+
runtimeSet: context.runtimeSet.size,
|
|
179
|
+
runtimeSourceHashByFile: context.runtimeSourceHashByFile.size,
|
|
180
|
+
runtimeSourcesByFile: context.runtimeSourcesByFile.size,
|
|
181
|
+
maxRuntimeSources: GULP_RUNTIME_SOURCE_CACHE_MAX
|
|
182
|
+
},
|
|
183
|
+
processCache: {
|
|
184
|
+
instance: context.cache.instance.size,
|
|
185
|
+
hashMap: context.cache.hashMap.size,
|
|
186
|
+
activeCacheKeys: context.gulpProcessCacheKeys.size,
|
|
187
|
+
maxCacheKeys: GULP_PROCESS_CACHE_MAX
|
|
188
|
+
},
|
|
189
|
+
gulpOptions: { defaultStyleHandlerOptions: context.defaultStyleHandlerOptionsCache.size },
|
|
190
|
+
tailwind: {
|
|
191
|
+
v3: require_v3_engine.getTailwindV3IncrementalGenerateCacheStats(),
|
|
192
|
+
v4: require_v3_engine.getTailwindV4IncrementalGenerateCacheStats()
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
130
196
|
/**
|
|
131
197
|
* @name weapp-tw-gulp
|
|
132
198
|
* @description gulp版本weapp-tw插件
|
|
@@ -158,6 +224,7 @@ function createPlugins(options = {}) {
|
|
|
158
224
|
const runtimeSourcesByFile = /* @__PURE__ */ new Map();
|
|
159
225
|
let cachedGulpSourceCandidates;
|
|
160
226
|
let cachedGulpSourceCandidateSignature;
|
|
227
|
+
const gulpProcessCacheKeys = /* @__PURE__ */ new Set();
|
|
161
228
|
const sourceCandidateExtractor = initialTwPatcher.majorVersion === 3 ? require_hmr_timing.createTailwindV3DefaultExtractor() : void 0;
|
|
162
229
|
const bundleRuntimeClassSetManager = options.__internalGulpRuntimeClassSetManager ?? require_hmr_timing.createBundleRuntimeClassSetManager();
|
|
163
230
|
function invalidateGulpSourceCandidates() {
|
|
@@ -190,11 +257,13 @@ function createPlugins(options = {}) {
|
|
|
190
257
|
const filename = node_path.default.resolve(file.path);
|
|
191
258
|
const hash = cache.computeHash(rawSource);
|
|
192
259
|
const changed = runtimeSourceHashByFile.get(filename) !== hash;
|
|
260
|
+
runtimeSourceHashByFile.delete(filename);
|
|
193
261
|
runtimeSourceHashByFile.set(filename, hash);
|
|
194
|
-
runtimeSourcesByFile
|
|
262
|
+
touchMapEntry(runtimeSourcesByFile, filename, {
|
|
195
263
|
source: rawSource,
|
|
196
264
|
type
|
|
197
265
|
});
|
|
266
|
+
pruneGulpRuntimeSourceCaches(runtimeSourceHashByFile, runtimeSourcesByFile);
|
|
198
267
|
if (changed && runtimeState.twPatcher.majorVersion === 4) invalidateGulpSourceCandidates();
|
|
199
268
|
if (!changed && runtimeSetInitialized) return runtimeSet;
|
|
200
269
|
if (runtimeState.twPatcher.majorVersion === 4 && !runtimeSetDirty) try {
|
|
@@ -341,6 +410,17 @@ function createPlugins(options = {}) {
|
|
|
341
410
|
...options
|
|
342
411
|
};
|
|
343
412
|
}
|
|
413
|
+
function resolveGulpTransformTimingDetails(phase) {
|
|
414
|
+
return { memoryDebug: resolveGulpMemoryDebugStats({
|
|
415
|
+
cache,
|
|
416
|
+
defaultStyleHandlerOptionsCache,
|
|
417
|
+
gulpProcessCacheKeys,
|
|
418
|
+
phase,
|
|
419
|
+
runtimeSet,
|
|
420
|
+
runtimeSourceHashByFile,
|
|
421
|
+
runtimeSourcesByFile
|
|
422
|
+
}) };
|
|
423
|
+
}
|
|
344
424
|
const transformWxss = (options = {}) => createVinylTransform("css", async (file) => {
|
|
345
425
|
if (!file.contents) return;
|
|
346
426
|
const rawSource = file.contents.toString();
|
|
@@ -394,7 +474,9 @@ function createPlugins(options = {}) {
|
|
|
394
474
|
return { result: css };
|
|
395
475
|
}
|
|
396
476
|
});
|
|
397
|
-
|
|
477
|
+
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
478
|
+
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
479
|
+
}, () => resolveGulpTransformTimingDetails("css"));
|
|
398
480
|
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|
|
399
481
|
if (!file.contents) return;
|
|
400
482
|
const filename = node_path.default.resolve(file.path);
|
|
@@ -434,7 +516,9 @@ function createPlugins(options = {}) {
|
|
|
434
516
|
return { result: code };
|
|
435
517
|
}
|
|
436
518
|
});
|
|
437
|
-
|
|
519
|
+
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
520
|
+
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
521
|
+
}, () => resolveGulpTransformTimingDetails("js"));
|
|
438
522
|
const transformWxml = (options = {}) => createVinylTransform("html", async (file) => {
|
|
439
523
|
if (!file.contents) return;
|
|
440
524
|
const rawSource = file.contents.toString();
|
|
@@ -457,7 +541,9 @@ function createPlugins(options = {}) {
|
|
|
457
541
|
return { result: code };
|
|
458
542
|
}
|
|
459
543
|
});
|
|
460
|
-
|
|
544
|
+
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
545
|
+
pruneGulpProcessCache(cache, gulpProcessCacheKeys);
|
|
546
|
+
}, () => resolveGulpTransformTimingDetails("html"));
|
|
461
547
|
return {
|
|
462
548
|
transformWxss,
|
|
463
549
|
transformWxml,
|
package/dist/gulp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_gulp = require("./gulp-CxGZU0-v.js");
|
|
3
3
|
exports.WeappTailwindcss = require_gulp.createPlugins;
|
|
4
4
|
exports.createPlugins = require_gulp.createPlugins;
|
|
5
5
|
exports.weappTailwindcss = require_gulp.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlugins } from "./gulp-
|
|
1
|
+
import { t as createPlugins } from "./gulp-BfZpaYSQ.mjs";
|
|
2
2
|
export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_precheck = require("./precheck-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CQE5JJNZ.js");
|
|
3
|
+
const require_generator = require("./generator-Cb1Zp3Al.js");
|
|
4
|
+
const require_precheck = require("./precheck-30zNPRlI.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-Clpkz1oR.js");
|
|
6
6
|
let node_module = require("node:module");
|
|
7
7
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
8
|
+
let lru_cache = require("lru-cache");
|
|
8
9
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
9
10
|
let node_fs = require("node:fs");
|
|
10
11
|
let node_path = require("node:path");
|
|
@@ -13,6 +14,7 @@ let node_process = require("node:process");
|
|
|
13
14
|
node_process = require_chunk.__toESM(node_process);
|
|
14
15
|
let node_fs_promises = require("node:fs/promises");
|
|
15
16
|
let _weapp_core_escape = require("@weapp-core/escape");
|
|
17
|
+
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
16
18
|
//#region src/bundlers/shared/cache.ts
|
|
17
19
|
async function processCachedTask({ cache, cacheKey, hashKey = cacheKey, rawSource, hash, readCache, applyResult, transform, onCacheHit }) {
|
|
18
20
|
let cacheHit = false;
|
|
@@ -1823,6 +1825,38 @@ function mergeMarkedUserLayerComponentsCss(baseCss, markedCss) {
|
|
|
1823
1825
|
};
|
|
1824
1826
|
}
|
|
1825
1827
|
//#endregion
|
|
1828
|
+
//#region src/bundlers/shared/run-tasks.ts
|
|
1829
|
+
async function runWithConcurrency(factories, limit = Math.min(4, Math.max(1, factories.length))) {
|
|
1830
|
+
if (factories.length === 0) return [];
|
|
1831
|
+
const results = Array.from({ length: factories.length });
|
|
1832
|
+
const executing = /* @__PURE__ */ new Set();
|
|
1833
|
+
let cursor = 0;
|
|
1834
|
+
const effectiveLimit = Math.max(1, limit);
|
|
1835
|
+
const scheduleNext = () => {
|
|
1836
|
+
if (cursor >= factories.length) return;
|
|
1837
|
+
const currentIndex = cursor++;
|
|
1838
|
+
const factory = factories[currentIndex];
|
|
1839
|
+
if (!factory) return;
|
|
1840
|
+
const wrapped = Promise.resolve(factory()).then((value) => {
|
|
1841
|
+
results[currentIndex] = value;
|
|
1842
|
+
}).finally(() => {
|
|
1843
|
+
executing.delete(wrapped);
|
|
1844
|
+
});
|
|
1845
|
+
executing.add(wrapped);
|
|
1846
|
+
};
|
|
1847
|
+
while (cursor < factories.length && executing.size < effectiveLimit) scheduleNext();
|
|
1848
|
+
while (cursor < factories.length) {
|
|
1849
|
+
await Promise.race(executing);
|
|
1850
|
+
scheduleNext();
|
|
1851
|
+
}
|
|
1852
|
+
await Promise.all(executing);
|
|
1853
|
+
return results;
|
|
1854
|
+
}
|
|
1855
|
+
function pushConcurrentTaskFactories(queue, factories, limit) {
|
|
1856
|
+
if (factories.length === 0) return;
|
|
1857
|
+
queue.push(runWithConcurrency(factories, limit).then(() => void 0));
|
|
1858
|
+
}
|
|
1859
|
+
//#endregion
|
|
1826
1860
|
//#region src/bundlers/shared/generator-css/validate.ts
|
|
1827
1861
|
const SUPPORTED_GENERATOR_MAJOR_VERSIONS = new Set([3, 4]);
|
|
1828
1862
|
async function validateCandidatesByGenerator(options) {
|
|
@@ -1854,6 +1888,11 @@ async function validateCandidatesByGenerator(options) {
|
|
|
1854
1888
|
}
|
|
1855
1889
|
//#endregion
|
|
1856
1890
|
//#region src/bundlers/shared/generator-css.ts
|
|
1891
|
+
function resolveGeneratorSourceConcurrency() {
|
|
1892
|
+
const configured = Number.parseInt(node_process.default.env["WEAPP_TW_GENERATOR_SOURCE_CONCURRENCY"] ?? "", 10);
|
|
1893
|
+
if (Number.isFinite(configured) && configured > 0) return configured;
|
|
1894
|
+
return 1;
|
|
1895
|
+
}
|
|
1857
1896
|
async function generateCssByGenerator(options) {
|
|
1858
1897
|
const { opts, runtimeState, runtime, rawSource, file, cssHandlerOptions, cssUserHandlerOptions, getSourceCandidatesForEntries, styleHandler, debug } = options;
|
|
1859
1898
|
const generatorOptions = {
|
|
@@ -1899,7 +1938,8 @@ async function generateCssByGenerator(options) {
|
|
|
1899
1938
|
});
|
|
1900
1939
|
const generatorStyleOptions = resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorOptions.styleOptions);
|
|
1901
1940
|
const configuredContainerCompat = hasConfiguredContainerCompatSources(sources);
|
|
1902
|
-
const
|
|
1941
|
+
const sourceConcurrency = resolveGeneratorSourceConcurrency();
|
|
1942
|
+
const generated = mergeGeneratorResults((await runWithConcurrency(sources.map((source) => async () => {
|
|
1903
1943
|
const generator = require_generator.createWeappTailwindcssGenerator(source);
|
|
1904
1944
|
const sourceEntries = getSourceCandidatesForEntries && (majorVersion === 3 || majorVersion === 4) ? await resolveGeneratorSourceEntries(source, runtimeState) : void 0;
|
|
1905
1945
|
const scopedRuntime = sourceEntries ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
@@ -1927,7 +1967,7 @@ async function generateCssByGenerator(options) {
|
|
|
1927
1967
|
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
1928
1968
|
target: generatorOptions.target
|
|
1929
1969
|
});
|
|
1930
|
-
}))).filter((item) => Boolean(item)));
|
|
1970
|
+
}), sourceConcurrency)).filter((item) => Boolean(item)));
|
|
1931
1971
|
if (!generated) return;
|
|
1932
1972
|
debug("tailwind generator result: %s rawBytes=%d cssBytes=%d candidates=%d", file, generated.rawCss.length, generated.css.length, generated.classSet.size);
|
|
1933
1973
|
if ((generated.target !== "weapp" || !hasUserCssLayerBlocks(generatorRawSource)) && typeof options.previousCss === "string" && typeof generated.incrementalCss === "string") {
|
|
@@ -2331,7 +2371,7 @@ function createHighConfidenceLiteralRanges(source, matches) {
|
|
|
2331
2371
|
for (const match of matches) {
|
|
2332
2372
|
const candidate = match?.rawCandidate;
|
|
2333
2373
|
if (typeof candidate !== "string" || !isHighConfidenceV3Candidate(candidate)) continue;
|
|
2334
|
-
const range = resolveQuotedLiteralRange(source, match
|
|
2374
|
+
const range = resolveQuotedLiteralRange(source, match?.start ?? source.indexOf(candidate));
|
|
2335
2375
|
if (range) ranges.push(range);
|
|
2336
2376
|
}
|
|
2337
2377
|
return ranges;
|
|
@@ -2727,7 +2767,7 @@ function createTailwindV3DefaultExtractor() {
|
|
|
2727
2767
|
//#endregion
|
|
2728
2768
|
//#region src/bundlers/vite/source-candidates.ts
|
|
2729
2769
|
const CLEAN_URL_RE = /[?#].*$/;
|
|
2730
|
-
const sourceCandidateContentCache =
|
|
2770
|
+
const sourceCandidateContentCache = new lru_cache.LRUCache({ max: 128 });
|
|
2731
2771
|
function cleanUrl(id) {
|
|
2732
2772
|
return require_v3_engine.resolveSourceScanPath(id.replace(CLEAN_URL_RE, ""));
|
|
2733
2773
|
}
|
|
@@ -2736,7 +2776,7 @@ function resolveSourceCandidateExtension(id) {
|
|
|
2736
2776
|
return /\.([^.\\/]+)$/.exec(normalized)?.[1] ?? "html";
|
|
2737
2777
|
}
|
|
2738
2778
|
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues, extractor) {
|
|
2739
|
-
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${extractor ? "custom" : "default"}\0${source}`;
|
|
2779
|
+
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${extractor ? "custom" : "default"}\0${(0, _weapp_tailwindcss_shared_node.md5)(source)}`;
|
|
2740
2780
|
}
|
|
2741
2781
|
async function extractCandidates(source, extension, options) {
|
|
2742
2782
|
const candidates = options.extractor ? new Set(await options.extractor(source, extension)) : new Set(await (0, tailwindcss_patch.extractSourceCandidates)(source, extension, { ...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } }));
|
|
@@ -3153,6 +3193,18 @@ Object.defineProperty(exports, "processCachedTask", {
|
|
|
3153
3193
|
return processCachedTask;
|
|
3154
3194
|
}
|
|
3155
3195
|
});
|
|
3196
|
+
Object.defineProperty(exports, "pushConcurrentTaskFactories", {
|
|
3197
|
+
enumerable: true,
|
|
3198
|
+
get: function() {
|
|
3199
|
+
return pushConcurrentTaskFactories;
|
|
3200
|
+
}
|
|
3201
|
+
});
|
|
3202
|
+
Object.defineProperty(exports, "runWithConcurrency", {
|
|
3203
|
+
enumerable: true,
|
|
3204
|
+
get: function() {
|
|
3205
|
+
return runWithConcurrency;
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3156
3208
|
Object.defineProperty(exports, "validateCandidatesByGenerator", {
|
|
3157
3209
|
enumerable: true,
|
|
3158
3210
|
get: function() {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import { h as traverse, m as babelParse, p as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-
|
|
4
|
-
import { r as isUniAppXEnabled } from "./tailwindcss-
|
|
1
|
+
import { $ as FULL_SOURCE_SCAN_EXTENSION_RE, B as splitTailwindGeneratedCssByBanner, C as resolveTailwindV4SourceOptionsFromPatcher, D as hasTailwindSourceDirectives, E as hasTailwindRootDirectives, F as VITE_MARKER_RE, G as normalizeConfigDirective, H as stripGeneratorPlaceholderMarkers, I as createCssAppend, K as prependConfigDirective, L as hasTailwindGeneratedCss, M as parseImportRequest, N as removeTailwindSourceDirectives, P as resolveCssEntrySource, Q as loadTailwindV4DesignSystem, R as hasTailwindGeneratedCssMarkers, S as resolveTailwindV4SourceFromPatcher, T as hasTailwindApplyDirective, U as stripTailwindBanner, V as splitTailwindV4GeneratedCssBySourceOrder, W as stripTailwindBanners, Z as filterUnsupportedMiniProgramTailwindV4Candidates, _ as resolveTailwindV4EntriesFromCss, at as createDebug, b as resolveTailwindV4Source$1, et as isFileMatchedByTailwindSourceEntries, ht as omitUndefined, it as toPosixPath$1, j as normalizeTailwindV3CssEntrySource, k as normalizeTailwindSourceDirectives, n as resolveTailwindV3SourceFromPatcher, nt as resolveSourceScanPath, r as resolveTailwindV3SourceOptionsFromPatcher, rt as resolveTailwindV4CssSourceBase, t as resolveTailwindV3Source, tt as normalizeLegacyContentEntries, u as getRuntimeClassSetSignature, z as splitGeneratorPlaceholderCssBySourceOrder } from "./v3-engine-DKBaKWGL.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-mvNFUvns.mjs";
|
|
3
|
+
import { h as traverse, m as babelParse, p as replaceWxml, r as resolveStyleOptionsFromContext, x as md5Hash } from "./precheck-CsFr1q2l.mjs";
|
|
4
|
+
import { r as isUniAppXEnabled } from "./tailwindcss-CK84uGBp.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { finalizeMiniProgramCss, postcss, pruneMiniProgramGeneratedCss, removeUnsupportedMiniProgramAtRules } from "@weapp-tailwindcss/postcss";
|
|
7
|
+
import { LRUCache } from "lru-cache";
|
|
7
8
|
import { extractRawCandidatesWithPositions, extractSourceCandidates, extractValidCandidates, resolveProjectSourceFiles, resolveValidTailwindV4Candidates, splitCandidateTokens } from "tailwindcss-patch";
|
|
8
9
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
10
|
import path from "node:path";
|
|
@@ -1820,6 +1821,38 @@ function mergeMarkedUserLayerComponentsCss(baseCss, markedCss) {
|
|
|
1820
1821
|
};
|
|
1821
1822
|
}
|
|
1822
1823
|
//#endregion
|
|
1824
|
+
//#region src/bundlers/shared/run-tasks.ts
|
|
1825
|
+
async function runWithConcurrency(factories, limit = Math.min(4, Math.max(1, factories.length))) {
|
|
1826
|
+
if (factories.length === 0) return [];
|
|
1827
|
+
const results = Array.from({ length: factories.length });
|
|
1828
|
+
const executing = /* @__PURE__ */ new Set();
|
|
1829
|
+
let cursor = 0;
|
|
1830
|
+
const effectiveLimit = Math.max(1, limit);
|
|
1831
|
+
const scheduleNext = () => {
|
|
1832
|
+
if (cursor >= factories.length) return;
|
|
1833
|
+
const currentIndex = cursor++;
|
|
1834
|
+
const factory = factories[currentIndex];
|
|
1835
|
+
if (!factory) return;
|
|
1836
|
+
const wrapped = Promise.resolve(factory()).then((value) => {
|
|
1837
|
+
results[currentIndex] = value;
|
|
1838
|
+
}).finally(() => {
|
|
1839
|
+
executing.delete(wrapped);
|
|
1840
|
+
});
|
|
1841
|
+
executing.add(wrapped);
|
|
1842
|
+
};
|
|
1843
|
+
while (cursor < factories.length && executing.size < effectiveLimit) scheduleNext();
|
|
1844
|
+
while (cursor < factories.length) {
|
|
1845
|
+
await Promise.race(executing);
|
|
1846
|
+
scheduleNext();
|
|
1847
|
+
}
|
|
1848
|
+
await Promise.all(executing);
|
|
1849
|
+
return results;
|
|
1850
|
+
}
|
|
1851
|
+
function pushConcurrentTaskFactories(queue, factories, limit) {
|
|
1852
|
+
if (factories.length === 0) return;
|
|
1853
|
+
queue.push(runWithConcurrency(factories, limit).then(() => void 0));
|
|
1854
|
+
}
|
|
1855
|
+
//#endregion
|
|
1823
1856
|
//#region src/bundlers/shared/generator-css/validate.ts
|
|
1824
1857
|
const SUPPORTED_GENERATOR_MAJOR_VERSIONS = new Set([3, 4]);
|
|
1825
1858
|
async function validateCandidatesByGenerator(options) {
|
|
@@ -1851,6 +1884,11 @@ async function validateCandidatesByGenerator(options) {
|
|
|
1851
1884
|
}
|
|
1852
1885
|
//#endregion
|
|
1853
1886
|
//#region src/bundlers/shared/generator-css.ts
|
|
1887
|
+
function resolveGeneratorSourceConcurrency() {
|
|
1888
|
+
const configured = Number.parseInt(process.env["WEAPP_TW_GENERATOR_SOURCE_CONCURRENCY"] ?? "", 10);
|
|
1889
|
+
if (Number.isFinite(configured) && configured > 0) return configured;
|
|
1890
|
+
return 1;
|
|
1891
|
+
}
|
|
1854
1892
|
async function generateCssByGenerator(options) {
|
|
1855
1893
|
const { opts, runtimeState, runtime, rawSource, file, cssHandlerOptions, cssUserHandlerOptions, getSourceCandidatesForEntries, styleHandler, debug } = options;
|
|
1856
1894
|
const generatorOptions = {
|
|
@@ -1896,7 +1934,8 @@ async function generateCssByGenerator(options) {
|
|
|
1896
1934
|
});
|
|
1897
1935
|
const generatorStyleOptions = resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorOptions.styleOptions);
|
|
1898
1936
|
const configuredContainerCompat = hasConfiguredContainerCompatSources(sources);
|
|
1899
|
-
const
|
|
1937
|
+
const sourceConcurrency = resolveGeneratorSourceConcurrency();
|
|
1938
|
+
const generated = mergeGeneratorResults((await runWithConcurrency(sources.map((source) => async () => {
|
|
1900
1939
|
const generator = createWeappTailwindcssGenerator(source);
|
|
1901
1940
|
const sourceEntries = getSourceCandidatesForEntries && (majorVersion === 3 || majorVersion === 4) ? await resolveGeneratorSourceEntries(source, runtimeState) : void 0;
|
|
1902
1941
|
const scopedRuntime = sourceEntries ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
@@ -1924,7 +1963,7 @@ async function generateCssByGenerator(options) {
|
|
|
1924
1963
|
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
1925
1964
|
target: generatorOptions.target
|
|
1926
1965
|
});
|
|
1927
|
-
}))).filter((item) => Boolean(item)));
|
|
1966
|
+
}), sourceConcurrency)).filter((item) => Boolean(item)));
|
|
1928
1967
|
if (!generated) return;
|
|
1929
1968
|
debug("tailwind generator result: %s rawBytes=%d cssBytes=%d candidates=%d", file, generated.rawCss.length, generated.css.length, generated.classSet.size);
|
|
1930
1969
|
if ((generated.target !== "weapp" || !hasUserCssLayerBlocks(generatorRawSource)) && typeof options.previousCss === "string" && typeof generated.incrementalCss === "string") {
|
|
@@ -2328,7 +2367,7 @@ function createHighConfidenceLiteralRanges(source, matches) {
|
|
|
2328
2367
|
for (const match of matches) {
|
|
2329
2368
|
const candidate = match?.rawCandidate;
|
|
2330
2369
|
if (typeof candidate !== "string" || !isHighConfidenceV3Candidate(candidate)) continue;
|
|
2331
|
-
const range = resolveQuotedLiteralRange(source, match
|
|
2370
|
+
const range = resolveQuotedLiteralRange(source, match?.start ?? source.indexOf(candidate));
|
|
2332
2371
|
if (range) ranges.push(range);
|
|
2333
2372
|
}
|
|
2334
2373
|
return ranges;
|
|
@@ -2724,7 +2763,7 @@ function createTailwindV3DefaultExtractor() {
|
|
|
2724
2763
|
//#endregion
|
|
2725
2764
|
//#region src/bundlers/vite/source-candidates.ts
|
|
2726
2765
|
const CLEAN_URL_RE = /[?#].*$/;
|
|
2727
|
-
const sourceCandidateContentCache =
|
|
2766
|
+
const sourceCandidateContentCache = new LRUCache({ max: 128 });
|
|
2728
2767
|
function cleanUrl(id) {
|
|
2729
2768
|
return resolveSourceScanPath(id.replace(CLEAN_URL_RE, ""));
|
|
2730
2769
|
}
|
|
@@ -2733,7 +2772,7 @@ function resolveSourceCandidateExtension(id) {
|
|
|
2733
2772
|
return /\.([^.\\/]+)$/.exec(normalized)?.[1] ?? "html";
|
|
2734
2773
|
}
|
|
2735
2774
|
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues, extractor) {
|
|
2736
|
-
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${extractor ? "custom" : "default"}\0${source}`;
|
|
2775
|
+
return `${extension}\0${JSON.stringify(bareArbitraryValues ?? false)}\0${extractor ? "custom" : "default"}\0${md5Hash(source)}`;
|
|
2737
2776
|
}
|
|
2738
2777
|
async function extractCandidates(source, extension, options) {
|
|
2739
2778
|
const candidates = options.extractor ? new Set(await options.extractor(source, extension)) : new Set(await extractSourceCandidates(source, extension, { ...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } }));
|
|
@@ -3060,4 +3099,4 @@ function createHmrTimingRecorder(bundler) {
|
|
|
3060
3099
|
};
|
|
3061
3100
|
}
|
|
3062
3101
|
//#endregion
|
|
3063
|
-
export {
|
|
3102
|
+
export { createCssSourceTraceCacheSignature as _, createTailwindV3DefaultExtractor as a, processCachedTask as b, validateCandidatesByGenerator as c, extractMarkedUserLayerComponentsCss as d, mergeMarkedUserLayerComponentsCss as f, annotateCssSourceTrace as g, pruneMiniProgramGeneratedCss as h, isSourceCandidateRequest as i, pushConcurrentTaskFactories as l, finalizeMiniProgramCss as m, emitHmrTiming as n, createBundleRuntimeClassSetManager as o, isPureLocalCssImportWrapper as p, createSourceCandidateCollector as r, generateCssByGenerator as s, createHmrTimingRecorder as t, runWithConcurrency as u, createCssTokenSourceMap as v, isCssSourceTraceEnabled as y };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_generator = require("./generator-Cb1Zp3Al.js");
|
|
3
|
+
const require_gulp = require("./gulp-CxGZU0-v.js");
|
|
4
4
|
const require_postcss = require("./postcss.js");
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
5
|
+
const require_vite = require("./vite-BBGOjh9e.js");
|
|
6
|
+
const require_webpack = require("./webpack-DIWrcpRo.js");
|
|
7
7
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
8
8
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
9
9
|
exports.createPlugins = require_gulp.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
2
|
-
import { t as createPlugins } from "./gulp-
|
|
1
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-mvNFUvns.mjs";
|
|
2
|
+
import { t as createPlugins } from "./gulp-BfZpaYSQ.mjs";
|
|
3
3
|
import weappTailwindcssPostcssPlugin from "./postcss.mjs";
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
4
|
+
import { t as WeappTailwindcss } from "./vite-CS5DE-HD.mjs";
|
|
5
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-SPcri_D8.mjs";
|
|
6
6
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
7
7
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
package/dist/postcss.js
CHANGED
|
@@ -2,17 +2,16 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_v3_engine = require("./v3-engine-
|
|
6
|
-
const require_generator = require("./generator-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const require_v3_engine = require("./v3-engine-CQE5JJNZ.js");
|
|
6
|
+
const require_generator = require("./generator-Cb1Zp3Al.js");
|
|
7
|
+
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
8
|
+
createGenerator: (source) => {
|
|
9
|
+
return require_generator.createWeappTailwindcssGenerator(source);
|
|
10
|
+
},
|
|
11
11
|
normalizeGeneratorOptions: (options) => require_generator.normalizeWeappTailwindcssGeneratorOptions(options),
|
|
12
|
-
resolveTailwindV3Source: require_v3_engine.resolveTailwindV3Source,
|
|
13
|
-
resolveTailwindV4Source: require_v3_engine.resolveTailwindV4Source
|
|
14
|
-
};
|
|
15
|
-
const weappTailwindcssPostcssPlugin = (0, _weapp_tailwindcss_postcss.createWeappTailwindcssPostcssPlugin)(adapters);
|
|
12
|
+
resolveTailwindV3Source: (options) => require_v3_engine.resolveTailwindV3Source(options),
|
|
13
|
+
resolveTailwindV4Source: (options) => require_v3_engine.resolveTailwindV4Source(options)
|
|
14
|
+
});
|
|
16
15
|
//#endregion
|
|
17
16
|
exports.default = weappTailwindcssPostcssPlugin;
|
|
18
17
|
exports.weappTailwindcssPostcssPlugin = weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { b as resolveTailwindV4Source, t as resolveTailwindV3Source } from "./v3-engine-DKBaKWGL.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-mvNFUvns.mjs";
|
|
3
3
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
4
4
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
5
|
-
createGenerator: (source) =>
|
|
5
|
+
createGenerator: (source) => {
|
|
6
|
+
return createWeappTailwindcssGenerator(source);
|
|
7
|
+
},
|
|
6
8
|
normalizeGeneratorOptions: (options) => normalizeWeappTailwindcssGeneratorOptions(options),
|
|
7
|
-
resolveTailwindV3Source,
|
|
8
|
-
resolveTailwindV4Source
|
|
9
|
+
resolveTailwindV3Source: (options) => resolveTailwindV3Source(options),
|
|
10
|
+
resolveTailwindV4Source: (options) => resolveTailwindV4Source(options)
|
|
9
11
|
});
|
|
10
12
|
//#endregion
|
|
11
13
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-CQE5JJNZ.js");
|
|
3
3
|
const require_defaults = require("./defaults-Boc26eel.js");
|
|
4
4
|
require("./utils-Dolmt8EO.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-Clpkz1oR.js");
|
|
6
6
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
7
|
+
let lru_cache = require("lru-cache");
|
|
7
8
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
8
9
|
let node_path = require("node:path");
|
|
9
10
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -12,7 +13,6 @@ node_process = require_chunk.__toESM(node_process);
|
|
|
12
13
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
13
14
|
let node_fs_promises = require("node:fs/promises");
|
|
14
15
|
let node_buffer = require("node:buffer");
|
|
15
|
-
let lru_cache = require("lru-cache");
|
|
16
16
|
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
17
17
|
let _weapp_core_escape = require("@weapp-core/escape");
|
|
18
18
|
let _babel_traverse = require("@babel/traverse");
|
|
@@ -69,6 +69,16 @@ function createCache(options) {
|
|
|
69
69
|
});
|
|
70
70
|
return cache;
|
|
71
71
|
},
|
|
72
|
+
prune(options) {
|
|
73
|
+
if (options.cacheKeys) {
|
|
74
|
+
const cacheKeys = new Set(options.cacheKeys);
|
|
75
|
+
for (const key of instance.keys()) if (!cacheKeys.has(key)) instance.delete(key);
|
|
76
|
+
}
|
|
77
|
+
if (options.hashKeys) {
|
|
78
|
+
const hashKeys = new Set(options.hashKeys);
|
|
79
|
+
for (const key of hashMap.keys()) if (!hashKeys.has(key)) hashMap.delete(key);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
72
82
|
has(key) {
|
|
73
83
|
return instance.has(key);
|
|
74
84
|
},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as resolveTailwindV4SourceFromPatcher, at as createDebug, c as ensureTailwindcssRuntimePatch, d as getRuntimeClassSetSignatureWithSources, dt as resolveBooleanObjectOption, f as invalidateRuntimeClassSet, ht as omitUndefined, l as getRuntimeClassSetCacheEntry, q as createTailwindV4Engine$1 } from "./v3-engine-DKBaKWGL.mjs";
|
|
2
2
|
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-DH0ZQRhy.mjs";
|
|
3
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
4
|
-
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-
|
|
4
|
+
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-CK84uGBp.mjs";
|
|
5
5
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
6
|
+
import { LRUCache } from "lru-cache";
|
|
6
7
|
import { splitCandidateTokens } from "tailwindcss-patch";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import process from "node:process";
|
|
9
10
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
10
11
|
import { rm } from "node:fs/promises";
|
|
11
12
|
import { Buffer } from "node:buffer";
|
|
12
|
-
import { LRUCache } from "lru-cache";
|
|
13
13
|
import { md5 as md5Hash } from "@weapp-tailwindcss/shared/node";
|
|
14
14
|
import { MappingChars2String, escape } from "@weapp-core/escape";
|
|
15
15
|
import _babelTraverse from "@babel/traverse";
|
|
@@ -62,6 +62,16 @@ function createCache(options) {
|
|
|
62
62
|
});
|
|
63
63
|
return cache;
|
|
64
64
|
},
|
|
65
|
+
prune(options) {
|
|
66
|
+
if (options.cacheKeys) {
|
|
67
|
+
const cacheKeys = new Set(options.cacheKeys);
|
|
68
|
+
for (const key of instance.keys()) if (!cacheKeys.has(key)) instance.delete(key);
|
|
69
|
+
}
|
|
70
|
+
if (options.hashKeys) {
|
|
71
|
+
const hashKeys = new Set(options.hashKeys);
|
|
72
|
+
for (const key of hashMap.keys()) if (!hashKeys.has(key)) hashMap.delete(key);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
65
75
|
has(key) {
|
|
66
76
|
return instance.has(key);
|
|
67
77
|
},
|
|
@@ -4713,4 +4723,4 @@ function shouldSkipJsTransform(rawSource, options) {
|
|
|
4713
4723
|
return !FAST_JS_TRANSFORM_HINT_RE.test(rawSource);
|
|
4714
4724
|
}
|
|
4715
4725
|
//#endregion
|
|
4716
|
-
export { collectRuntimeClassSet as _, vitePluginName as a, refreshTailwindRuntimeState as b, createAttributeMatcher as c, _defineProperty as d, isClassContextLiteralPath as f, toCustomAttributesEntities as g, traverse as h, pluginName as i, analyzeSource as l, babelParse as m, getCompilerContext as n, Parser as o, replaceWxml as p, resolveStyleOptionsFromContext as r, generateCode as s, shouldSkipJsTransform as t, JsTokenUpdater as u, createTailwindRuntimeReadyPromise as v, ensureRuntimeClassSet as y };
|
|
4726
|
+
export { collectRuntimeClassSet as _, vitePluginName as a, refreshTailwindRuntimeState as b, createAttributeMatcher as c, _defineProperty as d, isClassContextLiteralPath as f, toCustomAttributesEntities as g, traverse as h, pluginName as i, analyzeSource as l, babelParse as m, getCompilerContext as n, Parser as o, replaceWxml as p, resolveStyleOptionsFromContext as r, generateCode as s, shouldSkipJsTransform as t, JsTokenUpdater as u, createTailwindRuntimeReadyPromise as v, md5Hash as x, ensureRuntimeClassSet as y };
|
package/dist/presets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-CQE5JJNZ.js");
|
|
4
4
|
const require_utils = require("./utils-Dolmt8EO.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-Clpkz1oR.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_chunk.__toESM(node_path);
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ht as omitUndefined } from "./v3-engine-DKBaKWGL.mjs";
|
|
2
2
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-CK84uGBp.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|