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,2 +1,19 @@
|
|
|
1
1
|
import type { TailwindV3Engine, TailwindV3ResolvedSource } from './types';
|
|
2
2
|
export declare function createTailwindV3Engine(source: TailwindV3ResolvedSource): TailwindV3Engine;
|
|
3
|
+
export declare function getTailwindV3IncrementalGenerateCacheStats(): {
|
|
4
|
+
max: number;
|
|
5
|
+
entryCandidatesMax: number;
|
|
6
|
+
entryCssBytesMax: number;
|
|
7
|
+
size: number;
|
|
8
|
+
entries: {
|
|
9
|
+
key: string;
|
|
10
|
+
candidates: number;
|
|
11
|
+
classSet: number;
|
|
12
|
+
cssBytes: number;
|
|
13
|
+
rawCssBytes: number;
|
|
14
|
+
exactResults: number;
|
|
15
|
+
}[];
|
|
16
|
+
keys: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare const getTailwindV3IncrementalGenerateCacheStatsForTest: typeof getTailwindV3IncrementalGenerateCacheStats;
|
|
19
|
+
export declare function clearTailwindV3IncrementalGenerateCacheForTest(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createTailwindV3Engine } from './generator';
|
|
1
|
+
export { clearTailwindV3IncrementalGenerateCacheForTest, createTailwindV3Engine, getTailwindV3IncrementalGenerateCacheStats, getTailwindV3IncrementalGenerateCacheStatsForTest, } from './generator';
|
|
2
2
|
export { transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp } from './miniprogram';
|
|
3
3
|
export { resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, } from './source';
|
|
4
4
|
export type { TailwindV3CandidateSource, TailwindV3Engine, TailwindV3GenerateOptions, TailwindV3GenerateResult, TailwindV3GenerateTarget, TailwindV3ResolvedSource, TailwindV3SourceOptions, } from './types';
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
import type { TailwindV4Engine, TailwindV4ResolvedSource } from './types';
|
|
2
2
|
export declare function createTailwindV4Engine(source: TailwindV4ResolvedSource): TailwindV4Engine;
|
|
3
|
+
export declare function getTailwindV4IncrementalGenerateCacheStats(): {
|
|
4
|
+
max: number;
|
|
5
|
+
entryCandidatesMax: number;
|
|
6
|
+
entryCssBytesMax: number;
|
|
7
|
+
size: number;
|
|
8
|
+
taskMax: number;
|
|
9
|
+
taskSize: number;
|
|
10
|
+
entries: {
|
|
11
|
+
key: string;
|
|
12
|
+
candidates: number;
|
|
13
|
+
classSet: number;
|
|
14
|
+
cssBytes: number;
|
|
15
|
+
rawCssBytes: number;
|
|
16
|
+
}[];
|
|
17
|
+
keys: string[];
|
|
18
|
+
taskKeys: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare const getTailwindV4IncrementalGenerateCacheStatsForTest: typeof getTailwindV4IncrementalGenerateCacheStats;
|
|
21
|
+
export declare function clearTailwindV4IncrementalGenerateCacheForTest(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { loadTailwindV4DesignSystem, resolveValidTailwindV4Candidates, } from './design-system';
|
|
2
|
-
export { createTailwindV4Engine } from './generator';
|
|
2
|
+
export { clearTailwindV4IncrementalGenerateCacheForTest, createTailwindV4Engine, getTailwindV4IncrementalGenerateCacheStats, getTailwindV4IncrementalGenerateCacheStatsForTest, } from './generator';
|
|
3
3
|
export { transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp } from './miniprogram';
|
|
4
4
|
export { resolveTailwindV4Source, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceOptionsFromPatcher, } from './source';
|
|
5
5
|
export type { TailwindV4CandidateSource, TailwindV4DesignSystem, TailwindV4Engine, TailwindV4GenerateOptions, TailwindV4GenerateResult, TailwindV4GenerateTarget, TailwindV4ResolvedSource, TailwindV4SourceOptions, } from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ft as findNearestPackageRoot, ht as omitUndefined, mt as findWorkspaceRoot, ot as createTailwindcssPatcher, p as runtimeSignaturePatchersSymbol, pt as findWorkspacePackageDir, st as readInstalledPackageMajorVersion, ut as normalizeStringListOption } from "./v3-engine-DKBaKWGL.mjs";
|
|
2
2
|
import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
require("./utils-Dolmt8EO.js");
|
|
4
4
|
let node_module = require("node:module");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_precheck = require("./precheck-30zNPRlI.js");
|
|
3
3
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
4
4
|
let magic_string = require("magic-string");
|
|
5
5
|
magic_string = require_chunk.__toESM(magic_string);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createAttributeMatcher, d as _defineProperty, f as isClassContextLiteralPath, l as analyzeSource, m as babelParse, p as replaceWxml, s as generateCode, u as JsTokenUpdater } from "./precheck-
|
|
1
|
+
import { c as createAttributeMatcher, d as _defineProperty, f as isClassContextLiteralPath, l as analyzeSource, m as babelParse, p as replaceWxml, s as generateCode, u as JsTokenUpdater } from "./precheck-CsFr1q2l.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { splitCandidateTokens } from "tailwindcss-patch";
|
|
4
4
|
import MagicString from "magic-string";
|
|
@@ -2,6 +2,7 @@ const require_chunk = require("./chunk-emK7D4bc.js");
|
|
|
2
2
|
const require_auto = require("./auto-CTp6wE5a.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
5
|
+
let lru_cache = require("lru-cache");
|
|
5
6
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
6
7
|
tailwindcss_patch = require_chunk.__toESM(tailwindcss_patch);
|
|
7
8
|
let node_fs = require("node:fs");
|
|
@@ -1884,8 +1885,12 @@ async function transformTailwindV4CssByTarget(css, target, options) {
|
|
|
1884
1885
|
}
|
|
1885
1886
|
//#endregion
|
|
1886
1887
|
//#region src/tailwindcss/v4-engine/generator.ts
|
|
1887
|
-
const
|
|
1888
|
-
const
|
|
1888
|
+
const INCREMENTAL_GENERATE_CACHE_MAX$1 = 8;
|
|
1889
|
+
const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
1890
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1 = 128;
|
|
1891
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1 = 256 * 1024;
|
|
1892
|
+
const incrementalGenerateCache$1 = new lru_cache.LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX$1 });
|
|
1893
|
+
const incrementalGenerateTaskCache = new lru_cache.LRUCache({ max: INCREMENTAL_GENERATE_TASK_CACHE_MAX });
|
|
1889
1894
|
function collectCandidates(candidates) {
|
|
1890
1895
|
return new Set(candidates ?? []);
|
|
1891
1896
|
}
|
|
@@ -1981,6 +1986,9 @@ function collectCustomPropertyValues(css) {
|
|
|
1981
1986
|
function mergeCustomPropertyValues(target, css) {
|
|
1982
1987
|
for (const [prop, value] of collectCustomPropertyValues(css)) target.set(prop, value);
|
|
1983
1988
|
}
|
|
1989
|
+
function shouldRebuildIncrementalEntry$1(cached, requestedCandidates, missingCandidates) {
|
|
1990
|
+
return cached.seenCandidates.size + missingCandidates.length > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1 || cached.css.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1 || cached.rawCss.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1 || requestedCandidates.size > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1;
|
|
1991
|
+
}
|
|
1984
1992
|
function seedIncrementalGenerateCache(options) {
|
|
1985
1993
|
const cacheKey = createIncrementalGenerateCacheKey(options.compatibleSource, options.target, options.styleOptions, options.tailwindcssV3Compatibility);
|
|
1986
1994
|
const customPropertyValues = collectCustomPropertyValues(options.compatibleSource.css);
|
|
@@ -2068,6 +2076,18 @@ function createTailwindV4Engine(source) {
|
|
|
2068
2076
|
root: cached.root,
|
|
2069
2077
|
target: cached.target
|
|
2070
2078
|
};
|
|
2079
|
+
if (shouldRebuildIncrementalEntry$1(cached, requestedCandidates, missingCandidates)) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
2080
|
+
const generated = await generateOnce(source, options);
|
|
2081
|
+
seedIncrementalGenerateCache({
|
|
2082
|
+
compatibleSource,
|
|
2083
|
+
generated,
|
|
2084
|
+
requestedCandidates,
|
|
2085
|
+
styleOptions,
|
|
2086
|
+
tailwindcssV3Compatibility: options.tailwindcssV3Compatibility,
|
|
2087
|
+
target
|
|
2088
|
+
});
|
|
2089
|
+
return generated;
|
|
2090
|
+
});
|
|
2071
2091
|
return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
2072
2092
|
const designSystem = await cached.designSystemPromise;
|
|
2073
2093
|
const normalizedMissing = normalizeRpxTextCandidates(missingCandidates);
|
|
@@ -2130,6 +2150,25 @@ function createTailwindV4Engine(source) {
|
|
|
2130
2150
|
generate
|
|
2131
2151
|
};
|
|
2132
2152
|
}
|
|
2153
|
+
function getTailwindV4IncrementalGenerateCacheStats() {
|
|
2154
|
+
return {
|
|
2155
|
+
max: INCREMENTAL_GENERATE_CACHE_MAX$1,
|
|
2156
|
+
entryCandidatesMax: INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1,
|
|
2157
|
+
entryCssBytesMax: INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1,
|
|
2158
|
+
size: incrementalGenerateCache$1.size,
|
|
2159
|
+
taskMax: INCREMENTAL_GENERATE_TASK_CACHE_MAX,
|
|
2160
|
+
taskSize: incrementalGenerateTaskCache.size,
|
|
2161
|
+
entries: [...incrementalGenerateCache$1.entries()].map(([key, entry]) => ({
|
|
2162
|
+
key,
|
|
2163
|
+
candidates: entry.seenCandidates.size,
|
|
2164
|
+
classSet: entry.classSet.size,
|
|
2165
|
+
cssBytes: entry.css.length,
|
|
2166
|
+
rawCssBytes: entry.rawCss.length
|
|
2167
|
+
})),
|
|
2168
|
+
keys: [...incrementalGenerateCache$1.keys()],
|
|
2169
|
+
taskKeys: [...incrementalGenerateTaskCache.keys()]
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2133
2172
|
//#endregion
|
|
2134
2173
|
//#region src/bundlers/shared/generator-css/config-directive.ts
|
|
2135
2174
|
function quoteCssString(value) {
|
|
@@ -3726,7 +3765,10 @@ async function transformTailwindV3CssByTarget(css, target, options) {
|
|
|
3726
3765
|
}
|
|
3727
3766
|
//#endregion
|
|
3728
3767
|
//#region src/tailwindcss/v3-engine/generator.ts
|
|
3729
|
-
const
|
|
3768
|
+
const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
3769
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 128;
|
|
3770
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 256 * 1024;
|
|
3771
|
+
const incrementalGenerateCache = new lru_cache.LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX });
|
|
3730
3772
|
const patchRawStyleGenerator = typeof tailwindcss_patch.generateTailwindV3RawStyle === "function" ? tailwindcss_patch.generateTailwindV3RawStyle : void 0;
|
|
3731
3773
|
function isTailwindV3PatchResolutionError(error, packageName) {
|
|
3732
3774
|
if (!error || typeof error !== "object") return false;
|
|
@@ -3850,6 +3892,48 @@ function sortCandidates(candidates) {
|
|
|
3850
3892
|
return a < z ? -1 : 1;
|
|
3851
3893
|
});
|
|
3852
3894
|
}
|
|
3895
|
+
function createRequestedCandidatesCacheKey(candidates) {
|
|
3896
|
+
return sortCandidates(candidates).join("\n");
|
|
3897
|
+
}
|
|
3898
|
+
function createIncrementalResultsCache() {
|
|
3899
|
+
return new lru_cache.LRUCache({ max: 16 });
|
|
3900
|
+
}
|
|
3901
|
+
function replaceIncrementalEntry(entry, candidates, generated) {
|
|
3902
|
+
if (!generated.context) return;
|
|
3903
|
+
entry.context = generated.context;
|
|
3904
|
+
entry.seenCandidates = new Set(candidates);
|
|
3905
|
+
entry.classSet = new Set(generated.classSet);
|
|
3906
|
+
entry.css = generated.css;
|
|
3907
|
+
entry.rawCss = generated.rawCss;
|
|
3908
|
+
entry.dependencies = generated.dependencies;
|
|
3909
|
+
entry.resultsByCandidates.clear();
|
|
3910
|
+
}
|
|
3911
|
+
function seedIncrementalResult(entry, candidates, result) {
|
|
3912
|
+
entry.resultsByCandidates.set(createRequestedCandidatesCacheKey(candidates), {
|
|
3913
|
+
classSet: new Set(result.classSet),
|
|
3914
|
+
css: result.css,
|
|
3915
|
+
rawCss: result.rawCss,
|
|
3916
|
+
dependencies: result.dependencies
|
|
3917
|
+
});
|
|
3918
|
+
}
|
|
3919
|
+
function createGenerateResultFromCache(cached, result, candidates) {
|
|
3920
|
+
return {
|
|
3921
|
+
css: result.css,
|
|
3922
|
+
rawCss: result.rawCss,
|
|
3923
|
+
incrementalCss: "",
|
|
3924
|
+
incrementalRawCss: "",
|
|
3925
|
+
classSet: new Set(result.classSet),
|
|
3926
|
+
rawCandidates: new Set(candidates),
|
|
3927
|
+
dependencies: result.dependencies,
|
|
3928
|
+
sources: [],
|
|
3929
|
+
root: null,
|
|
3930
|
+
target: cached.target,
|
|
3931
|
+
version: 3
|
|
3932
|
+
};
|
|
3933
|
+
}
|
|
3934
|
+
function shouldRebuildIncrementalEntry(cached, requestedCandidates, missingCandidates) {
|
|
3935
|
+
return cached.seenCandidates.size + missingCandidates.length > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX || cached.css.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX || cached.rawCss.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX || requestedCandidates.size > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX;
|
|
3936
|
+
}
|
|
3853
3937
|
function appendUtilityRules(root, context, rules) {
|
|
3854
3938
|
const sortedRules = context.offsets.sort(rules);
|
|
3855
3939
|
for (const [sort, rule] of sortedRules) {
|
|
@@ -3979,38 +4063,31 @@ function createTailwindV3Engine(source) {
|
|
|
3979
4063
|
if (cached) {
|
|
3980
4064
|
if (hasRemovedCandidates(cached.seenCandidates, requestedCandidates)) {
|
|
3981
4065
|
const generated = await generateOnce(source, options);
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
seenCandidates: new Set(requestedCandidates),
|
|
3985
|
-
classSet: new Set(generated.classSet),
|
|
3986
|
-
css: generated.css,
|
|
3987
|
-
rawCss: generated.rawCss,
|
|
3988
|
-
dependencies: generated.dependencies,
|
|
3989
|
-
target: generated.target
|
|
3990
|
-
});
|
|
4066
|
+
replaceIncrementalEntry(cached, requestedCandidates, generated);
|
|
4067
|
+
seedIncrementalResult(cached, requestedCandidates, generated);
|
|
3991
4068
|
return generated;
|
|
3992
4069
|
}
|
|
4070
|
+
const requestedCacheKey = createRequestedCandidatesCacheKey(requestedCandidates);
|
|
4071
|
+
const cachedResult = cached.resultsByCandidates.get(requestedCacheKey);
|
|
4072
|
+
if (cachedResult) return createGenerateResultFromCache(cached, cachedResult, requestedCandidates);
|
|
3993
4073
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
3994
|
-
if (missingCandidates.length === 0)
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
target: cached.target,
|
|
4005
|
-
version: 3
|
|
4006
|
-
};
|
|
4074
|
+
if (missingCandidates.length === 0) {
|
|
4075
|
+
seedIncrementalResult(cached, requestedCandidates, cached);
|
|
4076
|
+
return createGenerateResultFromCache(cached, cached, requestedCandidates);
|
|
4077
|
+
}
|
|
4078
|
+
if (shouldRebuildIncrementalEntry(cached, requestedCandidates, missingCandidates)) {
|
|
4079
|
+
const generated = await generateOnce(source, options);
|
|
4080
|
+
replaceIncrementalEntry(cached, requestedCandidates, generated);
|
|
4081
|
+
seedIncrementalResult(cached, requestedCandidates, generated);
|
|
4082
|
+
return generated;
|
|
4083
|
+
}
|
|
4007
4084
|
const generated = await generateIncrementalMissingUtilities(cached.context, missingCandidates, target, styleOptions, options.bareArbitraryValues);
|
|
4008
4085
|
for (const candidate of missingCandidates) cached.seenCandidates.add(candidate);
|
|
4009
4086
|
for (const className of generated.classSet) cached.classSet.add(className);
|
|
4010
4087
|
cached.css = [cached.css, generated.css].filter(Boolean).join("\n");
|
|
4011
4088
|
cached.rawCss = [cached.rawCss, generated.rawCss].filter(Boolean).join("\n");
|
|
4012
4089
|
cached.dependencies = [...new Set([...cached.dependencies, ...generated.dependencies])];
|
|
4013
|
-
|
|
4090
|
+
const result = {
|
|
4014
4091
|
css: cached.css,
|
|
4015
4092
|
rawCss: cached.rawCss,
|
|
4016
4093
|
incrementalCss: generated.css,
|
|
@@ -4023,17 +4100,23 @@ function createTailwindV3Engine(source) {
|
|
|
4023
4100
|
target: cached.target,
|
|
4024
4101
|
version: 3
|
|
4025
4102
|
};
|
|
4103
|
+
seedIncrementalResult(cached, requestedCandidates, result);
|
|
4104
|
+
return result;
|
|
4026
4105
|
}
|
|
4027
4106
|
const generated = await generateOnce(source, options);
|
|
4028
|
-
|
|
4107
|
+
const resultsByCandidates = createIncrementalResultsCache();
|
|
4108
|
+
const entry = {
|
|
4029
4109
|
context: generated.context,
|
|
4030
4110
|
seenCandidates: new Set(requestedCandidates),
|
|
4031
4111
|
classSet: new Set(generated.classSet),
|
|
4032
4112
|
css: generated.css,
|
|
4033
4113
|
rawCss: generated.rawCss,
|
|
4034
4114
|
dependencies: generated.dependencies,
|
|
4115
|
+
resultsByCandidates,
|
|
4035
4116
|
target: generated.target
|
|
4036
|
-
}
|
|
4117
|
+
};
|
|
4118
|
+
seedIncrementalResult(entry, requestedCandidates, generated);
|
|
4119
|
+
incrementalGenerateCache.set(cacheKey, entry);
|
|
4037
4120
|
return generated;
|
|
4038
4121
|
}
|
|
4039
4122
|
async function generate(options = {}) {
|
|
@@ -4051,6 +4134,23 @@ function createTailwindV3Engine(source) {
|
|
|
4051
4134
|
generate
|
|
4052
4135
|
};
|
|
4053
4136
|
}
|
|
4137
|
+
function getTailwindV3IncrementalGenerateCacheStats() {
|
|
4138
|
+
return {
|
|
4139
|
+
max: INCREMENTAL_GENERATE_CACHE_MAX,
|
|
4140
|
+
entryCandidatesMax: INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX,
|
|
4141
|
+
entryCssBytesMax: INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX,
|
|
4142
|
+
size: incrementalGenerateCache.size,
|
|
4143
|
+
entries: [...incrementalGenerateCache.entries()].map(([key, entry]) => ({
|
|
4144
|
+
key,
|
|
4145
|
+
candidates: entry.seenCandidates.size,
|
|
4146
|
+
classSet: entry.classSet.size,
|
|
4147
|
+
cssBytes: entry.css.length,
|
|
4148
|
+
rawCssBytes: entry.rawCss.length,
|
|
4149
|
+
exactResults: entry.resultsByCandidates.size
|
|
4150
|
+
})),
|
|
4151
|
+
keys: [...incrementalGenerateCache.keys()]
|
|
4152
|
+
};
|
|
4153
|
+
}
|
|
4054
4154
|
//#endregion
|
|
4055
4155
|
//#region src/tailwindcss/v3-engine/source.ts
|
|
4056
4156
|
const DEFAULT_TAILWIND_V3_CSS = [
|
|
@@ -4102,6 +4202,7 @@ async function resolveTailwindV3Source(options = {}) {
|
|
|
4102
4202
|
const cssConfig = resolveCssConfig(options.css, base);
|
|
4103
4203
|
const config = resolveOptionalPath(options.config, base) ?? cssConfig.config;
|
|
4104
4204
|
const cwd = options.cwd ?? (config ? node_path.default.dirname(config) : projectRoot);
|
|
4205
|
+
const explicitConfigObject = normalizeLoadedConfig(options.configObject);
|
|
4105
4206
|
const loaded = await (0, tailwindcss_config.loadConfig)(omitUndefined({
|
|
4106
4207
|
config,
|
|
4107
4208
|
cwd
|
|
@@ -4113,7 +4214,7 @@ async function resolveTailwindV3Source(options = {}) {
|
|
|
4113
4214
|
base,
|
|
4114
4215
|
css: cssConfig.css ?? options.css ?? DEFAULT_TAILWIND_V3_CSS,
|
|
4115
4216
|
config: loaded?.filepath ?? config,
|
|
4116
|
-
configObject: normalizeLoadedConfig(loaded?.config),
|
|
4217
|
+
configObject: explicitConfigObject ?? normalizeLoadedConfig(loaded?.config),
|
|
4117
4218
|
dependencies: loaded?.filepath ? [loaded.filepath] : [],
|
|
4118
4219
|
packageName: options.packageName ?? "tailwindcss",
|
|
4119
4220
|
postcssPlugin: options.postcssPlugin ?? options.packageName ?? "tailwindcss"
|
|
@@ -4242,6 +4343,18 @@ Object.defineProperty(exports, "getRuntimeClassSetSignatureWithSources", {
|
|
|
4242
4343
|
return getRuntimeClassSetSignatureWithSources;
|
|
4243
4344
|
}
|
|
4244
4345
|
});
|
|
4346
|
+
Object.defineProperty(exports, "getTailwindV3IncrementalGenerateCacheStats", {
|
|
4347
|
+
enumerable: true,
|
|
4348
|
+
get: function() {
|
|
4349
|
+
return getTailwindV3IncrementalGenerateCacheStats;
|
|
4350
|
+
}
|
|
4351
|
+
});
|
|
4352
|
+
Object.defineProperty(exports, "getTailwindV4IncrementalGenerateCacheStats", {
|
|
4353
|
+
enumerable: true,
|
|
4354
|
+
get: function() {
|
|
4355
|
+
return getTailwindV4IncrementalGenerateCacheStats;
|
|
4356
|
+
}
|
|
4357
|
+
});
|
|
4245
4358
|
Object.defineProperty(exports, "hasLocalCssImport", {
|
|
4246
4359
|
enumerable: true,
|
|
4247
4360
|
get: function() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { a as transformCssMacroCss, n as hasCssMacroTailwindPlugin, o as withCssMacroStyleOptions, r as hasCssMacroTailwindV4Directive, t as hasCssMacroStyleOptions } from "./auto-Cl8_hsG6.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { createStyleHandler, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss } from "@weapp-tailwindcss/postcss";
|
|
4
|
+
import { LRUCache } from "lru-cache";
|
|
4
5
|
import * as tailwindcssPatch from "tailwindcss-patch";
|
|
5
6
|
import { TailwindcssPatcher, createTailwindV4Engine, extractRawCandidates, extractSourceCandidates, isBareArbitraryValuesEnabled, loadTailwindV4DesignSystem, resolveBareArbitraryValueCandidate, resolveProjectSourceFiles, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions } from "tailwindcss-patch";
|
|
6
7
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
@@ -1877,8 +1878,12 @@ async function transformTailwindV4CssByTarget(css, target, options) {
|
|
|
1877
1878
|
}
|
|
1878
1879
|
//#endregion
|
|
1879
1880
|
//#region src/tailwindcss/v4-engine/generator.ts
|
|
1880
|
-
const
|
|
1881
|
-
const
|
|
1881
|
+
const INCREMENTAL_GENERATE_CACHE_MAX$1 = 8;
|
|
1882
|
+
const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
1883
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1 = 128;
|
|
1884
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1 = 256 * 1024;
|
|
1885
|
+
const incrementalGenerateCache$1 = new LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX$1 });
|
|
1886
|
+
const incrementalGenerateTaskCache = new LRUCache({ max: INCREMENTAL_GENERATE_TASK_CACHE_MAX });
|
|
1882
1887
|
function collectCandidates(candidates) {
|
|
1883
1888
|
return new Set(candidates ?? []);
|
|
1884
1889
|
}
|
|
@@ -1974,6 +1979,9 @@ function collectCustomPropertyValues(css) {
|
|
|
1974
1979
|
function mergeCustomPropertyValues(target, css) {
|
|
1975
1980
|
for (const [prop, value] of collectCustomPropertyValues(css)) target.set(prop, value);
|
|
1976
1981
|
}
|
|
1982
|
+
function shouldRebuildIncrementalEntry$1(cached, requestedCandidates, missingCandidates) {
|
|
1983
|
+
return cached.seenCandidates.size + missingCandidates.length > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1 || cached.css.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1 || cached.rawCss.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1 || requestedCandidates.size > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1;
|
|
1984
|
+
}
|
|
1977
1985
|
function seedIncrementalGenerateCache(options) {
|
|
1978
1986
|
const cacheKey = createIncrementalGenerateCacheKey(options.compatibleSource, options.target, options.styleOptions, options.tailwindcssV3Compatibility);
|
|
1979
1987
|
const customPropertyValues = collectCustomPropertyValues(options.compatibleSource.css);
|
|
@@ -2061,6 +2069,18 @@ function createTailwindV4Engine$1(source) {
|
|
|
2061
2069
|
root: cached.root,
|
|
2062
2070
|
target: cached.target
|
|
2063
2071
|
};
|
|
2072
|
+
if (shouldRebuildIncrementalEntry$1(cached, requestedCandidates, missingCandidates)) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
2073
|
+
const generated = await generateOnce(source, options);
|
|
2074
|
+
seedIncrementalGenerateCache({
|
|
2075
|
+
compatibleSource,
|
|
2076
|
+
generated,
|
|
2077
|
+
requestedCandidates,
|
|
2078
|
+
styleOptions,
|
|
2079
|
+
tailwindcssV3Compatibility: options.tailwindcssV3Compatibility,
|
|
2080
|
+
target
|
|
2081
|
+
});
|
|
2082
|
+
return generated;
|
|
2083
|
+
});
|
|
2064
2084
|
return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
2065
2085
|
const designSystem = await cached.designSystemPromise;
|
|
2066
2086
|
const normalizedMissing = normalizeRpxTextCandidates(missingCandidates);
|
|
@@ -2123,6 +2143,25 @@ function createTailwindV4Engine$1(source) {
|
|
|
2123
2143
|
generate
|
|
2124
2144
|
};
|
|
2125
2145
|
}
|
|
2146
|
+
function getTailwindV4IncrementalGenerateCacheStats() {
|
|
2147
|
+
return {
|
|
2148
|
+
max: INCREMENTAL_GENERATE_CACHE_MAX$1,
|
|
2149
|
+
entryCandidatesMax: INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX$1,
|
|
2150
|
+
entryCssBytesMax: INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX$1,
|
|
2151
|
+
size: incrementalGenerateCache$1.size,
|
|
2152
|
+
taskMax: INCREMENTAL_GENERATE_TASK_CACHE_MAX,
|
|
2153
|
+
taskSize: incrementalGenerateTaskCache.size,
|
|
2154
|
+
entries: [...incrementalGenerateCache$1.entries()].map(([key, entry]) => ({
|
|
2155
|
+
key,
|
|
2156
|
+
candidates: entry.seenCandidates.size,
|
|
2157
|
+
classSet: entry.classSet.size,
|
|
2158
|
+
cssBytes: entry.css.length,
|
|
2159
|
+
rawCssBytes: entry.rawCss.length
|
|
2160
|
+
})),
|
|
2161
|
+
keys: [...incrementalGenerateCache$1.keys()],
|
|
2162
|
+
taskKeys: [...incrementalGenerateTaskCache.keys()]
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2126
2165
|
//#endregion
|
|
2127
2166
|
//#region src/bundlers/shared/generator-css/config-directive.ts
|
|
2128
2167
|
function quoteCssString(value) {
|
|
@@ -3719,7 +3758,10 @@ async function transformTailwindV3CssByTarget(css, target, options) {
|
|
|
3719
3758
|
}
|
|
3720
3759
|
//#endregion
|
|
3721
3760
|
//#region src/tailwindcss/v3-engine/generator.ts
|
|
3722
|
-
const
|
|
3761
|
+
const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
3762
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 128;
|
|
3763
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 256 * 1024;
|
|
3764
|
+
const incrementalGenerateCache = new LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX });
|
|
3723
3765
|
const patchRawStyleGenerator = typeof tailwindcssPatch.generateTailwindV3RawStyle === "function" ? tailwindcssPatch.generateTailwindV3RawStyle : void 0;
|
|
3724
3766
|
function isTailwindV3PatchResolutionError(error, packageName) {
|
|
3725
3767
|
if (!error || typeof error !== "object") return false;
|
|
@@ -3843,6 +3885,48 @@ function sortCandidates(candidates) {
|
|
|
3843
3885
|
return a < z ? -1 : 1;
|
|
3844
3886
|
});
|
|
3845
3887
|
}
|
|
3888
|
+
function createRequestedCandidatesCacheKey(candidates) {
|
|
3889
|
+
return sortCandidates(candidates).join("\n");
|
|
3890
|
+
}
|
|
3891
|
+
function createIncrementalResultsCache() {
|
|
3892
|
+
return new LRUCache({ max: 16 });
|
|
3893
|
+
}
|
|
3894
|
+
function replaceIncrementalEntry(entry, candidates, generated) {
|
|
3895
|
+
if (!generated.context) return;
|
|
3896
|
+
entry.context = generated.context;
|
|
3897
|
+
entry.seenCandidates = new Set(candidates);
|
|
3898
|
+
entry.classSet = new Set(generated.classSet);
|
|
3899
|
+
entry.css = generated.css;
|
|
3900
|
+
entry.rawCss = generated.rawCss;
|
|
3901
|
+
entry.dependencies = generated.dependencies;
|
|
3902
|
+
entry.resultsByCandidates.clear();
|
|
3903
|
+
}
|
|
3904
|
+
function seedIncrementalResult(entry, candidates, result) {
|
|
3905
|
+
entry.resultsByCandidates.set(createRequestedCandidatesCacheKey(candidates), {
|
|
3906
|
+
classSet: new Set(result.classSet),
|
|
3907
|
+
css: result.css,
|
|
3908
|
+
rawCss: result.rawCss,
|
|
3909
|
+
dependencies: result.dependencies
|
|
3910
|
+
});
|
|
3911
|
+
}
|
|
3912
|
+
function createGenerateResultFromCache(cached, result, candidates) {
|
|
3913
|
+
return {
|
|
3914
|
+
css: result.css,
|
|
3915
|
+
rawCss: result.rawCss,
|
|
3916
|
+
incrementalCss: "",
|
|
3917
|
+
incrementalRawCss: "",
|
|
3918
|
+
classSet: new Set(result.classSet),
|
|
3919
|
+
rawCandidates: new Set(candidates),
|
|
3920
|
+
dependencies: result.dependencies,
|
|
3921
|
+
sources: [],
|
|
3922
|
+
root: null,
|
|
3923
|
+
target: cached.target,
|
|
3924
|
+
version: 3
|
|
3925
|
+
};
|
|
3926
|
+
}
|
|
3927
|
+
function shouldRebuildIncrementalEntry(cached, requestedCandidates, missingCandidates) {
|
|
3928
|
+
return cached.seenCandidates.size + missingCandidates.length > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX || cached.css.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX || cached.rawCss.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX || requestedCandidates.size > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX;
|
|
3929
|
+
}
|
|
3846
3930
|
function appendUtilityRules(root, context, rules) {
|
|
3847
3931
|
const sortedRules = context.offsets.sort(rules);
|
|
3848
3932
|
for (const [sort, rule] of sortedRules) {
|
|
@@ -3972,38 +4056,31 @@ function createTailwindV3Engine(source) {
|
|
|
3972
4056
|
if (cached) {
|
|
3973
4057
|
if (hasRemovedCandidates(cached.seenCandidates, requestedCandidates)) {
|
|
3974
4058
|
const generated = await generateOnce(source, options);
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
seenCandidates: new Set(requestedCandidates),
|
|
3978
|
-
classSet: new Set(generated.classSet),
|
|
3979
|
-
css: generated.css,
|
|
3980
|
-
rawCss: generated.rawCss,
|
|
3981
|
-
dependencies: generated.dependencies,
|
|
3982
|
-
target: generated.target
|
|
3983
|
-
});
|
|
4059
|
+
replaceIncrementalEntry(cached, requestedCandidates, generated);
|
|
4060
|
+
seedIncrementalResult(cached, requestedCandidates, generated);
|
|
3984
4061
|
return generated;
|
|
3985
4062
|
}
|
|
4063
|
+
const requestedCacheKey = createRequestedCandidatesCacheKey(requestedCandidates);
|
|
4064
|
+
const cachedResult = cached.resultsByCandidates.get(requestedCacheKey);
|
|
4065
|
+
if (cachedResult) return createGenerateResultFromCache(cached, cachedResult, requestedCandidates);
|
|
3986
4066
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
3987
|
-
if (missingCandidates.length === 0)
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
target: cached.target,
|
|
3998
|
-
version: 3
|
|
3999
|
-
};
|
|
4067
|
+
if (missingCandidates.length === 0) {
|
|
4068
|
+
seedIncrementalResult(cached, requestedCandidates, cached);
|
|
4069
|
+
return createGenerateResultFromCache(cached, cached, requestedCandidates);
|
|
4070
|
+
}
|
|
4071
|
+
if (shouldRebuildIncrementalEntry(cached, requestedCandidates, missingCandidates)) {
|
|
4072
|
+
const generated = await generateOnce(source, options);
|
|
4073
|
+
replaceIncrementalEntry(cached, requestedCandidates, generated);
|
|
4074
|
+
seedIncrementalResult(cached, requestedCandidates, generated);
|
|
4075
|
+
return generated;
|
|
4076
|
+
}
|
|
4000
4077
|
const generated = await generateIncrementalMissingUtilities(cached.context, missingCandidates, target, styleOptions, options.bareArbitraryValues);
|
|
4001
4078
|
for (const candidate of missingCandidates) cached.seenCandidates.add(candidate);
|
|
4002
4079
|
for (const className of generated.classSet) cached.classSet.add(className);
|
|
4003
4080
|
cached.css = [cached.css, generated.css].filter(Boolean).join("\n");
|
|
4004
4081
|
cached.rawCss = [cached.rawCss, generated.rawCss].filter(Boolean).join("\n");
|
|
4005
4082
|
cached.dependencies = [...new Set([...cached.dependencies, ...generated.dependencies])];
|
|
4006
|
-
|
|
4083
|
+
const result = {
|
|
4007
4084
|
css: cached.css,
|
|
4008
4085
|
rawCss: cached.rawCss,
|
|
4009
4086
|
incrementalCss: generated.css,
|
|
@@ -4016,17 +4093,23 @@ function createTailwindV3Engine(source) {
|
|
|
4016
4093
|
target: cached.target,
|
|
4017
4094
|
version: 3
|
|
4018
4095
|
};
|
|
4096
|
+
seedIncrementalResult(cached, requestedCandidates, result);
|
|
4097
|
+
return result;
|
|
4019
4098
|
}
|
|
4020
4099
|
const generated = await generateOnce(source, options);
|
|
4021
|
-
|
|
4100
|
+
const resultsByCandidates = createIncrementalResultsCache();
|
|
4101
|
+
const entry = {
|
|
4022
4102
|
context: generated.context,
|
|
4023
4103
|
seenCandidates: new Set(requestedCandidates),
|
|
4024
4104
|
classSet: new Set(generated.classSet),
|
|
4025
4105
|
css: generated.css,
|
|
4026
4106
|
rawCss: generated.rawCss,
|
|
4027
4107
|
dependencies: generated.dependencies,
|
|
4108
|
+
resultsByCandidates,
|
|
4028
4109
|
target: generated.target
|
|
4029
|
-
}
|
|
4110
|
+
};
|
|
4111
|
+
seedIncrementalResult(entry, requestedCandidates, generated);
|
|
4112
|
+
incrementalGenerateCache.set(cacheKey, entry);
|
|
4030
4113
|
return generated;
|
|
4031
4114
|
}
|
|
4032
4115
|
async function generate(options = {}) {
|
|
@@ -4044,6 +4127,23 @@ function createTailwindV3Engine(source) {
|
|
|
4044
4127
|
generate
|
|
4045
4128
|
};
|
|
4046
4129
|
}
|
|
4130
|
+
function getTailwindV3IncrementalGenerateCacheStats() {
|
|
4131
|
+
return {
|
|
4132
|
+
max: INCREMENTAL_GENERATE_CACHE_MAX,
|
|
4133
|
+
entryCandidatesMax: INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX,
|
|
4134
|
+
entryCssBytesMax: INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX,
|
|
4135
|
+
size: incrementalGenerateCache.size,
|
|
4136
|
+
entries: [...incrementalGenerateCache.entries()].map(([key, entry]) => ({
|
|
4137
|
+
key,
|
|
4138
|
+
candidates: entry.seenCandidates.size,
|
|
4139
|
+
classSet: entry.classSet.size,
|
|
4140
|
+
cssBytes: entry.css.length,
|
|
4141
|
+
rawCssBytes: entry.rawCss.length,
|
|
4142
|
+
exactResults: entry.resultsByCandidates.size
|
|
4143
|
+
})),
|
|
4144
|
+
keys: [...incrementalGenerateCache.keys()]
|
|
4145
|
+
};
|
|
4146
|
+
}
|
|
4047
4147
|
//#endregion
|
|
4048
4148
|
//#region src/tailwindcss/v3-engine/source.ts
|
|
4049
4149
|
const DEFAULT_TAILWIND_V3_CSS = [
|
|
@@ -4095,6 +4195,7 @@ async function resolveTailwindV3Source(options = {}) {
|
|
|
4095
4195
|
const cssConfig = resolveCssConfig(options.css, base);
|
|
4096
4196
|
const config = resolveOptionalPath(options.config, base) ?? cssConfig.config;
|
|
4097
4197
|
const cwd = options.cwd ?? (config ? path.dirname(config) : projectRoot);
|
|
4198
|
+
const explicitConfigObject = normalizeLoadedConfig(options.configObject);
|
|
4098
4199
|
const loaded = await loadConfig(omitUndefined({
|
|
4099
4200
|
config,
|
|
4100
4201
|
cwd
|
|
@@ -4106,7 +4207,7 @@ async function resolveTailwindV3Source(options = {}) {
|
|
|
4106
4207
|
base,
|
|
4107
4208
|
css: cssConfig.css ?? options.css ?? DEFAULT_TAILWIND_V3_CSS,
|
|
4108
4209
|
config: loaded?.filepath ?? config,
|
|
4109
|
-
configObject: normalizeLoadedConfig(loaded?.config),
|
|
4210
|
+
configObject: explicitConfigObject ?? normalizeLoadedConfig(loaded?.config),
|
|
4110
4211
|
dependencies: loaded?.filepath ? [loaded.filepath] : [],
|
|
4111
4212
|
packageName: options.packageName ?? "tailwindcss",
|
|
4112
4213
|
postcssPlugin: options.postcssPlugin ?? options.packageName ?? "tailwindcss"
|
|
@@ -4127,4 +4228,4 @@ function resolveTailwindV3SourceFromPatcher(patcher) {
|
|
|
4127
4228
|
return resolveTailwindV3Source(resolveTailwindV3SourceOptionsFromPatcher(patcher));
|
|
4128
4229
|
}
|
|
4129
4230
|
//#endregion
|
|
4130
|
-
export {
|
|
4231
|
+
export { FULL_SOURCE_SCAN_EXTENSION_RE as $, normalizeTailwindSourceForGenerator as A, splitTailwindGeneratedCssByBanner as B, resolveTailwindV4SourceOptionsFromPatcher as C, hasTailwindSourceDirectives as D, hasTailwindRootDirectives as E, VITE_MARKER_RE as F, normalizeConfigDirective as G, stripGeneratorPlaceholderMarkers as H, createCssAppend as I, getTailwindV4IncrementalGenerateCacheStats as J, prependConfigDirective as K, hasTailwindGeneratedCss as L, parseImportRequest as M, removeTailwindSourceDirectives as N, normalizeTailwindConfigDirectives as O, resolveCssEntrySource as P, loadTailwindV4DesignSystem as Q, hasTailwindGeneratedCssMarkers as R, resolveTailwindV4SourceFromPatcher as S, hasTailwindApplyDirective as T, stripTailwindBanner as U, splitTailwindV4GeneratedCssBySourceOrder as V, stripTailwindBanners as W, transformTailwindV4CssToWeapp as X, transformTailwindV4CssByTarget as Y, filterUnsupportedMiniProgramTailwindV4Candidates as Z, resolveTailwindV4EntriesFromCss as _, getTailwindV3IncrementalGenerateCacheStats as a, createDebug as at, resolveTailwindV4Source$1 as b, ensureTailwindcssRuntimePatch as c, findTailwindConfig as ct, getRuntimeClassSetSignatureWithSources as d, resolveBooleanObjectOption as dt, isFileMatchedByTailwindSourceEntries as et, invalidateRuntimeClassSet as f, findNearestPackageRoot as ft, discoverTailwindV4CssEntries as g, resolveViteSourceScanEntries as h, omitUndefined as ht, createTailwindV3Engine as i, toPosixPath as it, normalizeTailwindV3CssEntrySource as j, normalizeTailwindSourceDirectives as k, getRuntimeClassSetCacheEntry as l, resolveTailwindcssOptions as lt, createViteSourceScanMatcher as m, findWorkspaceRoot as mt, resolveTailwindV3SourceFromPatcher as n, resolveSourceScanPath as nt, transformTailwindV3CssByTarget as o, createTailwindcssPatcher as ot, runtimeSignaturePatchersSymbol as p, findWorkspacePackageDir as pt, createTailwindV4Engine$1 as q, resolveTailwindV3SourceOptionsFromPatcher as r, resolveTailwindV4CssSourceBase as rt, transformTailwindV3CssToWeapp as s, readInstalledPackageMajorVersion as st, resolveTailwindV3Source as t, normalizeLegacyContentEntries as tt, getRuntimeClassSetSignature as u, normalizeStringListOption as ut, resolveTailwindV4EntriesFromCssCached as v, hasLocalCssImport as w, resolveTailwindV4SourceFromPatchOptions as x, resolveViteTailwindV4CssDependencies as y, splitGeneratorPlaceholderCssBySourceOrder as z };
|