weapp-tailwindcss 5.2.10 → 5.2.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/bundlers/shared/generator-css/user-css/source-fragments.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -1
- package/dist/cli.cjs +372 -293
- package/dist/cli.js +20 -11
- package/dist/{context-DbL0d-zB.js → context-DW4ukjx4.js} +19 -8
- package/dist/{context-C3TryIjF.cjs → context-zWINV_E2.cjs} +17 -11
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-imports-DfNC3e6a.cjs → css-imports-BFMU7Hpd.cjs} +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +1 -1
- package/dist/defaults.cjs +2 -0
- package/dist/defaults.js +2 -0
- package/dist/framework.cjs +1 -1
- package/dist/{generator-BLpOsd5O.js → generator-C2UFjlZ1.js} +36 -11
- package/dist/{generator-B0dCFlP1.cjs → generator-CwMI20jy.cjs} +37 -12
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-G6af_vyo.cjs → gulp-CWFxs2lE.cjs} +16 -13
- package/dist/{gulp-CB_GZky7.js → gulp-CltYkglj.js} +12 -9
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-gbPzjYTj.cjs → hmr-timing-BjOxhci8.cjs} +5 -5
- package/dist/{hmr-timing-CZu2ITV8.js → hmr-timing-D6JKLBCD.js} +35 -20
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{object-Bvy6-w9r.js → object-B-8IHefx.js} +4 -4
- package/dist/{object-C_Vr6_S5.cjs → object-DbHtAXRk.cjs} +4 -4
- package/dist/{options-zpZez7qe.cjs → options-CSqLm6U2.cjs} +2 -2
- package/dist/{pipeline-helpers-CtIXw85G.cjs → pipeline-helpers-Cj9ZzHaY.cjs} +25 -10
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +6 -5
- package/dist/presets.js +4 -3
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-CVvi-lCc.cjs → rolldown-runtime-Ctb5zv51.cjs} +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/{source-candidate-scan-signature-DFZlYd3t.js → source-candidate-scan-signature-DQZ_DkgW.js} +5 -4
- package/dist/{source-candidate-scan-signature-CTX7eBJX.cjs → source-candidate-scan-signature-uRHl5Ne9.cjs} +6 -5
- package/dist/{style-options-COpQc8fr.cjs → style-options-D0NukP02.cjs} +9 -4
- package/dist/{tailwindcss-LtnGCxF0.cjs → tailwindcss-B3lqgbln.cjs} +17 -13
- package/dist/{tailwindcss-2zdmASlM.js → tailwindcss-vbApajUH.js} +13 -10
- package/dist/{transform-BlsDWgjt.js → transform-52FLRu-0.js} +2 -2
- package/dist/{transform-9wbmvHcC.cjs → transform-BiHG42Rp.cjs} +2 -2
- package/dist/types/user-defined-options/general.d.ts +2 -0
- package/dist/{v4-generation-core-BVd_4348.cjs → v4-generation-core-2AuNMweK.cjs} +36 -21
- package/dist/{vite-DjU_5LY6.cjs → vite-BLB7vjKQ.cjs} +99 -46
- package/dist/{vite-cIvaBul_.js → vite-q3ilYV7x.js} +94 -41
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-BZGubvuJ.cjs → watch-dependencies-DLZDrWdH.cjs} +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +10 -9
- package/dist/weapp-tw-runtime-classset-loader.cjs +4 -3
- package/dist/{webpack-CvKV7U7L.js → webpack-DExB8tzB.js} +36 -18
- package/dist/{webpack-B9lRT1no.cjs → webpack-Jn4FJT6y.cjs} +40 -31
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/{wxml-CWJc0yY-.js → wxml-B7OAVpXJ.js} +10 -6
- package/dist/{wxml-DUIdXCVa.cjs → wxml-CQmBCjOR.cjs} +386 -311
- package/package.json +6 -6
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
const require_generator = require("./generator-
|
|
2
|
-
const require_options = require("./options-
|
|
1
|
+
const require_generator = require("./generator-CwMI20jy.cjs");
|
|
2
|
+
const require_options = require("./options-CSqLm6U2.cjs");
|
|
3
3
|
//#region src/context/style-options.ts
|
|
4
4
|
function normalizeStyleHandlerMajorVersion(majorVersion) {
|
|
5
5
|
return majorVersion === 4 ? 4 : void 0;
|
|
6
6
|
}
|
|
7
7
|
function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
8
8
|
const resolvedUniAppXOptions = require_options.resolveUniAppXOptions(ctx.uniAppX);
|
|
9
|
-
const
|
|
9
|
+
const generatorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions(ctx.generator, {
|
|
10
10
|
appType: ctx.appType,
|
|
11
11
|
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
12
12
|
tailwindcssMajorVersion,
|
|
13
13
|
uniAppX: resolvedUniAppXOptions
|
|
14
|
-
})
|
|
14
|
+
});
|
|
15
|
+
const branch = require_generator.resolveGeneratorRuntimeBranch(generatorOptions, {
|
|
15
16
|
appType: ctx.appType,
|
|
16
17
|
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
17
18
|
tailwindcssMajorVersion,
|
|
@@ -27,7 +28,9 @@ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
|
27
28
|
cssSelectorReplacement: ctx.cssOptions?.cssSelectorReplacement ?? ctx.cssSelectorReplacement,
|
|
28
29
|
rem2rpx,
|
|
29
30
|
cssRemoveProperty: ctx.cssOptions?.cssRemoveProperty ?? ctx.cssRemoveProperty,
|
|
31
|
+
cssRemoveActivePseudoClass: ctx.cssOptions?.cssRemoveActivePseudoClass ?? ctx.cssRemoveActivePseudoClass,
|
|
30
32
|
cssRemoveHoverPseudoClass: ctx.cssOptions?.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass,
|
|
33
|
+
cssRemoveFocusPseudoClass: ctx.cssOptions?.cssRemoveFocusPseudoClass ?? ctx.cssRemoveFocusPseudoClass,
|
|
31
34
|
tailwindcssV4GradientFallback: ctx.cssOptions?.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback,
|
|
32
35
|
cssPresetEnv: ctx.cssOptions?.cssPresetEnv ?? ctx.cssPresetEnv,
|
|
33
36
|
atRules: ctx.cssOptions?.atRules ?? ctx.atRules,
|
|
@@ -49,7 +52,9 @@ function resolveStyleOptionsFromContext(ctx, tailwindcssMajorVersion) {
|
|
|
49
52
|
rem2rpx: cssOptions.rem2rpx,
|
|
50
53
|
...hasCssOptions ? { cssOptions } : {},
|
|
51
54
|
cssRemoveProperty: cssOptions.cssRemoveProperty,
|
|
55
|
+
cssRemoveActivePseudoClass: cssOptions.cssRemoveActivePseudoClass,
|
|
52
56
|
cssRemoveHoverPseudoClass: cssOptions.cssRemoveHoverPseudoClass,
|
|
57
|
+
cssRemoveFocusPseudoClass: cssOptions.cssRemoveFocusPseudoClass,
|
|
53
58
|
tailwindcssV4GradientFallback: cssOptions.tailwindcssV4GradientFallback,
|
|
54
59
|
cssPresetEnv: cssOptions.cssPresetEnv,
|
|
55
60
|
atRules: cssOptions.atRules,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_object = require("./object-
|
|
4
|
-
const require_options = require("./options-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
+
const require_generator = require("./generator-CwMI20jy.cjs");
|
|
3
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
4
|
+
const require_options = require("./options-CSqLm6U2.cjs");
|
|
5
5
|
require("./utils-CuKLf1Zv.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let node_path = require("node:path");
|
|
@@ -80,7 +80,8 @@ async function collectTailwindV4TrackedSourceFiles(tailwindRuntime) {
|
|
|
80
80
|
const files = /* @__PURE__ */ new Set();
|
|
81
81
|
for (const cssEntry of tailwindOptions?.v4?.cssEntries ?? []) {
|
|
82
82
|
if (!(0, node_fs.existsSync)(cssEntry)) continue;
|
|
83
|
-
const
|
|
83
|
+
const css = (0, node_fs.readFileSync)(cssEntry, "utf8");
|
|
84
|
+
const resolved = await require_options.resolveTailwindV4EntriesFromCssCached(css, node_path.default.dirname(cssEntry));
|
|
84
85
|
const expanded = resolved?.entries?.length ? await require_generator.expandTailwindSourceEntries(resolved.entries) : [];
|
|
85
86
|
for (const file of expanded) files.add(file);
|
|
86
87
|
}
|
|
@@ -536,10 +537,11 @@ function createTailwindcssRuntime(options) {
|
|
|
536
537
|
};
|
|
537
538
|
const normalizedBasedir = basedir ? node_path.default.resolve(basedir) : void 0;
|
|
538
539
|
const cacheRoot = require_generator.findNearestPackageRoot(normalizedBasedir) ?? normalizedBasedir ?? node_process.default.cwd();
|
|
539
|
-
if (cacheDir)
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
if (cacheDir) {
|
|
541
|
+
if (node_path.default.isAbsolute(cacheDir)) cache.dir = cacheDir;
|
|
542
|
+
else if (normalizedBasedir) cache.dir = node_path.default.resolve(normalizedBasedir, cacheDir);
|
|
543
|
+
else cache.dir = node_path.default.resolve(node_process.default.cwd(), cacheDir);
|
|
544
|
+
} else cache.dir = node_path.default.join(cacheRoot, "node_modules", ".cache", "@tailwindcss-mangle", "engine");
|
|
543
545
|
if (normalizedBasedir) cache.cwd = normalizedBasedir;
|
|
544
546
|
const resolvePaths = createDefaultResolvePaths(cache.cwd ?? normalizedBasedir ?? node_process.default.cwd());
|
|
545
547
|
const normalizedUserOptions = require_generator.normalizeTailwindcssRuntimeOptions(tailwindcssRuntimeOptions);
|
|
@@ -589,10 +591,12 @@ function createTailwindcssRuntime(options) {
|
|
|
589
591
|
searchRoots.add(parentDir);
|
|
590
592
|
}
|
|
591
593
|
const configPath = findTailwindConfig(searchRoots);
|
|
592
|
-
if (!resolvedTailwindOptions.config)
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
594
|
+
if (!resolvedTailwindOptions.config) {
|
|
595
|
+
if (configPath) resolvedTailwindOptions.config = configPath;
|
|
596
|
+
else {
|
|
597
|
+
const fallbackConfig = resolveTailwindConfigFallback(resolvedTailwindOptions.packageName, resolvedTailwindOptions.resolve.paths ?? resolvePaths);
|
|
598
|
+
if (fallbackConfig) resolvedTailwindOptions.config = fallbackConfig;
|
|
599
|
+
}
|
|
596
600
|
}
|
|
597
601
|
if (!resolvedTailwindOptions.cwd && configPath) resolvedTailwindOptions.cwd = node_path.default.dirname(configPath);
|
|
598
602
|
resolvedOptions.tailwindcss = resolvedTailwindOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as findWorkspacePackageDir, Ct as expandTailwindSourceEntries, D as resolveTailwindcssOptions, Dt as resolveCssSourceEntries, E as normalizeTailwindcssRuntimeOptions, Et as parseConfigParam, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, O as normalizeStringListOption, S as findNearestPackageRoot, St as createTailwindSourceEntryMatcher, T as normalizeExtendLengthUnits, Tt as normalizeLegacyContentEntries, b as isTailwindV4CssEntry, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveTailwindV4CssSourceBase, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as groupCssEntriesByBase, w as findWorkspaceRoot, x as normalizeCssEntries, xt as FULL_SOURCE_SCAN_PATTERN, y as guessBasedirFromEntries } from "./generator-
|
|
2
|
-
import { t as omitUndefined } from "./object-
|
|
1
|
+
import { C as findWorkspacePackageDir, Ct as expandTailwindSourceEntries, D as resolveTailwindcssOptions, Dt as resolveCssSourceEntries, E as normalizeTailwindcssRuntimeOptions, Et as parseConfigParam, Lt as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, O as normalizeStringListOption, S as findNearestPackageRoot, St as createTailwindSourceEntryMatcher, T as normalizeExtendLengthUnits, Tt as normalizeLegacyContentEntries, b as isTailwindV4CssEntry, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveTailwindV4CssSourceBase, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as groupCssEntriesByBase, w as findWorkspaceRoot, x as normalizeCssEntries, xt as FULL_SOURCE_SCAN_PATTERN, y as guessBasedirFromEntries } from "./generator-C2UFjlZ1.js";
|
|
2
|
+
import { t as omitUndefined } from "./object-B-8IHefx.js";
|
|
3
3
|
import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -1200,10 +1200,11 @@ function createTailwindcssRuntime(options) {
|
|
|
1200
1200
|
};
|
|
1201
1201
|
const normalizedBasedir = basedir ? path.resolve(basedir) : void 0;
|
|
1202
1202
|
const cacheRoot = findNearestPackageRoot(normalizedBasedir) ?? normalizedBasedir ?? process.cwd();
|
|
1203
|
-
if (cacheDir)
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1203
|
+
if (cacheDir) {
|
|
1204
|
+
if (path.isAbsolute(cacheDir)) cache.dir = cacheDir;
|
|
1205
|
+
else if (normalizedBasedir) cache.dir = path.resolve(normalizedBasedir, cacheDir);
|
|
1206
|
+
else cache.dir = path.resolve(process.cwd(), cacheDir);
|
|
1207
|
+
} else cache.dir = path.join(cacheRoot, "node_modules", ".cache", "@tailwindcss-mangle", "engine");
|
|
1207
1208
|
if (normalizedBasedir) cache.cwd = normalizedBasedir;
|
|
1208
1209
|
const resolvePaths = createDefaultResolvePaths(cache.cwd ?? normalizedBasedir ?? process.cwd());
|
|
1209
1210
|
const normalizedUserOptions = normalizeTailwindcssRuntimeOptions(tailwindcssRuntimeOptions);
|
|
@@ -1253,10 +1254,12 @@ function createTailwindcssRuntime(options) {
|
|
|
1253
1254
|
searchRoots.add(parentDir);
|
|
1254
1255
|
}
|
|
1255
1256
|
const configPath = findTailwindConfig(searchRoots);
|
|
1256
|
-
if (!resolvedTailwindOptions.config)
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1257
|
+
if (!resolvedTailwindOptions.config) {
|
|
1258
|
+
if (configPath) resolvedTailwindOptions.config = configPath;
|
|
1259
|
+
else {
|
|
1260
|
+
const fallbackConfig = resolveTailwindConfigFallback(resolvedTailwindOptions.packageName, resolvedTailwindOptions.resolve.paths ?? resolvePaths);
|
|
1261
|
+
if (fallbackConfig) resolvedTailwindOptions.config = fallbackConfig;
|
|
1262
|
+
}
|
|
1260
1263
|
}
|
|
1261
1264
|
if (!resolvedTailwindOptions.cwd && configPath) resolvedTailwindOptions.cwd = path.dirname(configPath);
|
|
1262
1265
|
resolvedOptions.tailwindcss = resolvedTailwindOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as _defineProperty } from "./object-
|
|
2
|
-
import { g as traverse$1, h as babelParse, i as analyzeSource, n as generateCode, o as JsTokenUpdater, p as replaceWxml, r as createAttributeMatcher, u as isClassContextLiteralPath } from "./wxml-
|
|
1
|
+
import { n as _defineProperty } from "./object-B-8IHefx.js";
|
|
2
|
+
import { g as traverse$1, h as babelParse, i as analyzeSource, n as generateCode, o as JsTokenUpdater, p as replaceWxml, r as createAttributeMatcher, u as isClassContextLiteralPath } from "./wxml-B7OAVpXJ.js";
|
|
3
3
|
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
4
4
|
import MagicString from "magic-string";
|
|
5
5
|
import { NodeTypes, parse } from "@vue/compiler-dom";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_object = require("./object-
|
|
2
|
-
const require_wxml = require("./wxml-
|
|
1
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
2
|
+
const require_wxml = require("./wxml-CQmBCjOR.cjs");
|
|
3
3
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
4
4
|
let _vue_compiler_dom = require("@vue/compiler-dom");
|
|
5
5
|
//#region src/uni-app-x/component-local-style-binding.ts
|
|
@@ -35,7 +35,9 @@ export interface UserDefinedOptionsGeneralPart {
|
|
|
35
35
|
cssChildCombinatorReplaceValue?: string | string[] | undefined;
|
|
36
36
|
postcssOptions?: LoadedPostcssOptions | undefined;
|
|
37
37
|
cssOptions?: CssOptions | undefined;
|
|
38
|
+
cssRemoveActivePseudoClass?: boolean | undefined;
|
|
38
39
|
cssRemoveHoverPseudoClass?: boolean | undefined;
|
|
40
|
+
cssRemoveFocusPseudoClass?: boolean | undefined;
|
|
39
41
|
cssRemoveProperty?: boolean | undefined;
|
|
40
42
|
tailwindcssV4GradientFallback?: boolean | undefined;
|
|
41
43
|
tailwindcssRuntimeOptions?: TailwindCssRuntimeOptions | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_generator = require("./generator-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
+
const require_generator = require("./generator-CwMI20jy.cjs");
|
|
3
3
|
require("./auto-DtU6f3X6.cjs");
|
|
4
|
-
const require_object = require("./object-
|
|
5
|
-
const require_options = require("./options-
|
|
6
|
-
const require_wxml = require("./wxml-
|
|
7
|
-
const require_style_options = require("./style-options-
|
|
4
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
|
+
const require_options = require("./options-CSqLm6U2.cjs");
|
|
6
|
+
const require_wxml = require("./wxml-CQmBCjOR.cjs");
|
|
7
|
+
const require_style_options = require("./style-options-D0NukP02.cjs");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_path = require("node:path");
|
|
10
10
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -201,12 +201,13 @@ async function extractScriptStringCandidates(source, extension, options) {
|
|
|
201
201
|
if (!SCRIPT_SOURCE_CANDIDATE_EXTENSIONS.has(extension)) return [];
|
|
202
202
|
const values = /* @__PURE__ */ new Set();
|
|
203
203
|
try {
|
|
204
|
-
require_wxml.
|
|
204
|
+
const ast = require_wxml.babelParse(source, {
|
|
205
205
|
cache: true,
|
|
206
206
|
cacheKey: `source-candidates:${extension}`,
|
|
207
207
|
plugins: ["jsx", "typescript"],
|
|
208
208
|
sourceType: "unambiguous"
|
|
209
|
-
})
|
|
209
|
+
});
|
|
210
|
+
require_wxml.traverse(ast, {
|
|
210
211
|
noScope: true,
|
|
211
212
|
StringLiteral(path) {
|
|
212
213
|
values.add(path.node.value);
|
|
@@ -3511,7 +3512,8 @@ function isSameTailwindV4CssSource(a, b) {
|
|
|
3511
3512
|
//#endregion
|
|
3512
3513
|
//#region src/bundlers/shared/generator-css/source-resolver/single-source.ts
|
|
3513
3514
|
async function resolveSingleTailwindV4CssSource(cssSource, sourceOptions, options = {}) {
|
|
3514
|
-
const
|
|
3515
|
+
const sourceBaseFallback = sourceOptions.base ?? sourceOptions.projectRoot ?? node_process.default.cwd();
|
|
3516
|
+
const sourceBase = require_generator.resolveTailwindV4CssSourceBase(cssSource, sourceBaseFallback);
|
|
3515
3517
|
const normalizedCssSource = normalizeTailwindV4CssSourceConfig(cssSource, sourceBase);
|
|
3516
3518
|
const source = await require_generator.resolveTailwindV4Source(createSingleTailwindV4SourceOptions(sourceOptions, {
|
|
3517
3519
|
base: sourceBase,
|
|
@@ -3529,7 +3531,8 @@ async function resolveSingleTailwindV4CssSource(cssSource, sourceOptions, option
|
|
|
3529
3531
|
}
|
|
3530
3532
|
async function resolveTailwindV4CssSourceEntries(cssSource, sourceOptions) {
|
|
3531
3533
|
if (typeof cssSource.css !== "string" || cssSource.css.length === 0) return;
|
|
3532
|
-
const
|
|
3534
|
+
const sourceBaseFallback = sourceOptions.base ?? sourceOptions.projectRoot ?? node_process.default.cwd();
|
|
3535
|
+
const sourceBase = require_generator.resolveTailwindV4CssSourceBase(cssSource, sourceBaseFallback);
|
|
3533
3536
|
return require_options.resolveTailwindV4EntriesFromCss(cssSource.css, sourceBase);
|
|
3534
3537
|
}
|
|
3535
3538
|
function countRuntimeCandidateHits(candidates, runtime) {
|
|
@@ -3775,7 +3778,8 @@ async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, fi
|
|
|
3775
3778
|
//#endregion
|
|
3776
3779
|
//#region src/bundlers/shared/generator-css/source-resolver/resolve-sources.ts
|
|
3777
3780
|
async function resolveGeneratorResolvedSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions) {
|
|
3778
|
-
const
|
|
3781
|
+
const base = resolveCssSourceBase(file, cssHandlerOptions);
|
|
3782
|
+
const cssEntrySource = require_generator.resolveCssEntrySource(rawSource, base, {
|
|
3779
3783
|
importFallback: generatorOptions?.importFallback ?? false,
|
|
3780
3784
|
removeConfig: false
|
|
3781
3785
|
});
|
|
@@ -3992,7 +3996,9 @@ function removeTailwindApplyRules(rawSource) {
|
|
|
3992
3996
|
function resolveLegacyCompatCssSource(rawSource) {
|
|
3993
3997
|
const cached = legacyCompatSourceCache.get(rawSource);
|
|
3994
3998
|
if (cached !== void 0) return cached;
|
|
3995
|
-
const
|
|
3999
|
+
const parseableSource = closeTrailingUnclosedBlocks(require_generator.stripTailwindBanners(rawSource));
|
|
4000
|
+
const source = require_generator.removeTailwindSourceDirectives(parseableSource);
|
|
4001
|
+
const resolved = closeTrailingUnclosedBlocks(require_generator.removeTailwindV4GeneratedUserCssArtifacts((0, _weapp_tailwindcss_postcss.removeUnsupportedMiniProgramAtRules)(removeTailwindApplyRules(source))));
|
|
3996
4002
|
setLimitedCacheValue(legacyCompatSourceCache, rawSource, resolved);
|
|
3997
4003
|
return resolved;
|
|
3998
4004
|
}
|
|
@@ -4022,7 +4028,8 @@ function hasContainerConfigToken(rawSource) {
|
|
|
4022
4028
|
}
|
|
4023
4029
|
function hasConfiguredContainerCompat(rawSource, file, cssHandlerOptions) {
|
|
4024
4030
|
if (hasContainerConfigToken(rawSource)) return true;
|
|
4025
|
-
const
|
|
4031
|
+
const base = resolveCssSourceBase(file, cssHandlerOptions);
|
|
4032
|
+
const cssEntrySource = require_generator.resolveCssEntrySource(rawSource, base);
|
|
4026
4033
|
if (!cssEntrySource?.config) return false;
|
|
4027
4034
|
try {
|
|
4028
4035
|
return /\bcontainer\b/.test((0, node_fs.readFileSync)(cssEntrySource.config, "utf8"));
|
|
@@ -4510,13 +4517,15 @@ async function finalizeDeferredGeneratorCss(context) {
|
|
|
4510
4517
|
const cssWithBeforeUserCss = createCssSourceOrderAppend((0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, beforeUserCss), css);
|
|
4511
4518
|
return reorderMarkedUserLayerComponentsCss(createCssSourceOrderAppend(cssWithBeforeUserCss, (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(cssWithBeforeUserCss, afterUserCss)));
|
|
4512
4519
|
}
|
|
4513
|
-
|
|
4520
|
+
const userCss = await transformDeferredUserCss(generatedUserCssRawSource);
|
|
4521
|
+
return reorderMarkedUserLayerComponentsCss(createCssSourceOrderAppend(css, (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, userCss)));
|
|
4514
4522
|
};
|
|
4515
4523
|
const canAppendIncrementalCss = generated.target !== "weapp" || !require_generator.hasUserCssLayerBlocks(generatorRawSource);
|
|
4516
4524
|
const incrementalRawCss = generated.incrementalRawCss ?? generated.incrementalCss;
|
|
4517
4525
|
const shouldAppendIncrementalCss = canAppendIncrementalCss && typeof options.previousCss === "string" && typeof incrementalRawCss === "string";
|
|
4518
4526
|
const normalizedCss = shouldAppendIncrementalCss ? incrementalRawCss.trim().length > 0 ? require_generator.createCssAppend(options.previousCss, await normalizeDeferredGeneratedCss(incrementalRawCss)) : options.previousCss : await normalizeDeferredGeneratedCss(generated.rawCss ?? generated.css);
|
|
4519
|
-
const
|
|
4527
|
+
const intermediateCss = shouldAppendIncrementalCss ? normalizedCss : await restoreDeferredUserCss(normalizedCss);
|
|
4528
|
+
const css = (0, _weapp_tailwindcss_postcss.restoreLocalCssImports)(intermediateCss, localImports, { outputFile: file });
|
|
4520
4529
|
return {
|
|
4521
4530
|
css,
|
|
4522
4531
|
classSet: resolveGeneratedCssClassSet(generated.target, generated.classSet, runtimeWithCurrentCss, css, opts.escapeMap, options.previousClassSet),
|
|
@@ -4601,7 +4610,8 @@ async function finalizeFallbackGeneratorCss(context) {
|
|
|
4601
4610
|
css = createCssSourceOrderAppend(css, missingUserCss);
|
|
4602
4611
|
} else if (hasMatchedCssSourceFile && generated.target === "weapp" && hasGeneratedMarkers && !hasGeneratedCss) {
|
|
4603
4612
|
const cleanedUserCssRawSource = require_generator.removeTailwindV4GeneratedUserCssArtifacts(userCssRawSource);
|
|
4604
|
-
const
|
|
4613
|
+
const cleanedUserCssRestSource = restoredDistinctUserLayerCss && require_generator.hasUserCssLayerBlocks(cleanedUserCssRawSource) ? require_generator.splitUserCssLayerBlocks(cleanedUserCssRawSource).rest : cleanedUserCssRawSource;
|
|
4614
|
+
const userCss = await require_generator.transformGeneratorUserCss(cleanedUserCssRestSource, {
|
|
4605
4615
|
generatorTarget: generated.target,
|
|
4606
4616
|
generatorStyleOptions,
|
|
4607
4617
|
cssUserHandlerOptions,
|
|
@@ -5185,12 +5195,17 @@ async function validateCandidatesByGeneratorWithOwner(options) {
|
|
|
5185
5195
|
//#endregion
|
|
5186
5196
|
//#region src/bundlers/shared/v4-generation-core.ts
|
|
5187
5197
|
function resolveGenerationOptions(options, mode) {
|
|
5188
|
-
|
|
5189
|
-
const
|
|
5190
|
-
const compilationChanges = mergeCompilationDependencyChanges(options.compilationChanges, consumeCompilationScopeChanges(options.runtimeState, scopeId));
|
|
5191
|
-
if (compilationChanges.length === 0) return options;
|
|
5192
|
-
return {
|
|
5198
|
+
const physicalFile = stripRequestQuery(options.file);
|
|
5199
|
+
const normalizedOptions = physicalFile === options.file ? options : {
|
|
5193
5200
|
...options,
|
|
5201
|
+
file: physicalFile
|
|
5202
|
+
};
|
|
5203
|
+
if (mode === "legacy") return normalizedOptions;
|
|
5204
|
+
const scopeId = normalizedOptions.scope?.id ?? normalizedOptions.outputFile ?? normalizedOptions.file;
|
|
5205
|
+
const compilationChanges = mergeCompilationDependencyChanges(normalizedOptions.compilationChanges, consumeCompilationScopeChanges(normalizedOptions.runtimeState, scopeId));
|
|
5206
|
+
if (compilationChanges.length === 0) return normalizedOptions;
|
|
5207
|
+
return {
|
|
5208
|
+
...normalizedOptions,
|
|
5194
5209
|
compilationChanges,
|
|
5195
5210
|
previousClassSet: void 0,
|
|
5196
5211
|
previousCss: void 0
|