weapp-tailwindcss 5.2.11 → 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-DSrcDQsA.cjs → gulp-CWFxs2lE.cjs} +16 -13
- package/dist/{gulp-BLaGc0MJ.js → gulp-CltYkglj.js} +12 -9
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-BnGBBJ6S.cjs → hmr-timing-BjOxhci8.cjs} +5 -5
- package/dist/{hmr-timing-DXyGw6jp.js → hmr-timing-D6JKLBCD.js} +25 -15
- 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-B5CzvTUJ.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-xgmxO8_F.js → source-candidate-scan-signature-DQZ_DkgW.js} +5 -4
- package/dist/{source-candidate-scan-signature-GjsLzP8Z.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-D4zQcQqW.cjs → v4-generation-core-2AuNMweK.cjs} +26 -16
- package/dist/{vite-DTDbD-95.cjs → vite-BLB7vjKQ.cjs} +99 -46
- package/dist/{vite-BWmBFzgf.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-CtUyQNqC.js → webpack-DExB8tzB.js} +36 -18
- package/dist/{webpack-Bpovb6YE.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,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_object = require("./object-
|
|
5
|
-
const require_options = require("./options-
|
|
3
|
+
const require_generator = require("./generator-CwMI20jy.cjs");
|
|
4
|
+
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
|
+
const require_options = require("./options-CSqLm6U2.cjs");
|
|
6
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
7
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
8
|
-
const require_wxml = require("./wxml-
|
|
9
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
10
|
-
const require_context = require("./context-
|
|
11
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
12
|
-
const require_style_options = require("./style-options-
|
|
13
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
7
|
+
const require_v4_generation_core = require("./v4-generation-core-2AuNMweK.cjs");
|
|
8
|
+
const require_wxml = require("./wxml-CQmBCjOR.cjs");
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-BjOxhci8.cjs");
|
|
10
|
+
const require_context = require("./context-zWINV_E2.cjs");
|
|
11
|
+
const require_tailwindcss = require("./tailwindcss-B3lqgbln.cjs");
|
|
12
|
+
const require_style_options = require("./style-options-D0NukP02.cjs");
|
|
13
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-uRHl5Ne9.cjs");
|
|
14
14
|
require("./logger-TlKT3xmR.cjs");
|
|
15
|
-
const require_css_imports = require("./css-imports-
|
|
15
|
+
const require_css_imports = require("./css-imports-BFMU7Hpd.cjs");
|
|
16
16
|
let node_fs = require("node:fs");
|
|
17
17
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
18
18
|
let node_path = require("node:path");
|
|
@@ -982,7 +982,7 @@ let _lazyMatch = () => {
|
|
|
982
982
|
}
|
|
983
983
|
return u >= e;
|
|
984
984
|
})));
|
|
985
|
-
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0,
|
|
985
|
+
}, tr = (r, e) => C(r, 0, 1), f = (r, e) => C(r, 0, 1 / 0), x = (r, e) => {
|
|
986
986
|
const n = r.map(v);
|
|
987
987
|
return g(_(M((a) => {
|
|
988
988
|
for (let t = 0, o = n.length; t < o; t++) if (!n[t](a)) return false;
|
|
@@ -1424,7 +1424,8 @@ function removeUnsupportedMiniProgramCssImportsFallback(css, file) {
|
|
|
1424
1424
|
return css.split(/\r?\n/).filter((line) => {
|
|
1425
1425
|
const trimmed = line.trim();
|
|
1426
1426
|
if (!trimmed.startsWith("@import")) return true;
|
|
1427
|
-
const
|
|
1427
|
+
const params = trimmed.slice(7).trim().replace(/;$/, "").trim();
|
|
1428
|
+
const request = (0, _weapp_tailwindcss_postcss.parseTailwindCssDirectiveRequest)(params);
|
|
1428
1429
|
return request === void 0 || (0, _weapp_tailwindcss_postcss.isMiniProgramLocalCssImportRequest)(request);
|
|
1429
1430
|
}).join("\n");
|
|
1430
1431
|
}
|
|
@@ -1600,7 +1601,8 @@ function collectCssImportAtRuleCss(css) {
|
|
|
1600
1601
|
function parseCssImportRequest(importCss) {
|
|
1601
1602
|
const trimmed = importCss.trim();
|
|
1602
1603
|
if (!trimmed.startsWith("@import")) return;
|
|
1603
|
-
|
|
1604
|
+
const params = trimmed.slice(7).trim().replace(/;$/, "").trim();
|
|
1605
|
+
return (0, _weapp_tailwindcss_postcss.parseTailwindCssDirectiveRequest)(params);
|
|
1604
1606
|
}
|
|
1605
1607
|
function shouldRestoreCssImportAtRule(importCss, file) {
|
|
1606
1608
|
if (file === void 0 || !isMiniProgramStyleOutputFile(file)) return true;
|
|
@@ -1857,7 +1859,8 @@ function resolveMiniProgramStyleOutputExtension(options = {}) {
|
|
|
1857
1859
|
}
|
|
1858
1860
|
function resolveReplayCssOutputFile(rootDir, file) {
|
|
1859
1861
|
const cleanFile = file.replace(/[?#].*$/, "");
|
|
1860
|
-
const
|
|
1862
|
+
const nextFile = node_path.default.isAbsolute(cleanFile) ? node_path.default.relative(resolveCssOutputRealPath(rootDir), resolveCssOutputRealPath(cleanFile)) : cleanFile;
|
|
1863
|
+
const normalizedFile = require_source_candidate_scan_signature.normalizeOutputPathKey(nextFile);
|
|
1861
1864
|
if (normalizedFile.length === 0 || normalizedFile === "." || normalizedFile === ".." || normalizedFile.startsWith("../")) return require_source_candidate_scan_signature.normalizeOutputPathKey(node_path.default.basename(cleanFile));
|
|
1862
1865
|
return normalizedFile;
|
|
1863
1866
|
}
|
|
@@ -3534,7 +3537,8 @@ function collectRememberedCssReplayGroups(sources, opts, rootDir, isWebGenerator
|
|
|
3534
3537
|
const cleanSourceFile = remembered.sourceFile.replace(/[?#].*$/, "");
|
|
3535
3538
|
const resolvedOutputFile = CSS_SOURCE_OUTPUT_EXT_RE.test(cleanSourceFile) ? resolveViteCssPipelineOutputFileFromSourceFile(remembered.sourceFile, opts, rootDir, isWebGeneratorTarget, preserveCssExtension, sourceRoot, styleOutputExtension, styleOutputFiles) : resolveViteCssPipelineOutputFileFromSourceFile(remembered.outputFile, opts, rootDir, isWebGeneratorTarget, preserveCssExtension, sourceRoot, styleOutputExtension, styleOutputFiles);
|
|
3536
3539
|
const rememberedOutputFile = remembered.outputFile.replace(/[?#].*$/, "");
|
|
3537
|
-
const
|
|
3540
|
+
const outputFile = opts.cssMatcher(rememberedOutputFile) && !require_source_candidate_scan_signature.normalizeOutputPathKey(rememberedOutputFile).includes("/") && require_source_candidate_scan_signature.normalizeOutputPathKey(rememberedOutputFile) !== require_source_candidate_scan_signature.normalizeOutputPathKey(resolvedOutputFile.replace(/[?#].*$/, "")) ? remembered.outputFile : resolvedOutputFile;
|
|
3541
|
+
const outputKey = require_source_candidate_scan_signature.normalizeOutputPathKey(outputFile);
|
|
3538
3542
|
const group = groups.get(outputKey) ?? [];
|
|
3539
3543
|
group.push({
|
|
3540
3544
|
key,
|
|
@@ -4939,7 +4943,8 @@ async function finalizeMiniProgramCssAssets(bundle, options) {
|
|
|
4939
4943
|
const rawSource = readAssetSource$1(output);
|
|
4940
4944
|
if (rawSource.trim().length === 0) continue;
|
|
4941
4945
|
if (options.lastCssResultByFile?.has(file)) {
|
|
4942
|
-
const
|
|
4946
|
+
const structurallyCleanSource = require_v4_generation_core.finalizeMiniProgramCssStructure(rawSource);
|
|
4947
|
+
const outputCss = (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(structurallyCleanSource);
|
|
4943
4948
|
if (outputCss !== rawSource) {
|
|
4944
4949
|
plan.write(file, outputCss);
|
|
4945
4950
|
writeTargets.set(file, output);
|
|
@@ -4973,7 +4978,8 @@ async function finalizeMiniProgramCssAssets(bundle, options) {
|
|
|
4973
4978
|
},
|
|
4974
4979
|
cssPresetEnv: {}
|
|
4975
4980
|
});
|
|
4976
|
-
const
|
|
4981
|
+
const structurallyCleanCss = require_v4_generation_core.finalizeMiniProgramCssStructure(css);
|
|
4982
|
+
const outputCss = (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(structurallyCleanCss);
|
|
4977
4983
|
if (outputCss === rawSource) continue;
|
|
4978
4984
|
plan.write(file, outputCss);
|
|
4979
4985
|
writeTargets.set(file, output);
|
|
@@ -5286,7 +5292,8 @@ async function finalizeGenerateBundle(options) {
|
|
|
5286
5292
|
const { activeProcessCacheKeys, activeProcessHashKeys, activeViteCssCacheFiles, bundle, bundleFiles, cache, cssTaskFactories, cssPipelineStrategy, createCssPipelineContext, debug, defaultStyleOutputExtension, formatIteration, generatorCandidateSignature, generatorRuntime, getCssHandlerOptions, getSourceCandidateSourcesForEntries, getSourceCandidatesForEntries, getViteCssCacheStats, getViteProcessedCssAssetResults, hmrTimingRecorder, hmrTimingStartedAt, isHarmonyAppStyleTarget, isNativeAppStyleTarget, isViteProcessedCssAsset, isWebGeneratorTarget, jsAfterCss, jsTaskFactories, lastCssResultByFile, lastCssSourceHashByFile, linkedByEntry, markCssAssetProcessed, metrics, onEnd, onUpdate, opts, outDir, pendingLinkedUpdates, pendingRememberedCssReplayUpdates, prepareJsTransformRuntime, pruneViteCssCaches, recordCssAssetResult, recordTimingDetail, recordViteProcessedCssAssetResult, rootDir, runtime, runtimeState, shouldPreserveAppCssExtension, snapshot, sourceCandidates, sourceRoot, state, styleHandler, tasks, timingDetails, transformRuntime, transformWebTargetCss, useIncrementalMode } = options;
|
|
5287
5293
|
const tasksStart = performance.now();
|
|
5288
5294
|
if (cssTaskFactories.length > 0) {
|
|
5289
|
-
const
|
|
5295
|
+
const cssConcurrency = resolveViteCssTaskConcurrency(useIncrementalMode, runtimeState.tailwindRuntime.majorVersion);
|
|
5296
|
+
const cssTask = require_v4_generation_core.runWithConcurrency(cssTaskFactories, cssConcurrency).then(() => void 0);
|
|
5290
5297
|
if (jsAfterCss) await cssTask;
|
|
5291
5298
|
else tasks.push(cssTask);
|
|
5292
5299
|
}
|
|
@@ -5686,7 +5693,8 @@ function resolveUniAppXStyleIsolationEnabled(root) {
|
|
|
5686
5693
|
const manifestPath = node_path.default.join(normalizedRoot, "manifest.json");
|
|
5687
5694
|
let enabled = false;
|
|
5688
5695
|
try {
|
|
5689
|
-
|
|
5696
|
+
const raw = node_fs.default.readFileSync(manifestPath, "utf8");
|
|
5697
|
+
enabled = `${(0, comment_json.parse)(raw)["uni-app-x"]?.styleIsolationVersion ?? ""}` === "2";
|
|
5690
5698
|
} catch {
|
|
5691
5699
|
enabled = false;
|
|
5692
5700
|
}
|
|
@@ -5958,12 +5966,13 @@ async function resolveHotSourceModulesByIds(ctx, ids) {
|
|
|
5958
5966
|
const root = ctx.server.config?.root ?? node_process.default.cwd();
|
|
5959
5967
|
const sourceIds = new Set(ids);
|
|
5960
5968
|
for (const id of ids) {
|
|
5961
|
-
if (typeof id !== "string" || !/\.(?:uvue|nvue)(?:$|[?#])/i.test(id)) continue;
|
|
5969
|
+
if (typeof id !== "string" || !/\.(?:uvue|nvue|vue|tsx?|jsx?)(?:$|[?#])/i.test(id)) continue;
|
|
5962
5970
|
const identity = resolveViteModuleIdentity(id, root);
|
|
5963
5971
|
for (const lookupId of identity.lookupIds) if (!/[?&]import(?:[=&]|$)/.test(lookupId)) sourceIds.add(`${(0, _weapp_tailwindcss_shared.cleanUrl)(lookupId)}?import`);
|
|
5964
5972
|
}
|
|
5965
5973
|
return resolveHotModulesByIds(ctx, sourceIds, (mod) => {
|
|
5966
|
-
|
|
5974
|
+
const modId = mod.id ?? mod.url;
|
|
5975
|
+
return !require_v4_generation_core.isSourceStyleRequest(modId);
|
|
5967
5976
|
});
|
|
5968
5977
|
}
|
|
5969
5978
|
async function resolveHotSourceModules(ctx) {
|
|
@@ -5971,7 +5980,8 @@ async function resolveHotSourceModules(ctx) {
|
|
|
5971
5980
|
const seenModules = /* @__PURE__ */ new Set();
|
|
5972
5981
|
const collectModule = (mod) => {
|
|
5973
5982
|
if (mod == null || seenModules.has(mod)) return;
|
|
5974
|
-
|
|
5983
|
+
const modId = mod.id ?? mod.url;
|
|
5984
|
+
if (require_v4_generation_core.isSourceStyleRequest(modId)) return;
|
|
5975
5985
|
seenModules.add(mod);
|
|
5976
5986
|
modules.push(mod);
|
|
5977
5987
|
};
|
|
@@ -6055,7 +6065,8 @@ function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
|
6055
6065
|
}
|
|
6056
6066
|
function hasSelfAcceptingNonStyleHotModule(modules) {
|
|
6057
6067
|
return modules.some((mod) => {
|
|
6058
|
-
|
|
6068
|
+
const modId = mod.id ?? mod.url;
|
|
6069
|
+
return !require_v4_generation_core.isSourceStyleRequest(modId) && mod.isSelfAccepting === true;
|
|
6059
6070
|
});
|
|
6060
6071
|
}
|
|
6061
6072
|
function sendSupplementalCssHotUpdates(ctx, cssModules, fallbackCssIds = [], fallbackSourceIds = []) {
|
|
@@ -6189,7 +6200,7 @@ function resolvePreprocessorTransform(code, id, lang, options) {
|
|
|
6189
6200
|
//#region src/uni-app-x/vite.ts
|
|
6190
6201
|
let transformUVuePromise;
|
|
6191
6202
|
function loadTransformUVue() {
|
|
6192
|
-
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-
|
|
6203
|
+
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-BiHG42Rp.cjs")).then((mod) => mod.transformUVue));
|
|
6193
6204
|
return transformUVuePromise;
|
|
6194
6205
|
}
|
|
6195
6206
|
const UVUE_NVUE_QUERY_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
@@ -6431,11 +6442,12 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
|
|
|
6431
6442
|
const { cache, hashKey, createHandlerOptions, debug, getAssetSource, getCssSources, injectStylePlaceholder = true, jsHandler, onUpdate, runtimeSet, applyLinkedResults } = options;
|
|
6432
6443
|
const absoluteFile = require_source_candidate_scan_signature.toAbsoluteOutputPath(file, outDir);
|
|
6433
6444
|
const rawSource = originalSource.source.toString();
|
|
6445
|
+
const rawHashSource = options.hashSalt ? `${rawSource}\n/*${options.hashSalt}*/` : rawSource;
|
|
6434
6446
|
await require_hmr_timing.processCachedTask({
|
|
6435
6447
|
cache,
|
|
6436
6448
|
cacheKey: file,
|
|
6437
6449
|
hashKey,
|
|
6438
|
-
rawSource:
|
|
6450
|
+
rawSource: rawHashSource,
|
|
6439
6451
|
applyResult(source) {
|
|
6440
6452
|
originalSource.source = source;
|
|
6441
6453
|
},
|
|
@@ -6665,16 +6677,18 @@ async function processRememberedCssReplay(options) {
|
|
|
6665
6677
|
const allRememberedSignaturesFresh = rememberedKeys.length > 0 && rememberedKeys.every((key) => getRememberedCssSignature?.(key) === rememberedCssRuntimeSignature);
|
|
6666
6678
|
if (bundleFiles.includes(rememberedOutputFile) || bundleFiles.includes(sourceFile)) continue;
|
|
6667
6679
|
const shouldMergeReplayIntoFrameworkRootTarget = outputFile !== rememberedOutputFile && normalizedBundleFiles.has(require_source_candidate_scan_signature.normalizeOutputPathKey(outputFile));
|
|
6668
|
-
if (allRememberedSignaturesFresh)
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6680
|
+
if (allRememberedSignaturesFresh) {
|
|
6681
|
+
if (!shouldMergeReplayIntoFrameworkRootTarget) continue;
|
|
6682
|
+
else {
|
|
6683
|
+
const cachedCss = getLastCssResult(lastCssResultByFile, outputFile);
|
|
6684
|
+
if (cachedCss != null) {
|
|
6685
|
+
pendingRememberedCssReplayUpdates.push(...createRememberedCssReplayUpdates(cachedCss, sourceFile, outputFile, true));
|
|
6686
|
+
metrics.css.cacheHits++;
|
|
6687
|
+
debug("css replay cached result into framework root target: %s", outputFile);
|
|
6688
|
+
continue;
|
|
6689
|
+
}
|
|
6690
|
+
debug("css replay framework root target cache miss, regenerate: %s", outputFile);
|
|
6676
6691
|
}
|
|
6677
|
-
debug("css replay framework root target cache miss, regenerate: %s", outputFile);
|
|
6678
6692
|
}
|
|
6679
6693
|
const sourceTraceSources = scopedSourceCandidateSourceGetter ? await require_source_candidate_scan_signature.createScopedGeneratorSourceTraceMap(generatorRawSource, sourceFile, scopedSourceCandidateSourceGetter) : void 0;
|
|
6680
6694
|
const sourceTraceTokenSources = sourceTraceSources ? require_v4_generation_core.createCssTokenSourceMap(sourceTraceSources, opts) : void 0;
|
|
@@ -7149,7 +7163,8 @@ function resolveCurrentSourceCandidateFile(options) {
|
|
|
7149
7163
|
}
|
|
7150
7164
|
function resolveCurrentSourceCandidateSource(options) {
|
|
7151
7165
|
const { file, getSourceCandidateSource, getSourceCandidateSources } = options;
|
|
7152
|
-
const
|
|
7166
|
+
const cleanedFile = file.replace(/[?#].*$/, "");
|
|
7167
|
+
const normalizedFile = require_source_candidate_scan_signature.normalizeOutputPathKey(cleanedFile);
|
|
7153
7168
|
const sourceCandidates = createSourceCandidateFiles(options);
|
|
7154
7169
|
const explicitSource = sourceCandidates.reduce((source, candidate) => {
|
|
7155
7170
|
if (source || !candidate) return source;
|
|
@@ -9363,12 +9378,36 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9363
9378
|
const request = mod.url ?? mod.id;
|
|
9364
9379
|
return typeof request === "string" && /\.(?:uvue|nvue)(?:\?import)?$/i.test(request);
|
|
9365
9380
|
});
|
|
9381
|
+
const sendSupplementalSourceHotUpdates = (ctx, modules) => {
|
|
9382
|
+
const root = ctx.server.config?.root ?? node_process.default.cwd();
|
|
9383
|
+
const updates = modules.flatMap((mod) => [mod, ...mod.importedModules ?? []]).filter((mod) => !require_v4_generation_core.isSourceStyleRequest(mod.id ?? mod.url)).map((mod) => {
|
|
9384
|
+
let hotPath;
|
|
9385
|
+
if (typeof mod.id === "string" && node_path.default.isAbsolute(mod.id)) {
|
|
9386
|
+
const relative = typeof mod.url === "string" && mod.url.startsWith("/pages/") ? node_path.default.relative(node_path.default.dirname(root), mod.id) : node_path.default.relative(root, mod.id);
|
|
9387
|
+
if (relative && !relative.startsWith("..") && !node_path.default.isAbsolute(relative)) hotPath = `/${relative.split(node_path.default.sep).join("/")}`;
|
|
9388
|
+
}
|
|
9389
|
+
hotPath ?? (hotPath = mod.url ?? (typeof mod.id === "string" && mod.id.startsWith("/") ? mod.id : void 0));
|
|
9390
|
+
return hotPath ? {
|
|
9391
|
+
acceptedPath: hotPath,
|
|
9392
|
+
explicitImportRequired: false,
|
|
9393
|
+
isWithinCircularImport: false,
|
|
9394
|
+
path: hotPath,
|
|
9395
|
+
timestamp: ctx.timestamp,
|
|
9396
|
+
type: "js-update"
|
|
9397
|
+
} : void 0;
|
|
9398
|
+
}).filter((update) => update !== void 0);
|
|
9399
|
+
if (updates.length > 0) ctx.server.ws?.send?.({
|
|
9400
|
+
type: "update",
|
|
9401
|
+
updates
|
|
9402
|
+
});
|
|
9403
|
+
};
|
|
9366
9404
|
return {
|
|
9367
9405
|
name: `${require_context.vitePluginName}:source-candidates`,
|
|
9368
9406
|
enforce: "pre",
|
|
9369
9407
|
async load(id) {
|
|
9370
9408
|
if (!options.shouldOwnTailwindGeneration || options.isWebOrNativeAppPlatform(options.resolveViteStylePlatform()) || !isCSSRequest(id) || !shouldCollectTransformedSourceCandidates(id)) return;
|
|
9371
|
-
const
|
|
9409
|
+
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
9410
|
+
const rawCode = await (0, node_fs_promises.readFile)(file, "utf8").catch(() => void 0);
|
|
9372
9411
|
if (typeof rawCode !== "string") return;
|
|
9373
9412
|
options.rememberOriginalCssLayerSource(id, rawCode);
|
|
9374
9413
|
const transformedCode = options.transformEarlyMiniProgramCss(rawCode);
|
|
@@ -9470,12 +9509,22 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9470
9509
|
const cssModules = await resolveHotTailwindCssModules(ctx, require_v4_generation_core.isSourceStyleRequest(ctx.file) ? [ctx.file] : options.tailwindRootCssModuleIds);
|
|
9471
9510
|
const hotRoot = ctx.server.config?.root ?? node_process.default.cwd();
|
|
9472
9511
|
const sourceModules = isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) ? await resolveHotSourceModules(ctx) : ctx.modules;
|
|
9512
|
+
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file)) {
|
|
9513
|
+
sendSupplementalSourceHotUpdates(ctx, sourceModules);
|
|
9514
|
+
if (sourceModules.some((mod) => {
|
|
9515
|
+
const id = mod.id ?? mod.url;
|
|
9516
|
+
return typeof id === "string" && /[?&]macro=true(?:&|$)/.test(id) === false && typeof mod.url === "string" && mod.url.startsWith("/pages/") && /\.vue(?:$|[?#])/i.test(id);
|
|
9517
|
+
})) {
|
|
9518
|
+
queueMicrotask(() => sendFullReloadForUnresolvedHotUpdate(ctx));
|
|
9519
|
+
return [];
|
|
9520
|
+
}
|
|
9521
|
+
}
|
|
9473
9522
|
const hasHmrCandidateAppend = options.hmrCandidateState.hasPendingCandidateAppend() || canUseHmrCandidateAppend && sourceCandidateChange !== void 0 && sourceCandidateChange.addedCandidates.size > 0;
|
|
9474
9523
|
if (isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) && !hasHmrCandidateAppend && !isWebLikeHotUpdate && (!hasSelfAcceptingNonStyleHotModule(sourceModules) && cssModules.length === 0 || cssModules.length > 0 && options.isUniViteProject())) {
|
|
9475
9524
|
sendFullReloadForUnresolvedHotUpdate(ctx);
|
|
9476
9525
|
return [];
|
|
9477
9526
|
}
|
|
9478
|
-
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) && sourceModules.some((mod) => options.
|
|
9527
|
+
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) && sourceModules.some((mod) => options.isNuxtPageHotModule?.(mod.id ?? mod.url))) {
|
|
9479
9528
|
sendFullReloadForUnresolvedHotUpdate(ctx);
|
|
9480
9529
|
return [];
|
|
9481
9530
|
}
|
|
@@ -10004,9 +10053,11 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
10004
10053
|
const platform = resolveViteStylePlatform();
|
|
10005
10054
|
return platform ? isWebOrNativeAppPlatform(platform) : resolveCurrentGeneratorBranch().isWeb;
|
|
10006
10055
|
};
|
|
10007
|
-
const
|
|
10008
|
-
if (typeof id !== "string"
|
|
10009
|
-
const cleanId = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
10056
|
+
const isNuxtPageHotModule = (id) => {
|
|
10057
|
+
if (typeof id !== "string") return false;
|
|
10058
|
+
const cleanId = (0, _weapp_tailwindcss_shared.cleanUrl)(id).replace(/%2F/gi, "/");
|
|
10059
|
+
if (cleanId.includes("virtual:nuxt:") && /(?:^|\/)routes\.mjs$/.test(cleanId)) return true;
|
|
10060
|
+
if (!/[?&]macro=true(?:&|$)/.test(id)) return false;
|
|
10010
10061
|
return cleanId.includes("/pages/") && /\.(?:vue|tsx?|jsx?)$/.test(cleanId);
|
|
10011
10062
|
};
|
|
10012
10063
|
const normalizeGeneratedCssCacheFile = (file) => normalizeVitePersistentCacheKey((0, _weapp_tailwindcss_shared.cleanUrl)(file));
|
|
@@ -10406,7 +10457,7 @@ ${tracedCss}`;
|
|
|
10406
10457
|
hmrTimingRecorder,
|
|
10407
10458
|
invalidateRecordedGeneratorCandidates,
|
|
10408
10459
|
isCurrentWebLikeStylePlatform,
|
|
10409
|
-
|
|
10460
|
+
isNuxtPageHotModule,
|
|
10410
10461
|
isUniViteProject,
|
|
10411
10462
|
isWebOrNativeAppPlatform,
|
|
10412
10463
|
prepareTailwindGeneration,
|
|
@@ -10720,17 +10771,19 @@ function withUniAppXWebPreflightReset(css, enabled) {
|
|
|
10720
10771
|
//#region src/bundlers/vite/uni-app-x-css-options.ts
|
|
10721
10772
|
function resolveUniAppXNativeCssHandlerOptions(opts) {
|
|
10722
10773
|
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
10723
|
-
|
|
10774
|
+
const branch = require_generator.normalizeWeappTailwindcssGeneratorOptions(opts.generator, {
|
|
10724
10775
|
appType: opts.appType,
|
|
10725
10776
|
platform: opts.cssOptions?.platform ?? opts.platform,
|
|
10726
10777
|
uniAppX: require_options.resolveUniAppXOptions(opts.uniAppX),
|
|
10727
10778
|
uniUtsPlatform
|
|
10728
|
-
})
|
|
10779
|
+
});
|
|
10780
|
+
const runtimeBranch = require_generator.resolveGeneratorRuntimeBranch(branch, {
|
|
10729
10781
|
appType: opts.appType,
|
|
10730
10782
|
platform: opts.cssOptions?.platform ?? opts.platform,
|
|
10731
10783
|
uniAppX: require_options.resolveUniAppXOptions(opts.uniAppX),
|
|
10732
10784
|
uniUtsPlatform
|
|
10733
|
-
})
|
|
10785
|
+
});
|
|
10786
|
+
if (!require_generator.shouldUseNativeAppCssBranch(runtimeBranch) || !require_options.isUniAppXEnabled(opts.uniAppX)) return {};
|
|
10734
10787
|
return {
|
|
10735
10788
|
uniAppX: true,
|
|
10736
10789
|
uniAppXCssTarget: "uvue",
|