weapp-tailwindcss 5.2.7 → 5.2.9
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/directives.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +4 -1
- package/dist/bundlers/vite/generate-bundle/types.d.ts +6 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +5 -3
- package/dist/bundlers/vite/module-identity.d.ts +9 -0
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +4 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +1 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +4 -1
- package/dist/bundlers/vite/shared/framework-hmr-candidate-state.d.ts +4 -2
- package/dist/bundlers/vite/shared/framework-hmr-runtime-signature.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +4 -0
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +4 -0
- package/dist/cli.js +1 -0
- package/dist/{context-YAvTyPV2.js → context-BMkbwnH8.js} +10 -23
- package/dist/{context-OqD_eBxQ.cjs → context-CByXWyhQ.cjs} +179 -25
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{generator-BE34PYSC.cjs → generator-B0dCFlP1.cjs} +10 -0
- package/dist/{generator-DYeAa2-5.js → generator-BLpOsd5O.js} +10 -0
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-BydhuCbr.js → gulp-BWhCahA2.js} +4 -4
- package/dist/{gulp-Bun9iCRE.cjs → gulp-BdoorWb5.cjs} +7 -7
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-Gs9P-QtZ.js → hmr-timing-CJocHeZr.js} +22 -14
- package/dist/{hmr-timing-D607CWrq.cjs → hmr-timing-DiYnyg_W.cjs} +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{options-hVsoTfwL.cjs → options-zpZez7qe.cjs} +1 -1
- package/dist/{pipeline-helpers-BLpoT8fX.cjs → pipeline-helpers-CsNLoEX1.cjs} +3 -3
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -2
- package/dist/presets.js +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/{source-candidate-scan-signature-BGDNJE2r.cjs → source-candidate-scan-signature-D9FXTD9a.cjs} +3 -3
- package/dist/{source-candidate-scan-signature-CdjPWQqv.js → source-candidate-scan-signature-of-TmeOs.js} +3 -3
- package/dist/{style-options-B_ppaVIg.cjs → style-options-COpQc8fr.cjs} +2 -2
- package/dist/{tailwindcss-CTpCc_nd.js → tailwindcss-2zdmASlM.js} +1 -1
- package/dist/{tailwindcss-DcpiKvmJ.cjs → tailwindcss-LtnGCxF0.cjs} +2 -2
- package/dist/{transform-BbaPIji9.js → transform-DhDe9eSf.js} +131 -15
- package/dist/{transform-BUEyOCT7.cjs → transform-GzbxfNGA.cjs} +130 -14
- package/dist/uni-app-x/component-local-style-binding.d.ts +6 -0
- package/dist/uni-app-x/component-local-style.d.ts +2 -0
- package/dist/uni-app-x/vite/author-apply.d.ts +1 -0
- package/dist/uni-app-x/vite/harmony-apply.d.ts +4 -1
- package/dist/uni-app-x/vite/native-hmr.d.ts +2 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +29 -0
- package/dist/uni-app-x/vite/style-request.d.ts +15 -0
- package/dist/uni-app-x/vite.d.ts +3 -24
- package/dist/{v4-generation-core-BrkM1vCs.cjs → v4-generation-core-BjHT6qGC.cjs} +22 -14
- package/dist/{vite-DM-U-Ins.js → vite-8l9_S4Qi.js} +680 -230
- package/dist/{vite-n0mRgEcF.cjs → vite-Dcx59GRQ.cjs} +683 -233
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +5 -5
- package/dist/{webpack-BlUJf8Ru.js → webpack-CkeFhPY2.js} +6 -6
- package/dist/{webpack-Bf8yJwTO.cjs → webpack-CzQrloDg.cjs} +9 -9
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { resolveImplicitAppTypeFromViteRoot } from "./framework.js";
|
|
2
|
-
import { $ as hasTailwindSourceDirectives, B as stripMiniProgramCssSpecificityPlaceholders, D as resolveTailwindcssOptions, Ft as filterUnsupportedMiniProgramTailwindV4Candidates, K as hasUserCssLayerBlocks, L as hasMiniProgramCssSpecificityPlaceholders, Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, S as findNearestPackageRoot, U as normalizeEmptyTailwindCustomVariants, X as hasTailwindApplyDirective, Y as hasLocalCssImport, Z as hasTailwindNonRootGenerationDirectives, _ as upsertTailwindV4CssSource, a as resolveGeneratorRuntimeBranch, b as isTailwindV4CssEntry, c as shouldUseNativeAppCssBranch, et as normalizeTailwindConfigDirectives, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, it as removeTailwindSourceDirectives, kt as resolveTailwindV4CssSourceBase, l as resolveUniUtsPlatform, m as filterTailwindV4CssSourceRoots, mt as stripGeneratorPlaceholderMarkers, nt as normalizeTailwindSourceForGenerator, q as splitUserCssLayerBlocks, rt as parseImportRequest, s as shouldUseMiniProgramCssBranch, ut as hasTailwindGeneratedCssMarkers, wt as isFileMatchedByTailwindSourceEntries, x as normalizeCssEntries } from "./generator-
|
|
2
|
+
import { $ as hasTailwindSourceDirectives, B as stripMiniProgramCssSpecificityPlaceholders, D as resolveTailwindcssOptions, Ft as filterUnsupportedMiniProgramTailwindV4Candidates, K as hasUserCssLayerBlocks, L as hasMiniProgramCssSpecificityPlaceholders, Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, S as findNearestPackageRoot, U as normalizeEmptyTailwindCustomVariants, X as hasTailwindApplyDirective, Y as hasLocalCssImport, Z as hasTailwindNonRootGenerationDirectives, _ as upsertTailwindV4CssSource, a as resolveGeneratorRuntimeBranch, b as isTailwindV4CssEntry, c as shouldUseNativeAppCssBranch, et as normalizeTailwindConfigDirectives, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, it as removeTailwindSourceDirectives, kt as resolveTailwindV4CssSourceBase, l as resolveUniUtsPlatform, m as filterTailwindV4CssSourceRoots, mt as stripGeneratorPlaceholderMarkers, nt as normalizeTailwindSourceForGenerator, q as splitUserCssLayerBlocks, rt as parseImportRequest, s as shouldUseMiniProgramCssBranch, ut as hasTailwindGeneratedCssMarkers, wt as isFileMatchedByTailwindSourceEntries, x as normalizeCssEntries } from "./generator-BLpOsd5O.js";
|
|
3
3
|
import { t as omitUndefined } from "./object-Bvy6-w9r.js";
|
|
4
|
-
import { _ as resolveTailwindV4EntriesFromCssCached, a as findTailwindConfig, f as createSourceScanMatcher, h as resolveTailwindV4CssDependencies, i as resolveUniAppXOptions, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as resolveSourceScanEntries, r as isUniAppXEnabled } from "./tailwindcss-
|
|
4
|
+
import { _ as resolveTailwindV4EntriesFromCssCached, a as findTailwindConfig, f as createSourceScanMatcher, h as resolveTailwindV4CssDependencies, i as resolveUniAppXOptions, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as resolveSourceScanEntries, r as isUniAppXEnabled } from "./tailwindcss-2zdmASlM.js";
|
|
5
5
|
import "./utils-MVwpU07P.js";
|
|
6
|
-
import { A as createCssSourceTraceCacheSignature, B as finalizeCompilerShadowRun, C as createBundlerGeneratedCssMarker, D as finalizeMiniProgramCssStructure, E as stripBundlerGeneratedCssMarkers, J as disposeCompilerOwner, K as updateRuntimeCompilationBuildState, L as isPureLocalCssImportWrapper, N as processCachedTask, O as hasEmptyAtRuleBlockCandidate, P as createRuntimeClassSetManager, S as stripRequestQuery, T as parseBundlerGeneratedCssMarkerBlocks, U as createRuntimeCompilationBuildState, V as buildRuntimeCompilationSnapshot, Y as beginCompilerShadowRun, Z as AssetEmissionPlan, a as extractMarkedUserLayerComponentsCss, at as extractCandidatesFromSource, d as normalizeMiniProgramGeneratorCssSource, et as recordCompilationDependencyChanges, f as normalizeMiniProgramImportShell, h as captureFrameworkPostcssOptions, i as validateCandidatesByGenerator, it as isSourceCandidateRequest, j as createCssTokenSourceMap, k as annotateCssSourceTrace, nt as createSourceCandidateCollector, o as mergeMarkedUserLayerComponentsCss, p as scoreTailwindV4CssSourceFileMatch, q as createRuntimeAffectingSourceSignature, r as generateTailwindV4Css, t as createHmrTimingRecorder, tt as createCompilationDependencyChanges, u as runWithConcurrency, w as hasBundlerGeneratedCssMarker, x as isSourceStyleRequest } from "./hmr-timing-
|
|
6
|
+
import { A as createCssSourceTraceCacheSignature, B as finalizeCompilerShadowRun, C as createBundlerGeneratedCssMarker, D as finalizeMiniProgramCssStructure, E as stripBundlerGeneratedCssMarkers, J as disposeCompilerOwner, K as updateRuntimeCompilationBuildState, L as isPureLocalCssImportWrapper, N as processCachedTask, O as hasEmptyAtRuleBlockCandidate, P as createRuntimeClassSetManager, S as stripRequestQuery, T as parseBundlerGeneratedCssMarkerBlocks, U as createRuntimeCompilationBuildState, V as buildRuntimeCompilationSnapshot, Y as beginCompilerShadowRun, Z as AssetEmissionPlan, a as extractMarkedUserLayerComponentsCss, at as extractCandidatesFromSource, d as normalizeMiniProgramGeneratorCssSource, et as recordCompilationDependencyChanges, f as normalizeMiniProgramImportShell, h as captureFrameworkPostcssOptions, i as validateCandidatesByGenerator, it as isSourceCandidateRequest, j as createCssTokenSourceMap, k as annotateCssSourceTrace, nt as createSourceCandidateCollector, o as mergeMarkedUserLayerComponentsCss, p as scoreTailwindV4CssSourceFileMatch, q as createRuntimeAffectingSourceSignature, r as generateTailwindV4Css, t as createHmrTimingRecorder, tt as createCompilationDependencyChanges, u as runWithConcurrency, w as hasBundlerGeneratedCssMarker, x as isSourceStyleRequest } from "./hmr-timing-CJocHeZr.js";
|
|
7
7
|
import { h as createDebug, m as replaceWxml } from "./wxml-IBzZSaQC.js";
|
|
8
|
-
import { a as vitePluginName, c as collectRuntimeClassSet, d as refreshTailwindRuntimeState, f as normalizeFrameworkStylePlatform, l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, s as toCustomAttributesEntities, t as getCompilerContext } from "./context-
|
|
9
|
-
import { _ as createBuiltinViteStyleInjectorPlugins, a as createCandidateSignature, c as getSnapshotHash, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, i as createScopedGeneratorSourceTraceMap, l as hasRuntimeAffectingSourceChanges, m as normalizeOutputPathKey, n as createScopedGeneratorCandidateSignature, o as createJsHashSalt, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, s as createLinkedImpactSignature, t as createSourceCandidateScanSignature, u as summarizeStringDiff, x as resolveViteFrameworkProfile, y as viteStyleInjectorDelegates } from "./source-candidate-scan-signature-
|
|
8
|
+
import { a as vitePluginName, c as collectRuntimeClassSet, d as refreshTailwindRuntimeState, f as normalizeFrameworkStylePlatform, l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, s as toCustomAttributesEntities, t as getCompilerContext } from "./context-BMkbwnH8.js";
|
|
9
|
+
import { _ as createBuiltinViteStyleInjectorPlugins, a as createCandidateSignature, c as getSnapshotHash, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, i as createScopedGeneratorSourceTraceMap, l as hasRuntimeAffectingSourceChanges, m as normalizeOutputPathKey, n as createScopedGeneratorCandidateSignature, o as createJsHashSalt, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, s as createLinkedImpactSignature, t as createSourceCandidateScanSignature, u as summarizeStringDiff, x as resolveViteFrameworkProfile, y as viteStyleInjectorDelegates } from "./source-candidate-scan-signature-of-TmeOs.js";
|
|
10
10
|
import { t as logger$1 } from "./logger-BNzxZbZj.js";
|
|
11
11
|
import fs, { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -18,6 +18,7 @@ import { readFile } from "node:fs/promises";
|
|
|
18
18
|
import micromatch from "micromatch";
|
|
19
19
|
import { cleanUrl, ensurePosix } from "@weapp-tailwindcss/shared";
|
|
20
20
|
import { logger } from "@weapp-tailwindcss/logger";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
21
22
|
import { Buffer } from "node:buffer";
|
|
22
23
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
23
24
|
import { parse } from "comment-json";
|
|
@@ -399,6 +400,7 @@ function resolveReferencePaths(styleSource, sourceId) {
|
|
|
399
400
|
return styleSource;
|
|
400
401
|
}
|
|
401
402
|
const cleanSourceId = sourceId.replace(/\?.*$/, "");
|
|
403
|
+
const pathApi = /^[a-z]:[\\/]/i.test(cleanSourceId) ? path.win32 : path;
|
|
402
404
|
root.walkAtRules("reference", (rule) => {
|
|
403
405
|
const quote = rule.params[0];
|
|
404
406
|
if (quote !== "\"" && quote !== "'") return;
|
|
@@ -406,7 +408,7 @@ function resolveReferencePaths(styleSource, sourceId) {
|
|
|
406
408
|
if (closingQuoteIndex <= 1) return;
|
|
407
409
|
const referencePath = rule.params.slice(1, closingQuoteIndex);
|
|
408
410
|
if (!referencePath.startsWith(".")) return;
|
|
409
|
-
rule.params = `${quote}${
|
|
411
|
+
rule.params = `${quote}${pathApi.resolve(pathApi.dirname(cleanSourceId), referencePath).replaceAll("\\", "/")}${quote}${rule.params.slice(closingQuoteIndex + 1)}`;
|
|
410
412
|
});
|
|
411
413
|
return root.toString();
|
|
412
414
|
}
|
|
@@ -2312,6 +2314,8 @@ const VUE_SCOPED_ATTR_RE = /\[data-v-[^\]]+\]/gi;
|
|
|
2312
2314
|
const VUE_SCOPED_CLASS_RE = /\.data-v-[\w-]+/gi;
|
|
2313
2315
|
const SCOPED_UNIVERSAL_PREFLIGHT_SELECTORS = /* @__PURE__ */ new Set([
|
|
2314
2316
|
"*",
|
|
2317
|
+
":after",
|
|
2318
|
+
":before",
|
|
2315
2319
|
"::after",
|
|
2316
2320
|
"::before",
|
|
2317
2321
|
"::backdrop",
|
|
@@ -2323,6 +2327,14 @@ const MINI_PROGRAM_PREFLIGHT_SELECTORS = /* @__PURE__ */ new Set([
|
|
|
2323
2327
|
"::after",
|
|
2324
2328
|
"::before"
|
|
2325
2329
|
]);
|
|
2330
|
+
const UNI_APP_WEB_PREFLIGHT_SELECTORS = /* @__PURE__ */ new Set([
|
|
2331
|
+
"uni-view",
|
|
2332
|
+
"uni-text",
|
|
2333
|
+
":after",
|
|
2334
|
+
":before",
|
|
2335
|
+
"::after",
|
|
2336
|
+
"::before"
|
|
2337
|
+
]);
|
|
2326
2338
|
const MINI_PROGRAM_PREFLIGHT_DECLARATIONS = /* @__PURE__ */ new Set([
|
|
2327
2339
|
"box-sizing",
|
|
2328
2340
|
"margin",
|
|
@@ -2429,14 +2441,24 @@ function isScopedUniversalTailwindPreflightRule(rule) {
|
|
|
2429
2441
|
const declarations = getRuleDeclarations(rule);
|
|
2430
2442
|
return selectors.length > 0 && selectors.every((selector) => hasVueScopedAttr(selector) && SCOPED_UNIVERSAL_PREFLIGHT_SELECTORS.has(normalizeCssSignatureValue(selector))) && declarations.length > 0 && declarations.every((decl) => decl.prop.startsWith("--tw-") || MINI_PROGRAM_PREFLIGHT_DECLARATIONS.has(decl.prop));
|
|
2431
2443
|
}
|
|
2444
|
+
function isScopedUniAppWebTailwindPreflightRule(rule) {
|
|
2445
|
+
const selectors = rule.selectors ?? [rule.selector];
|
|
2446
|
+
const declarations = getRuleDeclarations(rule);
|
|
2447
|
+
return selectors.length > 0 && selectors.every((selector) => hasVueScopedAttr(selector) && UNI_APP_WEB_PREFLIGHT_SELECTORS.has(normalizeCssSignatureValue(selector))) && declarations.length > 0 && declarations.every((decl) => decl.prop.startsWith("--tw-") || MINI_PROGRAM_PREFLIGHT_DECLARATIONS.has(decl.prop));
|
|
2448
|
+
}
|
|
2432
2449
|
function isLikelyTailwindGlobalRule(rule) {
|
|
2433
2450
|
const selectors = rule.selectors ?? [rule.selector];
|
|
2434
2451
|
const declarations = getRuleDeclarations(rule);
|
|
2435
|
-
return isScopedTailwindThemeCarrierRule(rule) || isScopedUniversalTailwindPreflightRule(rule) || selectors.every((selector) => !hasClassSelector(selector) && isLikelyTailwindGlobalSelector(selector)) && declarations.length > 0 && declarations.every(isTailwindPreflightDeclaration);
|
|
2452
|
+
return isScopedTailwindThemeCarrierRule(rule) || isScopedUniversalTailwindPreflightRule(rule) || isScopedUniAppWebTailwindPreflightRule(rule) || selectors.every((selector) => !hasClassSelector(selector) && isLikelyTailwindGlobalSelector(selector)) && declarations.length > 0 && declarations.every(isTailwindPreflightDeclaration);
|
|
2436
2453
|
}
|
|
2437
2454
|
function isLikelyTailwindPropertyAtRule(atRule) {
|
|
2438
2455
|
return atRule.name.toLowerCase() === "property" && normalizeCssSignatureValue(atRule.params).startsWith("--tw-");
|
|
2439
2456
|
}
|
|
2457
|
+
function isLikelyTailwindLayerOrderAtRule(atRule) {
|
|
2458
|
+
if (atRule.name.toLowerCase() !== "layer" || atRule.nodes !== void 0) return false;
|
|
2459
|
+
const params = normalizeCssSignatureValue(atRule.params).replace(/\s+/g, "");
|
|
2460
|
+
return params === "properties" || params === "theme" || params === "base" || params === "theme,base,components,utilities";
|
|
2461
|
+
}
|
|
2440
2462
|
function isUnscopedMiniProgramTailwindPreflightRule(rule) {
|
|
2441
2463
|
const selectors = rule.selectors ?? [rule.selector];
|
|
2442
2464
|
if (selectors.length === 0 || !selectors.every((selector) => {
|
|
@@ -2455,12 +2477,6 @@ function isScopedMiniProgramTailwindContentInitRule(rule) {
|
|
|
2455
2477
|
const declarations = getRuleDeclarations(rule);
|
|
2456
2478
|
return declarations.length > 0 && declarations.every((decl) => decl.prop === "--tw-content");
|
|
2457
2479
|
}
|
|
2458
|
-
function hasUnscopedMiniProgramTailwindPreflightRule(css) {
|
|
2459
|
-
return /(?:^|[{}])\s*view\s*,\s*text\s*,\s*::after\s*,\s*::before\s*\{/.test(css);
|
|
2460
|
-
}
|
|
2461
|
-
function hasScopedMiniProgramTailwindContentInitRule(css) {
|
|
2462
|
-
return /(?:^|[{}])[^{}]*\.data-v-[\w-][^{}]*\{\s*--tw-content\s*:/.test(css);
|
|
2463
|
-
}
|
|
2464
2480
|
//#endregion
|
|
2465
2481
|
//#region src/bundlers/vite/processed-css-assets/coverage.ts
|
|
2466
2482
|
function createDeclarationSignature(rule) {
|
|
@@ -2527,10 +2543,7 @@ function isRuleCoveredByRootCss(rule, coverage) {
|
|
|
2527
2543
|
function removeScopedCssCoveredByRootStyleSources(css, rootSources) {
|
|
2528
2544
|
if (!hasVueScopedAttr(css)) return css;
|
|
2529
2545
|
const hasScopedTailwindGeneratedCss = /tailwindcss v\d/i.test(css);
|
|
2530
|
-
const hasUnscopedMiniProgramPreflight = hasUnscopedMiniProgramTailwindPreflightRule(css);
|
|
2531
|
-
const hasScopedMiniProgramContentInit = hasScopedMiniProgramTailwindContentInitRule(css);
|
|
2532
2546
|
const coverage = collectRootScopedComparableCssCoverage(rootSources);
|
|
2533
|
-
if (coverage.rules.size === 0 && coverage.atRules.size === 0 && !hasScopedTailwindGeneratedCss && !hasUnscopedMiniProgramPreflight && !hasScopedMiniProgramContentInit) return css;
|
|
2534
2547
|
try {
|
|
2535
2548
|
const root = postcss.parse(css);
|
|
2536
2549
|
let changed = false;
|
|
@@ -2541,13 +2554,13 @@ function removeScopedCssCoveredByRootStyleSources(css, rootSources) {
|
|
|
2541
2554
|
}
|
|
2542
2555
|
});
|
|
2543
2556
|
root.walkRules((rule) => {
|
|
2544
|
-
if (isRuleCoveredByRootCss(rule, coverage) || hasScopedTailwindGeneratedCss && isLikelyTailwindGlobalRule(rule) || isUnscopedMiniProgramTailwindPreflightRule(rule) || isScopedMiniProgramTailwindContentInitRule(rule)) {
|
|
2557
|
+
if (isRuleCoveredByRootCss(rule, coverage) || hasScopedTailwindGeneratedCss && isLikelyTailwindGlobalRule(rule) || isUnscopedMiniProgramTailwindPreflightRule(rule) || isScopedMiniProgramTailwindContentInitRule(rule) || isScopedUniAppWebTailwindPreflightRule(rule) || isScopedUniversalTailwindPreflightRule(rule)) {
|
|
2545
2558
|
rule.remove();
|
|
2546
2559
|
changed = true;
|
|
2547
2560
|
}
|
|
2548
2561
|
});
|
|
2549
2562
|
root.walkAtRules((atRule) => {
|
|
2550
|
-
if (coverage.atRules.has(createAtRuleCoverageKey(atRule)) ||
|
|
2563
|
+
if (coverage.atRules.has(createAtRuleCoverageKey(atRule)) || isLikelyTailwindPropertyAtRule(atRule) || isLikelyTailwindLayerOrderAtRule(atRule)) {
|
|
2551
2564
|
atRule.remove();
|
|
2552
2565
|
changed = true;
|
|
2553
2566
|
return;
|
|
@@ -2581,22 +2594,20 @@ function removeCssCoveredByRootStyleBundleSources(bundle, file, css) {
|
|
|
2581
2594
|
if (css.trim().length === 0) return css;
|
|
2582
2595
|
const hasScopedCss = hasVueScopedAttr(css);
|
|
2583
2596
|
const hasScopedTailwindGeneratedCss = hasScopedCss && /tailwindcss v\d/i.test(css);
|
|
2584
|
-
|
|
2585
|
-
const hasScopedMiniProgramContentInit = hasScopedCss && hasScopedMiniProgramTailwindContentInitRule(css);
|
|
2586
|
-
if (rootSources.length === 0 && !hasScopedTailwindGeneratedCss && !hasUnscopedMiniProgramPreflight && !hasScopedMiniProgramContentInit) return css;
|
|
2597
|
+
if (rootSources.length === 0 && !hasScopedCss) return css;
|
|
2587
2598
|
const coverage = collectRootScopedComparableCssCoverage(rootSources);
|
|
2588
2599
|
let nextCss = css;
|
|
2589
2600
|
try {
|
|
2590
2601
|
const root = postcss.parse(css);
|
|
2591
2602
|
let changed = false;
|
|
2592
2603
|
root.walkRules((rule) => {
|
|
2593
|
-
if (coverage.normalizedRuleCss.has(normalizeCssSignatureValue(rule.toString())) || hasScopedCss && (isRuleCoveredByRootCss(rule, coverage) || hasScopedTailwindGeneratedCss && isLikelyTailwindGlobalRule(rule) || isUnscopedMiniProgramTailwindPreflightRule(rule) || isScopedMiniProgramTailwindContentInitRule(rule))) {
|
|
2604
|
+
if (coverage.normalizedRuleCss.has(normalizeCssSignatureValue(rule.toString())) || hasScopedCss && (isRuleCoveredByRootCss(rule, coverage) || hasScopedTailwindGeneratedCss && isLikelyTailwindGlobalRule(rule) || isUnscopedMiniProgramTailwindPreflightRule(rule) || isScopedMiniProgramTailwindContentInitRule(rule) || isScopedUniAppWebTailwindPreflightRule(rule) || isScopedUniversalTailwindPreflightRule(rule))) {
|
|
2594
2605
|
rule.remove();
|
|
2595
2606
|
changed = true;
|
|
2596
2607
|
}
|
|
2597
2608
|
});
|
|
2598
2609
|
if (hasScopedCss) root.walkAtRules((atRule) => {
|
|
2599
|
-
if (coverage.atRules.has(createAtRuleCoverageKey(atRule)) ||
|
|
2610
|
+
if (coverage.atRules.has(createAtRuleCoverageKey(atRule)) || isLikelyTailwindPropertyAtRule(atRule) || isLikelyTailwindLayerOrderAtRule(atRule)) {
|
|
2600
2611
|
atRule.remove();
|
|
2601
2612
|
changed = true;
|
|
2602
2613
|
return;
|
|
@@ -5080,7 +5091,7 @@ function injectHarmonyCssIntoMainAsset(bundle, cssSources, isMainCssAsset, plan,
|
|
|
5080
5091
|
return true;
|
|
5081
5092
|
}
|
|
5082
5093
|
async function handleUniAppXPostCssTasks(options) {
|
|
5083
|
-
const { bundle, debug,
|
|
5094
|
+
const { bundle, debug, getCssHandlerOptions, getSourceCandidateSourcesForEntries, getSourceCandidatesForEntries, getViteProcessedCssAssetResults, isHarmonyAppStyleTarget, isNativeAppStyleTarget, onUpdate, opts, runtimeState, styleHandler, deferStylePlaceholderInjection } = options;
|
|
5084
5095
|
const applyStyleSources = collectUniAppXHarmonyApplyStyleSources(bundle);
|
|
5085
5096
|
if (opts.appType !== "uni-app-x" && !isNativeAppStyleTarget && !isHarmonyAppStyleTarget) return applyStyleSources;
|
|
5086
5097
|
const emissionPlan = new AssetEmissionPlan();
|
|
@@ -5102,7 +5113,7 @@ async function handleUniAppXPostCssTasks(options) {
|
|
|
5102
5113
|
const generated = await generateTailwindV4Css({
|
|
5103
5114
|
opts,
|
|
5104
5115
|
runtimeState,
|
|
5105
|
-
runtime: /* @__PURE__ */ new Set(
|
|
5116
|
+
runtime: /* @__PURE__ */ new Set(),
|
|
5106
5117
|
rawSource: createUniAppXHarmonyApplyGeneratorSource(applyStyleSources, applyUtilities),
|
|
5107
5118
|
file: outputFile,
|
|
5108
5119
|
outputFile,
|
|
@@ -5112,6 +5123,7 @@ async function handleUniAppXPostCssTasks(options) {
|
|
|
5112
5123
|
isMainChunk: false
|
|
5113
5124
|
},
|
|
5114
5125
|
cssStage: "framework-processed",
|
|
5126
|
+
disableSourceScan: true,
|
|
5115
5127
|
getSourceCandidatesForEntries,
|
|
5116
5128
|
styleHandler,
|
|
5117
5129
|
debug
|
|
@@ -5252,7 +5264,7 @@ function normalizeRootMiniProgramImportShellAssets(bundle, options) {
|
|
|
5252
5264
|
//#endregion
|
|
5253
5265
|
//#region src/bundlers/vite/generate-bundle/finalize/bundle.ts
|
|
5254
5266
|
async function finalizeGenerateBundle(options) {
|
|
5255
|
-
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, pruneViteCssCaches, recordCssAssetResult, recordTimingDetail, recordViteProcessedCssAssetResult, rootDir, runtime, runtimeState, shouldPreserveAppCssExtension, snapshot, sourceCandidates, sourceRoot, state, styleHandler, tasks, timingDetails, transformRuntime, transformWebTargetCss, useIncrementalMode } = options;
|
|
5267
|
+
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, pruneViteCssCaches, recordCssAssetResult, recordTimingDetail, recordViteProcessedCssAssetResult, rootDir, runtime, runtimeState, shouldPreserveAppCssExtension, snapshot, sourceCandidates, sourceRoot, state, styleHandler, tasks, timingDetails, transformRuntime, transformWebTargetCss, useIncrementalMode } = options;
|
|
5256
5268
|
const tasksStart = performance.now();
|
|
5257
5269
|
if (cssTaskFactories.length > 0) {
|
|
5258
5270
|
const cssTask = runWithConcurrency(cssTaskFactories, resolveViteCssTaskConcurrency(useIncrementalMode, runtimeState.tailwindRuntime.majorVersion)).then(() => void 0);
|
|
@@ -5298,7 +5310,7 @@ async function finalizeGenerateBundle(options) {
|
|
|
5298
5310
|
});
|
|
5299
5311
|
recordTimingDetail("finalize.processedCss.collect", collectStartedAt);
|
|
5300
5312
|
const injectStartedAt = performance.now();
|
|
5301
|
-
|
|
5313
|
+
let injected = injectViteProcessedCssIntoMainCssAssets(bundle, {
|
|
5302
5314
|
opts,
|
|
5303
5315
|
cssPipelineStrategy,
|
|
5304
5316
|
createCssPipelineContext,
|
|
@@ -5315,6 +5327,26 @@ async function finalizeGenerateBundle(options) {
|
|
|
5315
5327
|
onUpdate,
|
|
5316
5328
|
recordTimingDetail
|
|
5317
5329
|
});
|
|
5330
|
+
if (pendingRememberedCssReplayUpdates.length > 0) {
|
|
5331
|
+
for (const update of pendingRememberedCssReplayUpdates) recordViteProcessedCssAssetResult?.(update.file, update.css, update);
|
|
5332
|
+
injected += injectViteProcessedCssIntoMainCssAssets(bundle, {
|
|
5333
|
+
opts,
|
|
5334
|
+
cssPipelineStrategy,
|
|
5335
|
+
createCssPipelineContext,
|
|
5336
|
+
getViteProcessedCssAssetResults: () => pendingRememberedCssReplayUpdates.map((update) => [update.file, {
|
|
5337
|
+
css: update.css,
|
|
5338
|
+
injectIntoMain: update.injectIntoMain,
|
|
5339
|
+
outputFile: update.outputFile
|
|
5340
|
+
}]),
|
|
5341
|
+
markCssAssetProcessed,
|
|
5342
|
+
recordCssAssetResult,
|
|
5343
|
+
transformCss: transformWebTargetCss,
|
|
5344
|
+
debug,
|
|
5345
|
+
onUpdate,
|
|
5346
|
+
recordTimingDetail
|
|
5347
|
+
});
|
|
5348
|
+
debug("inject remembered css replay updates after framework css collection: %d", pendingRememberedCssReplayUpdates.length);
|
|
5349
|
+
}
|
|
5318
5350
|
recordTimingDetail("finalize.processedCss.inject", injectStartedAt);
|
|
5319
5351
|
return injected;
|
|
5320
5352
|
};
|
|
@@ -5642,6 +5674,53 @@ function resolveUniAppXStyleIsolationEnabled(root) {
|
|
|
5642
5674
|
return enabled;
|
|
5643
5675
|
}
|
|
5644
5676
|
//#endregion
|
|
5677
|
+
//#region src/uni-app-x/vite/author-apply.ts
|
|
5678
|
+
function normalizeSelector(selector) {
|
|
5679
|
+
return selector.replace(/\s+/g, " ").trim();
|
|
5680
|
+
}
|
|
5681
|
+
function atRuleKey(name, params) {
|
|
5682
|
+
return `${name.toLowerCase()}\0${params.replace(/\s+/g, " ").trim()}`;
|
|
5683
|
+
}
|
|
5684
|
+
/**
|
|
5685
|
+
* `@apply` 只应把声明带回作者样式,不能把 Tailwind 根入口的 preflight、
|
|
5686
|
+
* utilities 和 property 注册复制进 scoped style 模块。
|
|
5687
|
+
*/
|
|
5688
|
+
function retainUniAppXAuthorApplyCss(generatedCss, authorCss) {
|
|
5689
|
+
try {
|
|
5690
|
+
const authorRoot = postcss.parse(removeTailwindSourceDirectives(authorCss, { importFallback: true }));
|
|
5691
|
+
const authorSelectors = /* @__PURE__ */ new Set();
|
|
5692
|
+
const authorAtRules = /* @__PURE__ */ new Set();
|
|
5693
|
+
authorRoot.walkRules((rule) => {
|
|
5694
|
+
for (const selector of rule.selectors ?? [rule.selector]) authorSelectors.add(normalizeSelector(selector));
|
|
5695
|
+
});
|
|
5696
|
+
authorRoot.walkAtRules((atRule) => {
|
|
5697
|
+
if (atRule.name !== "apply" && atRule.name !== "reference") authorAtRules.add(atRuleKey(atRule.name, atRule.params));
|
|
5698
|
+
});
|
|
5699
|
+
const root = postcss.parse(generatedCss);
|
|
5700
|
+
let changed = false;
|
|
5701
|
+
root.walkRules((rule) => {
|
|
5702
|
+
if ((rule.selectors ?? [rule.selector]).every((selector) => authorSelectors.has(normalizeSelector(selector)))) return;
|
|
5703
|
+
rule.remove();
|
|
5704
|
+
changed = true;
|
|
5705
|
+
});
|
|
5706
|
+
root.walkAtRules((atRule) => {
|
|
5707
|
+
if (authorAtRules.has(atRuleKey(atRule.name, atRule.params))) return;
|
|
5708
|
+
if (atRule.nodes?.some((node) => node.type === "rule" || node.type === "atrule")) return;
|
|
5709
|
+
atRule.remove();
|
|
5710
|
+
changed = true;
|
|
5711
|
+
});
|
|
5712
|
+
root.walkComments((comment) => {
|
|
5713
|
+
if (/tailwindcss v\d|weapp-tailwindcss (?:vite-generated-css|layer|uni-app-x web preflight reset)/i.test(comment.text)) {
|
|
5714
|
+
comment.remove();
|
|
5715
|
+
changed = true;
|
|
5716
|
+
}
|
|
5717
|
+
});
|
|
5718
|
+
return changed ? root.toString().trim() : generatedCss;
|
|
5719
|
+
} catch {
|
|
5720
|
+
return generatedCss;
|
|
5721
|
+
}
|
|
5722
|
+
}
|
|
5723
|
+
//#endregion
|
|
5645
5724
|
//#region src/uni-app-x/vite/harmony-apply.ts
|
|
5646
5725
|
function createStableHash(input) {
|
|
5647
5726
|
let hash = 2166136261;
|
|
@@ -5652,23 +5731,43 @@ function createStableHash(input) {
|
|
|
5652
5731
|
return (hash >>> 0).toString(36);
|
|
5653
5732
|
}
|
|
5654
5733
|
function createUniAppXHarmonyApplyExpander(options) {
|
|
5734
|
+
const referenceBySourceId = /* @__PURE__ */ new Map();
|
|
5655
5735
|
const styleSources = /* @__PURE__ */ new Set();
|
|
5656
5736
|
const utilities = /* @__PURE__ */ new Set();
|
|
5657
|
-
function rememberSource(code, id) {
|
|
5737
|
+
function rememberSource(code, id, authoritative = false) {
|
|
5658
5738
|
const sources = collectUniAppXHarmonyApplyStyleSourcesFromSource(code, id);
|
|
5739
|
+
const sourceKey = normalizePath(cleanUrl(id));
|
|
5740
|
+
const references = authoritative ? /* @__PURE__ */ new Set() : new Set(referenceBySourceId.get(sourceKey));
|
|
5659
5741
|
for (const source of sources) {
|
|
5660
5742
|
styleSources.add(source);
|
|
5743
|
+
try {
|
|
5744
|
+
postcss.parse(source).walkAtRules("reference", (rule) => {
|
|
5745
|
+
const reference = rule.toString();
|
|
5746
|
+
references.add(reference.endsWith(";") ? reference : `${reference};`);
|
|
5747
|
+
});
|
|
5748
|
+
} catch {}
|
|
5661
5749
|
for (const utility of collectUniAppXHarmonyApplyUtilitiesFromSources([source])) utilities.add(utility);
|
|
5662
5750
|
}
|
|
5751
|
+
if (references.size > 0) referenceBySourceId.set(sourceKey, references);
|
|
5752
|
+
else if (authoritative) referenceBySourceId.delete(sourceKey);
|
|
5753
|
+
}
|
|
5754
|
+
function prepareStyles(code, id) {
|
|
5755
|
+
if (!code.includes("@apply") || code.includes("@reference")) return code;
|
|
5756
|
+
const references = referenceBySourceId.get(normalizePath(cleanUrl(id)));
|
|
5757
|
+
if (references?.size !== 1) return code;
|
|
5758
|
+
return `${references.values().next().value}\n${code}`;
|
|
5663
5759
|
}
|
|
5664
5760
|
async function expandStyles(code, id, hookContext) {
|
|
5665
5761
|
if (!options.isHarmonyBuildTarget() || !code.includes("@apply")) return code;
|
|
5666
|
-
const sources = collectUniAppXHarmonyApplyStyleSourcesFromSource(code, id);
|
|
5762
|
+
const sources = collectUniAppXHarmonyApplyStyleSourcesFromSource(prepareStyles(code, id), id);
|
|
5667
5763
|
const sourceUtilities = collectUniAppXHarmonyApplyUtilitiesFromSources(sources);
|
|
5668
5764
|
if (sources.length === 0 || sourceUtilities.size === 0) return code;
|
|
5669
5765
|
const cssFile = path.resolve(options.getResolvedConfig()?.root ?? process$1.cwd(), `uni-app-x-harmony-apply-${createStableHash(normalizePath(cleanUrl(id)))}.css`);
|
|
5670
|
-
const
|
|
5766
|
+
const generatorSource = createUniAppXHarmonyApplyGeneratorSource(sources, sourceUtilities);
|
|
5767
|
+
const generatedCss = await options.generateCss?.(cssFile, generatorSource, {
|
|
5671
5768
|
addWatchFile: hookContext.addWatchFile?.bind(hookContext),
|
|
5769
|
+
disableSourceScan: true,
|
|
5770
|
+
sourceCandidates: [],
|
|
5672
5771
|
transient: true
|
|
5673
5772
|
});
|
|
5674
5773
|
if (typeof generatedCss !== "string" || generatedCss.trim().length === 0) return code;
|
|
@@ -5676,49 +5775,178 @@ function createUniAppXHarmonyApplyExpander(options) {
|
|
|
5676
5775
|
}
|
|
5677
5776
|
return {
|
|
5678
5777
|
expandStyles,
|
|
5778
|
+
prepareStyles,
|
|
5679
5779
|
rememberSource,
|
|
5680
5780
|
styleSources,
|
|
5681
5781
|
utilities
|
|
5682
5782
|
};
|
|
5683
5783
|
}
|
|
5684
5784
|
//#endregion
|
|
5785
|
+
//#region src/bundlers/vite/module-identity.ts
|
|
5786
|
+
const WINDOWS_DRIVE_RE = /^\/?[a-z]:[\\/]/i;
|
|
5787
|
+
const WINDOWS_UNC_RE = /^(?:\\\\|\/\/)/;
|
|
5788
|
+
function unique(values) {
|
|
5789
|
+
return [...new Set([...values].filter((value) => typeof value === "string" && value.length > 0))];
|
|
5790
|
+
}
|
|
5791
|
+
function decodeFileId(id) {
|
|
5792
|
+
try {
|
|
5793
|
+
return decodeURIComponent(id);
|
|
5794
|
+
} catch {
|
|
5795
|
+
return id;
|
|
5796
|
+
}
|
|
5797
|
+
}
|
|
5798
|
+
function stripViteFsPrefix(id) {
|
|
5799
|
+
if (!id.startsWith("/@fs/")) return id;
|
|
5800
|
+
const file = id.slice(5);
|
|
5801
|
+
return file.startsWith("/") || WINDOWS_DRIVE_RE.test(file) ? file : `/${file}`;
|
|
5802
|
+
}
|
|
5803
|
+
function stripFileProtocol(id) {
|
|
5804
|
+
if (!id.startsWith("file://")) return id;
|
|
5805
|
+
try {
|
|
5806
|
+
return fileURLToPath(id);
|
|
5807
|
+
} catch {
|
|
5808
|
+
return id;
|
|
5809
|
+
}
|
|
5810
|
+
}
|
|
5811
|
+
function isWindowsFile(file) {
|
|
5812
|
+
return WINDOWS_DRIVE_RE.test(file) || WINDOWS_UNC_RE.test(file);
|
|
5813
|
+
}
|
|
5814
|
+
function normalizeWindowsFile(file) {
|
|
5815
|
+
const withoutDriveSlash = /^\/[a-z]:[\\/]/i.test(file) ? file.slice(1) : file;
|
|
5816
|
+
return slash(path.win32.resolve(withoutDriveSlash));
|
|
5817
|
+
}
|
|
5818
|
+
function normalizeFile(file, root) {
|
|
5819
|
+
if (isWindowsFile(file) || isWindowsFile(root)) return normalizeWindowsFile(isWindowsFile(file) ? file : path.win32.resolve(root, file.replace(/^\//, "")));
|
|
5820
|
+
if (path.isAbsolute(file)) {
|
|
5821
|
+
if (file === root || file.startsWith(`${root}${path.sep}`) || existsSync(file) || existsSync(path.dirname(file))) return slash(path.resolve(file));
|
|
5822
|
+
const rootRelativeFile = path.resolve(root, file.slice(1));
|
|
5823
|
+
return existsSync(rootRelativeFile) || existsSync(path.dirname(rootRelativeFile)) ? slash(rootRelativeFile) : slash(path.resolve(file));
|
|
5824
|
+
}
|
|
5825
|
+
return slash(path.resolve(root, file));
|
|
5826
|
+
}
|
|
5827
|
+
function resolveRealFile(file) {
|
|
5828
|
+
if (process$1.platform !== "win32" && isWindowsFile(file)) return file;
|
|
5829
|
+
let current = file;
|
|
5830
|
+
const missingSegments = [];
|
|
5831
|
+
try {
|
|
5832
|
+
while (true) try {
|
|
5833
|
+
const resolvedParent = realpathSync.native(current);
|
|
5834
|
+
return slash(path.join(resolvedParent, ...missingSegments));
|
|
5835
|
+
} catch {
|
|
5836
|
+
const parent = path.dirname(current);
|
|
5837
|
+
if (parent === current) return file;
|
|
5838
|
+
missingSegments.unshift(path.basename(current));
|
|
5839
|
+
current = parent;
|
|
5840
|
+
}
|
|
5841
|
+
} catch {
|
|
5842
|
+
return file;
|
|
5843
|
+
}
|
|
5844
|
+
}
|
|
5845
|
+
function normalizeIdentityKey(file) {
|
|
5846
|
+
return isWindowsFile(file) || process$1.platform === "win32" ? file.toLowerCase() : file;
|
|
5847
|
+
}
|
|
5848
|
+
/**
|
|
5849
|
+
* 将 Vite URL、文件路径和 Windows 的等价路径收敛为同一个模块身份。
|
|
5850
|
+
*/
|
|
5851
|
+
function resolveViteModuleIdentity(id, root = process$1.cwd()) {
|
|
5852
|
+
const cleanId = decodeFileId(cleanUrl(id));
|
|
5853
|
+
const decodedRoot = decodeFileId(cleanUrl(root));
|
|
5854
|
+
const normalizedRoot = isWindowsFile(decodedRoot) ? normalizeWindowsFile(decodedRoot) : slash(path.resolve(decodedRoot));
|
|
5855
|
+
const unwrappedId = stripFileProtocol(stripViteFsPrefix(cleanId));
|
|
5856
|
+
const file = unwrappedId.startsWith("\0") ? void 0 : normalizeFile(unwrappedId, normalizedRoot);
|
|
5857
|
+
const realFile = file ? resolveRealFile(file) : void 0;
|
|
5858
|
+
const key = realFile ? normalizeIdentityKey(realFile) : cleanId;
|
|
5859
|
+
const pathApi = isWindowsFile(normalizedRoot) ? path.win32 : path.posix;
|
|
5860
|
+
const relativeUrl = realFile && normalizeIdentityKey(realFile).startsWith(`${normalizeIdentityKey(normalizedRoot)}/`) ? `/${slash(pathApi.relative(normalizedRoot, realFile))}` : void 0;
|
|
5861
|
+
return {
|
|
5862
|
+
cleanId,
|
|
5863
|
+
file: realFile,
|
|
5864
|
+
key,
|
|
5865
|
+
lookupFiles: unique([file, realFile]),
|
|
5866
|
+
lookupIds: unique([
|
|
5867
|
+
id,
|
|
5868
|
+
cleanId,
|
|
5869
|
+
unwrappedId,
|
|
5870
|
+
file,
|
|
5871
|
+
realFile,
|
|
5872
|
+
realFile ? `/@fs/${realFile}` : void 0,
|
|
5873
|
+
relativeUrl
|
|
5874
|
+
])
|
|
5875
|
+
};
|
|
5876
|
+
}
|
|
5877
|
+
function hasSameViteModuleIdentity(left, right, root = process$1.cwd()) {
|
|
5878
|
+
if (!left || !right) return false;
|
|
5879
|
+
return resolveViteModuleIdentity(left, root).key === resolveViteModuleIdentity(right, root).key;
|
|
5880
|
+
}
|
|
5881
|
+
//#endregion
|
|
5685
5882
|
//#region src/bundlers/vite/hot-css-modules.ts
|
|
5686
|
-
function
|
|
5883
|
+
async function resolveHotModulesByIds(ctx, ids, acceptModule) {
|
|
5687
5884
|
const modules = [];
|
|
5688
5885
|
const seenModules = /* @__PURE__ */ new Set();
|
|
5689
5886
|
const seenModuleIds = /* @__PURE__ */ new Set();
|
|
5887
|
+
const seenFileIdentities = /* @__PURE__ */ new Set();
|
|
5888
|
+
const root = ctx.server.config?.root ?? process$1.cwd();
|
|
5889
|
+
const collectModule = (mod) => {
|
|
5890
|
+
if (mod == null || seenModules.has(mod) || !acceptModule(mod)) return;
|
|
5891
|
+
seenModules.add(mod);
|
|
5892
|
+
modules.push(mod);
|
|
5893
|
+
};
|
|
5894
|
+
for (const id of ids) {
|
|
5895
|
+
if (typeof id !== "string" || id.length === 0) continue;
|
|
5896
|
+
const identity = resolveViteModuleIdentity(id, root);
|
|
5897
|
+
for (const moduleId of identity.lookupIds) {
|
|
5898
|
+
if (seenModuleIds.has(moduleId)) continue;
|
|
5899
|
+
seenModuleIds.add(moduleId);
|
|
5900
|
+
collectModule(ctx.server.moduleGraph.getModuleById?.(moduleId));
|
|
5901
|
+
if (moduleId.startsWith("/")) collectModule(await ctx.server.moduleGraph.getModuleByUrl?.(moduleId));
|
|
5902
|
+
}
|
|
5903
|
+
if (seenFileIdentities.has(identity.key)) continue;
|
|
5904
|
+
seenFileIdentities.add(identity.key);
|
|
5905
|
+
for (const file of identity.lookupFiles) for (const mod of ctx.server.moduleGraph.getModulesByFile?.(file) ?? []) collectModule(mod);
|
|
5906
|
+
}
|
|
5907
|
+
return modules;
|
|
5908
|
+
}
|
|
5909
|
+
async function resolveHotTailwindCssModules(ctx, tailwindRootCssModuleIds) {
|
|
5690
5910
|
const root = ctx.server.config?.root ?? process$1.cwd();
|
|
5691
|
-
const outDir = ctx.server.config?.build?.outDir ?
|
|
5911
|
+
const outDir = ctx.server.config?.build?.outDir ? resolveViteModuleIdentity(ctx.server.config.build.outDir, root) : void 0;
|
|
5692
5912
|
const isHotSourceStyleModule = (id) => {
|
|
5693
5913
|
if (!isSourceStyleRequest(id)) return false;
|
|
5694
5914
|
const file = cleanUrl(id);
|
|
5695
5915
|
if (isRootMiniProgramStyleUrl(file) || !isAbsoluteFilePath(file) && !file.startsWith("/")) return false;
|
|
5696
|
-
if (outDir
|
|
5697
|
-
const
|
|
5698
|
-
if (
|
|
5916
|
+
if (outDir) {
|
|
5917
|
+
const identity = resolveViteModuleIdentity(file, root);
|
|
5918
|
+
if (identity.key === outDir.key || identity.key.startsWith(`${outDir.key}/`)) return false;
|
|
5699
5919
|
}
|
|
5700
5920
|
return true;
|
|
5701
5921
|
};
|
|
5702
|
-
const
|
|
5703
|
-
if (mod == null || seenModules.has(mod)) return;
|
|
5922
|
+
const modules = await resolveHotModulesByIds(ctx, tailwindRootCssModuleIds, (mod) => {
|
|
5704
5923
|
const modId = mod.id ?? mod.url;
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
if (moduleId.length === 0 || seenModuleIds.has(moduleId)) continue;
|
|
5714
|
-
seenModuleIds.add(moduleId);
|
|
5715
|
-
const candidates = [ctx.server.moduleGraph.getModuleById(moduleId), ...ctx.server.moduleGraph.getModulesByFile(moduleId) ?? []];
|
|
5716
|
-
for (const mod of candidates) collectModule(mod);
|
|
5924
|
+
return isHotSourceStyleModule(modId);
|
|
5925
|
+
});
|
|
5926
|
+
const seenHotModules = new Set(modules);
|
|
5927
|
+
for (let index = 0; index < modules.length; index++) for (const importer of modules[index]?.importers ?? []) {
|
|
5928
|
+
const importerId = importer.id ?? importer.url;
|
|
5929
|
+
if (!seenHotModules.has(importer) && isHotSourceStyleModule(importerId)) {
|
|
5930
|
+
seenHotModules.add(importer);
|
|
5931
|
+
modules.push(importer);
|
|
5717
5932
|
}
|
|
5718
5933
|
}
|
|
5934
|
+
for (const mod of modules) ctx.server.moduleGraph.invalidateModule(mod);
|
|
5719
5935
|
return modules;
|
|
5720
5936
|
}
|
|
5721
|
-
function
|
|
5937
|
+
async function resolveHotSourceModulesByIds(ctx, ids) {
|
|
5938
|
+
const root = ctx.server.config?.root ?? process$1.cwd();
|
|
5939
|
+
const sourceIds = new Set(ids);
|
|
5940
|
+
for (const id of ids) {
|
|
5941
|
+
if (typeof id !== "string" || !/\.(?:uvue|nvue)(?:$|[?#])/i.test(id)) continue;
|
|
5942
|
+
const identity = resolveViteModuleIdentity(id, root);
|
|
5943
|
+
for (const lookupId of identity.lookupIds) if (!/[?&]import(?:[=&]|$)/.test(lookupId)) sourceIds.add(`${cleanUrl(lookupId)}?import`);
|
|
5944
|
+
}
|
|
5945
|
+
return resolveHotModulesByIds(ctx, sourceIds, (mod) => {
|
|
5946
|
+
return !isSourceStyleRequest(mod.id ?? mod.url);
|
|
5947
|
+
});
|
|
5948
|
+
}
|
|
5949
|
+
async function resolveHotSourceModules(ctx) {
|
|
5722
5950
|
const modules = [];
|
|
5723
5951
|
const seenModules = /* @__PURE__ */ new Set();
|
|
5724
5952
|
const collectModule = (mod) => {
|
|
@@ -5728,10 +5956,27 @@ function resolveHotSourceModules(ctx) {
|
|
|
5728
5956
|
modules.push(mod);
|
|
5729
5957
|
};
|
|
5730
5958
|
for (const mod of ctx.modules) collectModule(mod);
|
|
5731
|
-
for (const mod of
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5959
|
+
for (const mod of await resolveHotSourceModulesByIds(ctx, [ctx.file])) collectModule(mod);
|
|
5960
|
+
return modules;
|
|
5961
|
+
}
|
|
5962
|
+
function mergeHotModulesByIdentity(root, ...groups) {
|
|
5963
|
+
const modules = [];
|
|
5964
|
+
const seenModules = /* @__PURE__ */ new Set();
|
|
5965
|
+
const seenIdentities = /* @__PURE__ */ new Set();
|
|
5966
|
+
for (const mod of groups.flat()) {
|
|
5967
|
+
if (seenModules.has(mod)) continue;
|
|
5968
|
+
const ids = [
|
|
5969
|
+
mod.id,
|
|
5970
|
+
mod.url,
|
|
5971
|
+
mod.file
|
|
5972
|
+
].filter((id) => typeof id === "string" && id.length > 0);
|
|
5973
|
+
const moduleKind = ids.some(isSourceStyleRequest) ? "style" : "source";
|
|
5974
|
+
const keys = ids.map((id) => `${moduleKind}:${resolveViteModuleIdentity(id, root).key}`);
|
|
5975
|
+
if (keys.some((key) => seenIdentities.has(key))) continue;
|
|
5976
|
+
seenModules.add(mod);
|
|
5977
|
+
keys.forEach((key) => seenIdentities.add(key));
|
|
5978
|
+
modules.push(mod);
|
|
5979
|
+
}
|
|
5735
5980
|
return modules;
|
|
5736
5981
|
}
|
|
5737
5982
|
function resolveModuleHotUrl(mod) {
|
|
@@ -5750,23 +5995,32 @@ function isRootMiniProgramStyleUrl(file) {
|
|
|
5750
5995
|
}
|
|
5751
5996
|
function resolveCssHotUrl(id, root) {
|
|
5752
5997
|
const suffix = /[?#]/.test(id) ? id.slice(id.search(/[?#]/)) : "";
|
|
5753
|
-
const
|
|
5754
|
-
if (/^\/(
|
|
5755
|
-
if (isRootMiniProgramStyleUrl(
|
|
5756
|
-
return `${
|
|
5998
|
+
const cleanId = cleanUrl(id);
|
|
5999
|
+
if (/^\/(?!@fs\/|[A-Z]:)/i.test(cleanId) && !cleanId.startsWith(slash(root))) {
|
|
6000
|
+
if (isRootMiniProgramStyleUrl(cleanId)) return;
|
|
6001
|
+
return `${cleanId}${suffix}`;
|
|
5757
6002
|
}
|
|
6003
|
+
const file = resolveViteModuleIdentity(id, root).file ?? cleanId;
|
|
5758
6004
|
if (!isAbsoluteFilePath(file)) return;
|
|
5759
6005
|
const normalizedRoot = normalizeAbsoluteFilePath(root);
|
|
5760
6006
|
const normalizedFile = normalizeAbsoluteFilePath(file);
|
|
5761
6007
|
if (!normalizedFile.startsWith(`${normalizedRoot}/`)) return;
|
|
5762
6008
|
return `/${slash(path.relative(normalizedRoot, normalizedFile))}${suffix}`;
|
|
5763
6009
|
}
|
|
5764
|
-
function includesHotModule(modules, target) {
|
|
6010
|
+
function includesHotModule(modules, target, root) {
|
|
5765
6011
|
const targetUrl = resolveModuleHotUrl(target);
|
|
5766
6012
|
const targetId = target.id;
|
|
5767
6013
|
return modules.some((mod) => {
|
|
5768
6014
|
if (mod === target) return true;
|
|
5769
|
-
return targetUrl !== void 0 && resolveModuleHotUrl(mod) === targetUrl || typeof targetId === "string" && targetId.length > 0 && mod.id === targetId
|
|
6015
|
+
return targetUrl !== void 0 && resolveModuleHotUrl(mod) === targetUrl || typeof targetId === "string" && targetId.length > 0 && mod.id === targetId || [
|
|
6016
|
+
target.id,
|
|
6017
|
+
target.url,
|
|
6018
|
+
target.file
|
|
6019
|
+
].some((targetIdentity) => [
|
|
6020
|
+
mod.id,
|
|
6021
|
+
mod.url,
|
|
6022
|
+
mod.file
|
|
6023
|
+
].some((moduleIdentity) => hasSameViteModuleIdentity(targetIdentity, moduleIdentity, root)));
|
|
5770
6024
|
});
|
|
5771
6025
|
}
|
|
5772
6026
|
function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
@@ -5784,10 +6038,16 @@ function hasSelfAcceptingNonStyleHotModule(modules) {
|
|
|
5784
6038
|
return !isSourceStyleRequest(mod.id ?? mod.url) && mod.isSelfAccepting === true;
|
|
5785
6039
|
});
|
|
5786
6040
|
}
|
|
5787
|
-
function sendSupplementalCssHotUpdates(ctx, cssModules, fallbackCssIds = []) {
|
|
6041
|
+
function sendSupplementalCssHotUpdates(ctx, cssModules, fallbackCssIds = [], fallbackSourceIds = []) {
|
|
5788
6042
|
const seenUrls = /* @__PURE__ */ new Set();
|
|
5789
6043
|
const root = ctx.server.config?.root ?? process$1.cwd();
|
|
5790
6044
|
const updates = [];
|
|
6045
|
+
for (const id of fallbackSourceIds) {
|
|
6046
|
+
const hotUrl = resolveCssHotUrl(id, root);
|
|
6047
|
+
if (!hotUrl || seenUrls.has(hotUrl)) continue;
|
|
6048
|
+
seenUrls.add(hotUrl);
|
|
6049
|
+
updates.push(createSupplementalHotUpdate(hotUrl, ctx.timestamp));
|
|
6050
|
+
}
|
|
5791
6051
|
for (const id of fallbackCssIds) {
|
|
5792
6052
|
if (!isSourceStyleRequest(id)) continue;
|
|
5793
6053
|
const hotUrl = resolveCssHotUrl(id, root);
|
|
@@ -5796,7 +6056,7 @@ function sendSupplementalCssHotUpdates(ctx, cssModules, fallbackCssIds = []) {
|
|
|
5796
6056
|
updates.push(createSupplementalHotUpdate(hotUrl, ctx.timestamp));
|
|
5797
6057
|
}
|
|
5798
6058
|
for (const mod of cssModules) {
|
|
5799
|
-
if (includesHotModule(ctx.modules, mod)) continue;
|
|
6059
|
+
if (includesHotModule(ctx.modules, mod, root)) continue;
|
|
5800
6060
|
const moduleHotUrl = resolveModuleHotUrl(mod);
|
|
5801
6061
|
const hotUrl = moduleHotUrl ? resolveCssHotUrl(moduleHotUrl, root) : void 0;
|
|
5802
6062
|
if (!hotUrl || seenUrls.has(hotUrl)) continue;
|
|
@@ -5831,12 +6091,25 @@ function createUniAppXNativeHmrReloader(options) {
|
|
|
5831
6091
|
}
|
|
5832
6092
|
async function handleHotUpdate(ctx) {
|
|
5833
6093
|
if (!options.isNativeAppBuildTarget(ctx.file)) return;
|
|
5834
|
-
|
|
6094
|
+
await options.syncSourceCandidates?.(ctx);
|
|
5835
6095
|
const currentRuntimeClassSet = await options.ensureRuntimeClassSet(true);
|
|
5836
|
-
const
|
|
6096
|
+
const hasRuntimeClassChange = previousRuntimeClassSet !== void 0 && (currentRuntimeClassSet.size !== previousRuntimeClassSet.size || [...currentRuntimeClassSet].some((candidate) => !previousRuntimeClassSet.has(candidate)));
|
|
5837
6097
|
remember(currentRuntimeClassSet);
|
|
5838
|
-
|
|
5839
|
-
|
|
6098
|
+
const cssModules = ctx.server?.moduleGraph ? await resolveHotTailwindCssModules(ctx, /* @__PURE__ */ new Set([...options.tailwindRootCssModuleIds, ...options.viteProcessedCssSourceFiles])) : [];
|
|
6099
|
+
const sourceModules = ctx.server?.moduleGraph ? await resolveHotSourceModules(ctx) : ctx.modules ?? [];
|
|
6100
|
+
const localStyleModules = hasRuntimeClassChange && ctx.server?.moduleGraph ? await resolveHotSourceModulesByIds(ctx, options.localStyleModuleIds) : [];
|
|
6101
|
+
for (const mod of /* @__PURE__ */ new Set([...sourceModules, ...localStyleModules])) ctx.server?.moduleGraph?.invalidateModule(mod);
|
|
6102
|
+
const modules = [.../* @__PURE__ */ new Set([
|
|
6103
|
+
...sourceModules,
|
|
6104
|
+
...localStyleModules,
|
|
6105
|
+
...cssModules
|
|
6106
|
+
])];
|
|
6107
|
+
const canAcceptUpdate = hasSelfAcceptingNonStyleHotModule([...sourceModules, ...localStyleModules]) || cssModules.length > 0;
|
|
6108
|
+
if (hasRuntimeClassChange && !canAcceptUpdate) {
|
|
6109
|
+
sendFullReloadForUnresolvedHotUpdate(ctx);
|
|
6110
|
+
return [];
|
|
6111
|
+
}
|
|
6112
|
+
return modules.length > 0 ? modules : void 0;
|
|
5840
6113
|
}
|
|
5841
6114
|
return {
|
|
5842
6115
|
handleHotUpdate,
|
|
@@ -5856,12 +6129,7 @@ function createUniAppXNativeBuildTargetResolver(getResolvedConfig) {
|
|
|
5856
6129
|
};
|
|
5857
6130
|
}
|
|
5858
6131
|
//#endregion
|
|
5859
|
-
//#region src/uni-app-x/vite.ts
|
|
5860
|
-
let transformUVuePromise;
|
|
5861
|
-
function loadTransformUVue() {
|
|
5862
|
-
transformUVuePromise ?? (transformUVuePromise = import("./transform-BbaPIji9.js").then((mod) => mod.transformUVue));
|
|
5863
|
-
return transformUVuePromise;
|
|
5864
|
-
}
|
|
6132
|
+
//#region src/uni-app-x/vite/style-request.ts
|
|
5865
6133
|
const preprocessorLangs = /* @__PURE__ */ new Set([
|
|
5866
6134
|
"scss",
|
|
5867
6135
|
"sass",
|
|
@@ -5871,8 +6139,7 @@ const preprocessorLangs = /* @__PURE__ */ new Set([
|
|
|
5871
6139
|
]);
|
|
5872
6140
|
const INLINE_LANG_RE = /lang\.([a-z]+)/i;
|
|
5873
6141
|
const PREPROCESSOR_EXT_RE = /\.(?:scss|sass|less|styl|stylus)(?:\?|$)/i;
|
|
5874
|
-
const
|
|
5875
|
-
const UVUE_NVUE_RE = /\.(?:uvue|nvue)$/;
|
|
6142
|
+
const UVUE_NVUE_RE$1 = /\.(?:uvue|nvue)$/;
|
|
5876
6143
|
const CSS_MODULE_EXPORT_RE = /^\s*export\s+default\s+(?:\{|\w|\[\])/;
|
|
5877
6144
|
function isPreprocessorRequest(id, lang) {
|
|
5878
6145
|
const normalizedLang = lang?.toLowerCase();
|
|
@@ -5882,25 +6149,48 @@ function isPreprocessorRequest(id, lang) {
|
|
|
5882
6149
|
return PREPROCESSOR_EXT_RE.test(id);
|
|
5883
6150
|
}
|
|
5884
6151
|
function resolveUniAppXCssTarget(id) {
|
|
5885
|
-
return UVUE_NVUE_RE.test(cleanUrl(id)) ? "uvue" : void 0;
|
|
5886
|
-
}
|
|
5887
|
-
function resolveUniAppXJsTransformEnabled(uniAppX) {
|
|
5888
|
-
return uniAppX === void 0 ? true : isUniAppXEnabled(uniAppX);
|
|
6152
|
+
return UVUE_NVUE_RE$1.test(cleanUrl(id)) ? "uvue" : void 0;
|
|
5889
6153
|
}
|
|
5890
6154
|
function isCssModuleExport(code) {
|
|
5891
6155
|
return CSS_MODULE_EXPORT_RE.test(code);
|
|
5892
6156
|
}
|
|
6157
|
+
function resolvePreprocessorTransform(code, id, lang, options) {
|
|
6158
|
+
if (!isPreprocessorRequest(id, lang)) return;
|
|
6159
|
+
if (options.isIosPlatform) {
|
|
6160
|
+
const normalizedCode = normalizeTailwindcssV4InfinityCalcCss(code);
|
|
6161
|
+
return { result: normalizedCode === code ? void 0 : {
|
|
6162
|
+
code: normalizedCode,
|
|
6163
|
+
map: null
|
|
6164
|
+
} };
|
|
6165
|
+
}
|
|
6166
|
+
if (options.isWebGeneratorTarget && !options.isNativeAppStyleTarget) return { result: void 0 };
|
|
6167
|
+
}
|
|
6168
|
+
//#endregion
|
|
6169
|
+
//#region src/uni-app-x/vite.ts
|
|
6170
|
+
let transformUVuePromise;
|
|
6171
|
+
function loadTransformUVue() {
|
|
6172
|
+
transformUVuePromise ?? (transformUVuePromise = import("./transform-DhDe9eSf.js").then((mod) => mod.transformUVue));
|
|
6173
|
+
return transformUVuePromise;
|
|
6174
|
+
}
|
|
6175
|
+
const UVUE_NVUE_QUERY_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
6176
|
+
const UVUE_NVUE_RE = /\.(?:uvue|nvue)$/;
|
|
6177
|
+
function resolveUniAppXJsTransformEnabled(uniAppX) {
|
|
6178
|
+
return uniAppX === void 0 ? true : isUniAppXEnabled(uniAppX);
|
|
6179
|
+
}
|
|
5893
6180
|
function createUniAppXPlugins(options) {
|
|
5894
|
-
const { appType, customAttributesEntities, disabledDefaultTemplateHandler, isIosPlatform: providedIosPlatform, mainCssChunkMatcher, runtimeState, styleHandler, tailwindRootCssModuleIds = [], generateCss, jsHandler, ensureRuntimeClassSet, getResolvedConfig, isEnabled = () => true, uniAppX, viteProcessedCssSourceFiles = [] } = options;
|
|
6181
|
+
const { appType, customAttributesEntities, disabledDefaultTemplateHandler, isIosPlatform: providedIosPlatform, mainCssChunkMatcher, runtimeState, styleHandler, syncSourceCandidatesForHotUpdate, tailwindRootCssModuleIds = [], generateCss, jsHandler, ensureRuntimeClassSet, getResolvedConfig, isEnabled = () => true, isNativeAppStyleTarget = () => false, isWebGeneratorTarget = () => resolveUniUtsPlatform().isWeb, uniAppX, viteProcessedCssSourceFiles = [] } = options;
|
|
5895
6182
|
const resolvedUniAppXOptions = resolveUniAppXOptions(uniAppX);
|
|
5896
6183
|
const utsPlatform = resolveUniUtsPlatform();
|
|
5897
6184
|
const isIosPlatform = providedIosPlatform ?? utsPlatform.isAppIos;
|
|
5898
6185
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
6186
|
+
const nativeLocalStyleModuleIds = /* @__PURE__ */ new Set();
|
|
5899
6187
|
let componentLocalStyleEnabled;
|
|
5900
6188
|
const isNativeAppBuildTarget = createUniAppXNativeBuildTargetResolver(getResolvedConfig);
|
|
5901
6189
|
const nativeHmrReloader = createUniAppXNativeHmrReloader({
|
|
5902
6190
|
ensureRuntimeClassSet,
|
|
5903
6191
|
isNativeAppBuildTarget,
|
|
6192
|
+
localStyleModuleIds: nativeLocalStyleModuleIds,
|
|
6193
|
+
syncSourceCandidates: syncSourceCandidatesForHotUpdate,
|
|
5904
6194
|
tailwindRootCssModuleIds,
|
|
5905
6195
|
viteProcessedCssSourceFiles
|
|
5906
6196
|
});
|
|
@@ -5925,13 +6215,15 @@ function createUniAppXPlugins(options) {
|
|
|
5925
6215
|
if (resolveUniUtsPlatform().isAppHarmony) return true;
|
|
5926
6216
|
return isUniAppXHarmonyOutDir(getResolvedConfig()?.build?.outDir);
|
|
5927
6217
|
}
|
|
5928
|
-
function getStyleHandlerOptions(id) {
|
|
5929
|
-
const
|
|
6218
|
+
function getStyleHandlerOptions(id, source) {
|
|
6219
|
+
const isMainChunk = source === "tailwind-root" || mainCssChunkMatcher(id, appType);
|
|
6220
|
+
const cacheKey = `${isMainChunk ? "1" : "0"}:${source ?? ""}:${id}`;
|
|
5930
6221
|
let styleHandlerOptions = cssHandlerOptionsCache.get(cacheKey);
|
|
5931
6222
|
if (!styleHandlerOptions) {
|
|
5932
6223
|
styleHandlerOptions = omitUndefined({
|
|
5933
|
-
isMainChunk
|
|
6224
|
+
isMainChunk,
|
|
5934
6225
|
uniAppXCssTarget: isNativeAppBuildTarget(id) ? resolveUniAppXCssTarget(id) : void 0,
|
|
6226
|
+
uniAppXCssSource: isNativeAppBuildTarget(id) ? source : void 0,
|
|
5935
6227
|
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
5936
6228
|
postcssOptions: { options: {
|
|
5937
6229
|
from: id,
|
|
@@ -5951,16 +6243,24 @@ function createUniAppXPlugins(options) {
|
|
|
5951
6243
|
for (const warning of warnings) logger$1.warn(warning.toString());
|
|
5952
6244
|
}
|
|
5953
6245
|
async function transformStyle(code, id, query, hookContext) {
|
|
5954
|
-
isNativeAppBuildTarget(id);
|
|
6246
|
+
const isNativeStyle = isNativeAppBuildTarget(id);
|
|
5955
6247
|
const parsed = query ?? parseVueRequest(id).query;
|
|
5956
6248
|
if (isCSSRequest(id) || parsed.vue && parsed.type === "style") {
|
|
5957
6249
|
if (isCssModuleExport(code)) return;
|
|
5958
|
-
const
|
|
5959
|
-
|
|
6250
|
+
const hasTailwindRoot = hasTailwindRootDirectives(code, { importFallback: true });
|
|
6251
|
+
const hasTailwindApply = hasTailwindApplyDirective(code);
|
|
6252
|
+
const shouldGenerateCss = hasTailwindRoot || hasTailwindApply;
|
|
6253
|
+
const isNativeSfcAuthorStyle = isNativeStyle && resolveUniAppXCssTarget(id) === "uvue";
|
|
6254
|
+
if (!shouldGenerateCss && (!isNativeStyle || isNativeSfcAuthorStyle)) return;
|
|
5960
6255
|
harmonyApply.rememberSource(code, id);
|
|
5961
|
-
const generatedCss = shouldGenerateCss ? await generateCss?.(id, code,
|
|
5962
|
-
|
|
5963
|
-
|
|
6256
|
+
const generatedCss = shouldGenerateCss ? await generateCss?.(id, isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot ? harmonyApply.prepareStyles(code, id) : code, {
|
|
6257
|
+
...hookContext,
|
|
6258
|
+
disableSourceScan: isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot,
|
|
6259
|
+
sourceCandidates: isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot ? [] : void 0,
|
|
6260
|
+
transient: isNativeSfcAuthorStyle && hasTailwindApply && !hasTailwindRoot
|
|
6261
|
+
}) : void 0;
|
|
6262
|
+
const styleCode = typeof generatedCss === "string" && generatedCss.trim().length > 0 ? hasTailwindApply && !hasTailwindRoot ? retainUniAppXAuthorApplyCss(generatedCss, code) : generatedCss : code;
|
|
6263
|
+
const styleHandlerOptions = getStyleHandlerOptions(id, isNativeStyle && hasTailwindRoot ? "tailwind-root" : isNativeStyle ? "author-apply" : void 0);
|
|
5964
6264
|
const postcssResult = await styleHandler(styleCode, styleHandlerOptions);
|
|
5965
6265
|
reportStyleWarnings(postcssResult);
|
|
5966
6266
|
const postcssMap = await formatPostcssSourceMap(postcssResult.map.toJSON(), normalizePath(cleanUrl(id)));
|
|
@@ -5975,7 +6275,7 @@ function createUniAppXPlugins(options) {
|
|
|
5975
6275
|
getResolvedConfig,
|
|
5976
6276
|
isHarmonyBuildTarget,
|
|
5977
6277
|
async transformCss(css, id) {
|
|
5978
|
-
const result = await styleHandler(css, getStyleHandlerOptions(id));
|
|
6278
|
+
const result = await styleHandler(css, getStyleHandlerOptions(id, "author-apply"));
|
|
5979
6279
|
reportStyleWarnings(result);
|
|
5980
6280
|
return result.css;
|
|
5981
6281
|
}
|
|
@@ -5994,14 +6294,12 @@ function createUniAppXPlugins(options) {
|
|
|
5994
6294
|
if (!isEnabled()) return;
|
|
5995
6295
|
await runtimeState.readyPromise;
|
|
5996
6296
|
const { query } = parseVueRequest(id);
|
|
5997
|
-
const
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
};
|
|
6004
|
-
}
|
|
6297
|
+
const preprocessor = resolvePreprocessorTransform(code, id, query.lang, {
|
|
6298
|
+
isIosPlatform,
|
|
6299
|
+
isNativeAppStyleTarget: isNativeAppStyleTarget(),
|
|
6300
|
+
isWebGeneratorTarget: isWebGeneratorTarget()
|
|
6301
|
+
});
|
|
6302
|
+
if (preprocessor) return preprocessor.result;
|
|
6005
6303
|
return transformStyle(code, id, query, this);
|
|
6006
6304
|
}
|
|
6007
6305
|
}];
|
|
@@ -6012,40 +6310,46 @@ function createUniAppXPlugins(options) {
|
|
|
6012
6310
|
if (!isEnabled()) return;
|
|
6013
6311
|
await nativeHmrReloader.refreshBaseline();
|
|
6014
6312
|
},
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6313
|
+
transform: {
|
|
6314
|
+
order: "pre",
|
|
6315
|
+
async handler(code, id) {
|
|
6316
|
+
if (!isEnabled()) return;
|
|
6317
|
+
if (!UVUE_NVUE_QUERY_RE.test(id)) return;
|
|
6318
|
+
if (isNativeAppBuildTarget(id)) {
|
|
6319
|
+
nativeLocalStyleModuleIds.add(id);
|
|
6320
|
+
nativeLocalStyleModuleIds.add(cleanUrl(id));
|
|
6321
|
+
}
|
|
6322
|
+
harmonyApply.rememberSource(code, id, true);
|
|
6323
|
+
const resolvedConfig = getResolvedConfig();
|
|
6324
|
+
const isServeCommand = resolvedConfig?.command === "serve";
|
|
6325
|
+
const isWatchBuild = resolvedConfig?.command === "build" && !!resolvedConfig.build?.watch;
|
|
6326
|
+
const isNonWatchBuild = resolvedConfig?.command === "build" && !resolvedConfig.build?.watch;
|
|
6327
|
+
const currentRuntimeSet = isServeCommand || isWatchBuild || isNonWatchBuild ? await ensureRuntimeClassSet(true) : await ensureRuntimeClassSet();
|
|
6328
|
+
nativeHmrReloader.remember(currentRuntimeSet);
|
|
6329
|
+
const transformUVue = await loadTransformUVue();
|
|
6330
|
+
const enableComponentLocalStyle = shouldEnableComponentLocalStyle();
|
|
6331
|
+
const enablePageLocalStyle = shouldEnableNativePageLocalStyle(id);
|
|
6332
|
+
const result = customAttributesEntities.length > 0 || disabledDefaultTemplateHandler || enableComponentLocalStyle || enablePageLocalStyle ? transformUVue(code, id, jsHandler, currentRuntimeSet, omitUndefined({
|
|
6333
|
+
...customAttributesEntities.length > 0 ? { customAttributesEntities } : {},
|
|
6334
|
+
...disabledDefaultTemplateHandler ? { disabledDefaultTemplateHandler } : {},
|
|
6335
|
+
...enableComponentLocalStyle ? { enableComponentLocalStyle } : {},
|
|
6336
|
+
...enablePageLocalStyle ? { enablePageLocalStyle } : {}
|
|
6337
|
+
})) : transformUVue(code, id, jsHandler, currentRuntimeSet);
|
|
6338
|
+
if (result?.code) {
|
|
6339
|
+
harmonyApply.rememberSource(result.code, id);
|
|
6340
|
+
const expandedCode = await harmonyApply.expandStyles(result.code, id, this);
|
|
6341
|
+
if (expandedCode !== result.code) return {
|
|
6342
|
+
code: expandedCode,
|
|
6343
|
+
map: null
|
|
6344
|
+
};
|
|
6345
|
+
}
|
|
6346
|
+
return result;
|
|
6042
6347
|
}
|
|
6043
|
-
return result;
|
|
6044
6348
|
},
|
|
6045
6349
|
async handleHotUpdate(ctx) {
|
|
6046
6350
|
if (!isEnabled()) return;
|
|
6047
6351
|
if (getResolvedConfig()?.command !== "serve") return;
|
|
6048
|
-
if (!UVUE_NVUE_RE.test(ctx.file)) return;
|
|
6352
|
+
if (!UVUE_NVUE_RE.test(ctx.file) && !isCSSRequest(ctx.file)) return;
|
|
6049
6353
|
return nativeHmrReloader.handleHotUpdate(ctx);
|
|
6050
6354
|
},
|
|
6051
6355
|
async watchChange(id) {
|
|
@@ -6074,7 +6378,12 @@ function createUniAppXPlugins(options) {
|
|
|
6074
6378
|
const applyUtilities = /* @__PURE__ */ new Set([...harmonyApply.utilities, ...collectUniAppXHarmonyApplyUtilities(bundle)]);
|
|
6075
6379
|
if (applyStyleSources.length > 0 && applyUtilities.size > 0) {
|
|
6076
6380
|
const harmonyApplyCssFile = path.resolve(getResolvedConfig()?.root ?? process$1.cwd(), "uni-app-x-harmony-apply.css");
|
|
6077
|
-
const generatedCss = await generateCss?.(harmonyApplyCssFile, createUniAppXHarmonyApplyGeneratorSource(applyStyleSources, applyUtilities),
|
|
6381
|
+
const generatedCss = await generateCss?.(harmonyApplyCssFile, createUniAppXHarmonyApplyGeneratorSource(applyStyleSources, applyUtilities), {
|
|
6382
|
+
addWatchFile: this?.addWatchFile?.bind(this),
|
|
6383
|
+
disableSourceScan: true,
|
|
6384
|
+
sourceCandidates: [],
|
|
6385
|
+
transient: true
|
|
6386
|
+
});
|
|
6078
6387
|
if (typeof generatedCss === "string" && generatedCss.trim().length > 0) cssSources.push(generatedCss);
|
|
6079
6388
|
}
|
|
6080
6389
|
injectUniAppXHarmonyBundleStyles(bundle, {
|
|
@@ -6275,10 +6584,33 @@ function shouldSkipRawRememberedCssSource(rawSource, sourceFile) {
|
|
|
6275
6584
|
const cleanSourceFile = sourceFile.replace(/[?#].*$/, "");
|
|
6276
6585
|
return SOURCE_STYLE_OUTPUT_EXT_RE.test(cleanSourceFile) && !canProcessViteSourceStyleAsCss(rawSource, sourceFile);
|
|
6277
6586
|
}
|
|
6587
|
+
function resolveRememberedCssReplayOutputFile(outputFile, targetByFile) {
|
|
6588
|
+
const outputKey = normalizeOutputPathKey(outputFile);
|
|
6589
|
+
for (const [shellFile, targetFile] of targetByFile ?? []) if (normalizeOutputPathKey(shellFile) === outputKey) return targetFile;
|
|
6590
|
+
return outputFile;
|
|
6591
|
+
}
|
|
6592
|
+
function createRememberedCssReplayUpdates(css, sourceFile, outputFile, injectIntoMain) {
|
|
6593
|
+
const updates = [{
|
|
6594
|
+
css,
|
|
6595
|
+
file: sourceFile,
|
|
6596
|
+
injectIntoMain,
|
|
6597
|
+
outputFile
|
|
6598
|
+
}];
|
|
6599
|
+
if (outputFile !== sourceFile) updates.push({
|
|
6600
|
+
css,
|
|
6601
|
+
file: outputFile,
|
|
6602
|
+
injectIntoMain,
|
|
6603
|
+
outputFile
|
|
6604
|
+
});
|
|
6605
|
+
return updates;
|
|
6606
|
+
}
|
|
6278
6607
|
async function processRememberedCssReplay(options) {
|
|
6279
|
-
const { addWatchFile, activeViteCssCacheFiles, bundle, bundleFiles, cache, changedCssFiles = /* @__PURE__ */ new Set(), createScopedGeneratorRuntime, createScopedSourceCandidateGetter, createScopedSourceCandidateSourceGetter, cssTaskFactories, cssPipelineContext, cssPipelineStrategy, debug, defaultStyleOutputExtension, emitOrReplayCssAsset, generatorRuntime, generatorPlatform, getCssHandlerOptions, getCssUserHandlerOptions, getRememberedCssSignature, getRememberedCssSources, isNativeAppStyleTarget, isWebGeneratorTarget, lastCssRawSourceHashByFile = /* @__PURE__ */ new Map(), lastCssResultByFile, lastCssSourceHashByFile, markCssAssetProcessed, metrics, normalizeViteCssCacheKey, onUpdate, opts, recordCssAssetResult, recordViteProcessedCssAssetResult, rootDir, runtimeState, setRememberedCssSignature, shouldInjectCssIntoMainFromOutput, shouldPreserveAppCssExtension, sourceRoot, styleHandler, timeTask, useIncrementalMode } = options;
|
|
6608
|
+
const { addWatchFile, activeViteCssCacheFiles, bundle, bundleFiles, cache, changedCssFiles = /* @__PURE__ */ new Set(), createScopedGeneratorRuntime, createScopedSourceCandidateGetter, createScopedSourceCandidateSourceGetter, cssTaskFactories, cssPipelineContext, cssPipelineStrategy, debug, defaultStyleOutputExtension, emitOrReplayCssAsset, generatorRuntime, generatorPlatform, getCssHandlerOptions, getCssUserHandlerOptions, getRememberedCssSignature, getRememberedCssSources, frameworkRootImportShellTargetByFile, isNativeAppStyleTarget, isWebGeneratorTarget, lastCssRawSourceHashByFile = /* @__PURE__ */ new Map(), lastCssResultByFile, lastCssSourceHashByFile, markCssAssetProcessed, metrics, normalizeViteCssCacheKey, onUpdate, opts, pendingRememberedCssReplayUpdates, recordCssAssetResult, recordViteProcessedCssAssetResult, rootDir, runtimeState, setRememberedCssSignature, shouldInjectCssIntoMainFromOutput, shouldPreserveAppCssExtension, sourceRoot, styleHandler, timeTask, useIncrementalMode } = options;
|
|
6280
6609
|
const rememberedReplayGroups = collectRememberedCssReplayGroups(getRememberedCssSources?.(), opts, rootDir, isWebGeneratorTarget, shouldPreserveAppCssExtension, sourceRoot, defaultStyleOutputExtension, bundleFiles);
|
|
6281
|
-
|
|
6610
|
+
const normalizedBundleFiles = new Set(bundleFiles.map(normalizeOutputPathKey));
|
|
6611
|
+
for (const [rememberedOutputFile, rememberedGroup] of rememberedReplayGroups) {
|
|
6612
|
+
const outputFile = resolveRememberedCssReplayOutputFile(rememberedOutputFile, frameworkRootImportShellTargetByFile);
|
|
6613
|
+
if (outputFile !== rememberedOutputFile) debug("css replay use framework root import shell target: %s -> %s", rememberedOutputFile, outputFile);
|
|
6282
6614
|
if (isHTMLRequest(outputFile) || options.opts.htmlMatcher(outputFile)) continue;
|
|
6283
6615
|
const replayableRememberedGroup = rememberedGroup.filter(({ remembered }) => {
|
|
6284
6616
|
const shouldSkip = shouldSkipRawRememberedCssSource(remembered.rawSource, remembered.sourceFile);
|
|
@@ -6292,7 +6624,7 @@ async function processRememberedCssReplay(options) {
|
|
|
6292
6624
|
const generatorRawSource = isWebGeneratorTarget ? rawSource : normalizeMiniProgramGeneratorCssSource(rawSource, outputFile);
|
|
6293
6625
|
activeViteCssCacheFiles.add(normalizeViteCssCacheKey(outputFile));
|
|
6294
6626
|
activeViteCssCacheFiles.add(normalizeViteCssCacheKey(sourceFile));
|
|
6295
|
-
const outputCssHandlerOptions = getCssHandlerOptions(
|
|
6627
|
+
const outputCssHandlerOptions = getCssHandlerOptions(rememberedOutputFile);
|
|
6296
6628
|
const cssHandlerOptions = {
|
|
6297
6629
|
...getCssHandlerOptions(sourceFile),
|
|
6298
6630
|
isMainChunk: outputCssHandlerOptions.isMainChunk
|
|
@@ -6311,7 +6643,19 @@ async function processRememberedCssReplay(options) {
|
|
|
6311
6643
|
const cssSourceChanged = changedCssFiles.has(outputFile) || changedCssFiles.has(sourceFile) || previousRawSourceHash != null && previousRawSourceHash !== rawSourceHash;
|
|
6312
6644
|
const previousCss = useIncrementalMode && !cssSourceChanged && getLastCssSourceHash(lastCssSourceHashByFile, outputFile) === cssRuntimeAffectingHash ? getLastCssResult(lastCssResultByFile, outputFile) : void 0;
|
|
6313
6645
|
const allRememberedSignaturesFresh = rememberedKeys.length > 0 && rememberedKeys.every((key) => getRememberedCssSignature?.(key) === rememberedCssRuntimeSignature);
|
|
6314
|
-
if (bundleFiles.includes(
|
|
6646
|
+
if (bundleFiles.includes(rememberedOutputFile) || bundleFiles.includes(sourceFile)) continue;
|
|
6647
|
+
const shouldMergeReplayIntoFrameworkRootTarget = outputFile !== rememberedOutputFile && normalizedBundleFiles.has(normalizeOutputPathKey(outputFile));
|
|
6648
|
+
if (allRememberedSignaturesFresh) if (!shouldMergeReplayIntoFrameworkRootTarget) continue;
|
|
6649
|
+
else {
|
|
6650
|
+
const cachedCss = getLastCssResult(lastCssResultByFile, outputFile);
|
|
6651
|
+
if (cachedCss != null) {
|
|
6652
|
+
pendingRememberedCssReplayUpdates.push(...createRememberedCssReplayUpdates(cachedCss, sourceFile, outputFile, true));
|
|
6653
|
+
metrics.css.cacheHits++;
|
|
6654
|
+
debug("css replay cached result into framework root target: %s", outputFile);
|
|
6655
|
+
continue;
|
|
6656
|
+
}
|
|
6657
|
+
debug("css replay framework root target cache miss, regenerate: %s", outputFile);
|
|
6658
|
+
}
|
|
6315
6659
|
const sourceTraceSources = scopedSourceCandidateSourceGetter ? await createScopedGeneratorSourceTraceMap(generatorRawSource, sourceFile, scopedSourceCandidateSourceGetter) : void 0;
|
|
6316
6660
|
const sourceTraceTokenSources = sourceTraceSources ? createCssTokenSourceMap(sourceTraceSources, opts) : void 0;
|
|
6317
6661
|
const annotateCss = (css) => annotateCssSourceTrace(css, {
|
|
@@ -6319,7 +6663,7 @@ async function processRememberedCssReplay(options) {
|
|
|
6319
6663
|
tokenSources: sourceTraceTokenSources
|
|
6320
6664
|
});
|
|
6321
6665
|
const shouldRecordRememberedReplayCss = useIncrementalMode || isNativeAppStyleTarget;
|
|
6322
|
-
const shouldEmitRememberedReplayCssAsset = shouldRecordRememberedReplayCss;
|
|
6666
|
+
const shouldEmitRememberedReplayCssAsset = shouldRecordRememberedReplayCss && !shouldMergeReplayIntoFrameworkRootTarget;
|
|
6323
6667
|
if (!shouldRecordRememberedReplayCss) continue;
|
|
6324
6668
|
const shouldPreserveLocalImportWrapper = shouldPreserveFrameworkRootMiniProgramImportShell({
|
|
6325
6669
|
css: rawSource,
|
|
@@ -6387,14 +6731,10 @@ async function processRememberedCssReplay(options) {
|
|
|
6387
6731
|
registerGeneratorDependencies$1({ addWatchFile }, generated.dependencies);
|
|
6388
6732
|
recordCssAssetResult?.(outputFile, css);
|
|
6389
6733
|
const shouldInjectReplayCssIntoMain = shouldInjectCssIntoMainFromOutput(outputFile, sourceFile, outputCssHandlerOptions);
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
if (outputFile !== sourceFile) recordViteProcessedCssAssetResult?.(outputFile, css, {
|
|
6395
|
-
injectIntoMain: outputCssHandlerOptions.isMainChunk ? false : shouldInjectReplayCssIntoMain,
|
|
6396
|
-
outputFile
|
|
6397
|
-
});
|
|
6734
|
+
const injectIntoMain = shouldMergeReplayIntoFrameworkRootTarget ? true : outputCssHandlerOptions.isMainChunk ? false : shouldInjectReplayCssIntoMain;
|
|
6735
|
+
const replayUpdates = createRememberedCssReplayUpdates(css, sourceFile, outputFile, injectIntoMain);
|
|
6736
|
+
if (shouldMergeReplayIntoFrameworkRootTarget) pendingRememberedCssReplayUpdates.push(...replayUpdates);
|
|
6737
|
+
else for (const update of replayUpdates) recordViteProcessedCssAssetResult?.(update.file, update.css, update);
|
|
6398
6738
|
debug("css replay generated result: %s bytes=%d", outputFile, css.length);
|
|
6399
6739
|
}
|
|
6400
6740
|
if (shouldEmitRememberedReplayCssAsset) emitRememberedCssAsset(css);
|
|
@@ -7286,6 +7626,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7286
7626
|
const tasks = [];
|
|
7287
7627
|
const cssTaskFactories = [];
|
|
7288
7628
|
const jsTaskFactories = [];
|
|
7629
|
+
const pendingRememberedCssReplayUpdates = [];
|
|
7289
7630
|
const entryPlanningStartedAt = performance.now();
|
|
7290
7631
|
for (const entry of snapshot.entries) {
|
|
7291
7632
|
const { file, output: originalSource, source: originalEntrySource, type } = entry;
|
|
@@ -7511,6 +7852,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7511
7852
|
debug,
|
|
7512
7853
|
defaultStyleOutputExtension,
|
|
7513
7854
|
emitOrReplayCssAsset,
|
|
7855
|
+
frameworkRootImportShellTargetByFile,
|
|
7514
7856
|
generatorPlatform,
|
|
7515
7857
|
generatorRuntime,
|
|
7516
7858
|
getCssHandlerOptions,
|
|
@@ -7527,6 +7869,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7527
7869
|
normalizeViteCssCacheKey,
|
|
7528
7870
|
onUpdate,
|
|
7529
7871
|
opts,
|
|
7872
|
+
pendingRememberedCssReplayUpdates,
|
|
7530
7873
|
recordCssAssetResult,
|
|
7531
7874
|
recordViteProcessedCssAssetResult,
|
|
7532
7875
|
rootDir,
|
|
@@ -7578,6 +7921,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7578
7921
|
opts,
|
|
7579
7922
|
outDir,
|
|
7580
7923
|
pendingLinkedUpdates,
|
|
7924
|
+
pendingRememberedCssReplayUpdates,
|
|
7581
7925
|
pruneViteCssCaches,
|
|
7582
7926
|
recordCssAssetResult,
|
|
7583
7927
|
recordTimingDetail,
|
|
@@ -7791,12 +8135,11 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
7791
8135
|
});
|
|
7792
8136
|
};
|
|
7793
8137
|
collectViteProcessedCssAssets();
|
|
7794
|
-
const createHarmonyBundleStyleSources = async (
|
|
8138
|
+
const createHarmonyBundleStyleSources = async () => {
|
|
7795
8139
|
const cssSources = collectViteProcessedCssSources(getViteProcessedCssAssetResults);
|
|
7796
8140
|
const applyUtilities = collectUniAppXHarmonyApplyUtilities(bundle);
|
|
7797
8141
|
const applyStyleSources = collectUniAppXHarmonyApplyStyleSources(bundle);
|
|
7798
8142
|
if (applyUtilities.size === 0 || applyStyleSources.length === 0) return cssSources;
|
|
7799
|
-
const harmonyRuntime = /* @__PURE__ */ new Set([...runtime, ...applyUtilities]);
|
|
7800
8143
|
const harmonyCssHandlerOptions = createCssHandlerOptions(opts, runtimeState.tailwindRuntime.majorVersion, "uni-app-x-harmony-apply.css", outDir, cssPipelineStrategy?.getCssHandlerExtraOptions?.({
|
|
7801
8144
|
...createCssPipelineContext("uni-app-x-harmony-apply.css"),
|
|
7802
8145
|
file: "uni-app-x-harmony-apply.css"
|
|
@@ -7804,7 +8147,7 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
7804
8147
|
const generated = await generateTailwindV4Css({
|
|
7805
8148
|
opts,
|
|
7806
8149
|
runtimeState,
|
|
7807
|
-
runtime:
|
|
8150
|
+
runtime: /* @__PURE__ */ new Set(),
|
|
7808
8151
|
rawSource: createUniAppXHarmonyApplyGeneratorSource(applyStyleSources, applyUtilities),
|
|
7809
8152
|
file: "uni-app-x-harmony-apply.css",
|
|
7810
8153
|
outputFile: "uni-app-x-harmony-apply.css",
|
|
@@ -7814,6 +8157,7 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
7814
8157
|
isMainChunk: false
|
|
7815
8158
|
},
|
|
7816
8159
|
cssStage: "framework-processed",
|
|
8160
|
+
disableSourceScan: true,
|
|
7817
8161
|
getSourceCandidatesForEntries,
|
|
7818
8162
|
generatorPlatform,
|
|
7819
8163
|
styleHandler: opts.styleHandler,
|
|
@@ -7822,9 +8166,9 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
7822
8166
|
if (generated?.css) cssSources.push(annotateCss(generated.css));
|
|
7823
8167
|
return cssSources;
|
|
7824
8168
|
};
|
|
7825
|
-
const injectHarmonyBundleStyles = async (
|
|
8169
|
+
const injectHarmonyBundleStyles = async () => {
|
|
7826
8170
|
if (!isHarmonyAppStyleTarget) return;
|
|
7827
|
-
if (injectUniAppXHarmonyBundleStyles(bundle, { cssSources: await createHarmonyBundleStyleSources(
|
|
8171
|
+
if (injectUniAppXHarmonyBundleStyles(bundle, { cssSources: await createHarmonyBundleStyleSources() })) debug("uni-app-x harmony bundle styles inject");
|
|
7828
8172
|
};
|
|
7829
8173
|
const isCssOutputAssetEntry = (entry) => {
|
|
7830
8174
|
const [bundleFile, output] = entry;
|
|
@@ -7961,7 +8305,7 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
7961
8305
|
bundle,
|
|
7962
8306
|
writeTargets
|
|
7963
8307
|
});
|
|
7964
|
-
await injectHarmonyBundleStyles(
|
|
8308
|
+
await injectHarmonyBundleStyles();
|
|
7965
8309
|
collectViteProcessedCssAssets();
|
|
7966
8310
|
injectViteProcessedCssIntoMainCss();
|
|
7967
8311
|
normalizeRootMiniProgramImportShellAssets(bundle, {
|
|
@@ -8552,6 +8896,7 @@ function createViteCssGenerationPlugins(options) {
|
|
|
8552
8896
|
async transform(code, id) {
|
|
8553
8897
|
if (!options.shouldGenerate() || options.shouldGenerateBuild?.() === false || !isViteBuildStyleRequest(id, options.getCommand())) return;
|
|
8554
8898
|
if (!hasViteCssGenerationDirective(code)) return;
|
|
8899
|
+
if (options.shouldDeferGeneration?.(id, code)) return;
|
|
8555
8900
|
if (hasViteServeCssRootDirective(code)) await options.onTailwindRootCss?.(id, code);
|
|
8556
8901
|
const generatedCss = await options.generateCss(id, code, {
|
|
8557
8902
|
...this.addWatchFile ? { addWatchFile: this.addWatchFile.bind(this) } : {},
|
|
@@ -8669,24 +9014,27 @@ function wrapViteCssPostTransform(config, transformCss) {
|
|
|
8669
9014
|
}
|
|
8670
9015
|
//#endregion
|
|
8671
9016
|
//#region src/bundlers/vite/shared/framework-hmr-candidate-state.ts
|
|
8672
|
-
const WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE = /@(?:theme|source|config|plugin|apply)\b/;
|
|
8673
9017
|
function createViteHmrCandidateState(options) {
|
|
8674
9018
|
let pendingChange;
|
|
8675
9019
|
let pendingCssTargetFiles;
|
|
9020
|
+
let pendingTargetsArmed = false;
|
|
8676
9021
|
let pendingFullRegeneration = false;
|
|
8677
9022
|
const normalizeCssTargetFile = (file) => normalizeVitePersistentCacheKey(cleanUrl(file));
|
|
8678
9023
|
const clear = () => {
|
|
8679
9024
|
pendingChange = void 0;
|
|
8680
9025
|
pendingCssTargetFiles = void 0;
|
|
9026
|
+
pendingTargetsArmed = false;
|
|
8681
9027
|
pendingFullRegeneration = false;
|
|
8682
9028
|
};
|
|
8683
9029
|
const queueFullRegeneration = () => {
|
|
8684
9030
|
pendingChange = void 0;
|
|
8685
9031
|
pendingCssTargetFiles = void 0;
|
|
9032
|
+
pendingTargetsArmed = false;
|
|
8686
9033
|
pendingFullRegeneration = true;
|
|
8687
9034
|
};
|
|
8688
9035
|
const queueChange = (change) => {
|
|
8689
9036
|
var _pendingChange;
|
|
9037
|
+
if (pendingFullRegeneration) return;
|
|
8690
9038
|
pendingFullRegeneration = false;
|
|
8691
9039
|
if (!pendingChange) {
|
|
8692
9040
|
pendingChange = {
|
|
@@ -8708,17 +9056,21 @@ function createViteHmrCandidateState(options) {
|
|
|
8708
9056
|
const createChange = (file, change, changeOptions = {}) => ({
|
|
8709
9057
|
...change,
|
|
8710
9058
|
file,
|
|
8711
|
-
runtimeAffecting: changeOptions.runtimeAffecting === true ||
|
|
9059
|
+
runtimeAffecting: changeOptions.runtimeAffecting === true || options.isRuntimeAffectingSource?.(file) === true || isSourceStyleRequest(file)
|
|
8712
9060
|
});
|
|
8713
9061
|
const apply = (change) => {
|
|
8714
9062
|
if (isSourceStyleRequest(change.file)) {
|
|
8715
9063
|
clear();
|
|
8716
9064
|
return change;
|
|
8717
9065
|
}
|
|
9066
|
+
if (change.runtimeAffecting) {
|
|
9067
|
+
queueFullRegeneration();
|
|
9068
|
+
return change;
|
|
9069
|
+
}
|
|
8718
9070
|
const preserveDeletedCss = options.getGeneratorOptions().hmr.preserveDeletedCss;
|
|
8719
|
-
if (preserveDeletedCss
|
|
9071
|
+
if (preserveDeletedCss) {
|
|
8720
9072
|
if (change.addedCandidates.size > 0) queueChange(change);
|
|
8721
|
-
else if (!pendingChange) clear();
|
|
9073
|
+
else if (!pendingChange && !pendingFullRegeneration) clear();
|
|
8722
9074
|
return change;
|
|
8723
9075
|
}
|
|
8724
9076
|
clear();
|
|
@@ -8727,28 +9079,26 @@ function createViteHmrCandidateState(options) {
|
|
|
8727
9079
|
};
|
|
8728
9080
|
const resolve = (generatorCode, file) => {
|
|
8729
9081
|
const fileKey = normalizeCssTargetFile(file);
|
|
8730
|
-
if (options.getCommand() !== "serve" || !pendingChange || pendingChange.runtimeAffecting || pendingChange.addedCandidates.size === 0 || options.getGeneratorOptions().target === "weapp" && hasUserCssLayerBlocks(generatorCode) || !options.cleanGeneratedCssByFile.has(fileKey) || !options.generatedClassSetByFile.has(fileKey) ||
|
|
9082
|
+
if (options.getCommand() !== "serve" || !pendingChange || pendingChange.runtimeAffecting || pendingChange.addedCandidates.size === 0 || options.getGeneratorOptions().target === "weapp" && hasUserCssLayerBlocks(generatorCode) || !options.cleanGeneratedCssByFile.has(fileKey) || !options.generatedClassSetByFile.has(fileKey) || pendingTargetsArmed && !pendingCssTargetFiles?.has(fileKey)) return;
|
|
8731
9083
|
return pendingChange;
|
|
8732
9084
|
};
|
|
8733
9085
|
const finishTarget = (file) => {
|
|
8734
|
-
if (!pendingChange) return;
|
|
8735
|
-
if (!pendingCssTargetFiles)
|
|
8736
|
-
clear();
|
|
8737
|
-
return;
|
|
8738
|
-
}
|
|
9086
|
+
if (!pendingChange && !pendingFullRegeneration) return;
|
|
9087
|
+
if (!pendingTargetsArmed || !pendingCssTargetFiles) return;
|
|
8739
9088
|
pendingCssTargetFiles.delete(normalizeCssTargetFile(file));
|
|
8740
9089
|
if (pendingCssTargetFiles.size === 0) clear();
|
|
8741
9090
|
};
|
|
8742
9091
|
const armTargets = (cssModules, fallbackCssIds) => {
|
|
8743
|
-
if (!pendingChange) {
|
|
9092
|
+
if (!pendingChange && !pendingFullRegeneration) {
|
|
8744
9093
|
pendingCssTargetFiles = void 0;
|
|
9094
|
+
pendingTargetsArmed = false;
|
|
8745
9095
|
return;
|
|
8746
9096
|
}
|
|
8747
9097
|
const targets = /* @__PURE__ */ new Set();
|
|
8748
9098
|
const addTarget = (file) => {
|
|
8749
9099
|
if (!file) return;
|
|
8750
9100
|
const key = normalizeCssTargetFile(file);
|
|
8751
|
-
if (options.cleanGeneratedCssByFile.has(key)) targets.add(key);
|
|
9101
|
+
if (pendingFullRegeneration || options.cleanGeneratedCssByFile.has(key)) targets.add(key);
|
|
8752
9102
|
};
|
|
8753
9103
|
for (const module of cssModules) {
|
|
8754
9104
|
addTarget(module.id);
|
|
@@ -8756,7 +9106,28 @@ function createViteHmrCandidateState(options) {
|
|
|
8756
9106
|
addTarget(module.url);
|
|
8757
9107
|
}
|
|
8758
9108
|
for (const id of fallbackCssIds) addTarget(id);
|
|
8759
|
-
pendingCssTargetFiles = targets
|
|
9109
|
+
pendingCssTargetFiles = targets;
|
|
9110
|
+
pendingTargetsArmed = true;
|
|
9111
|
+
};
|
|
9112
|
+
const reconcileRuntimeCandidates = (file, candidates, rootCssIds) => {
|
|
9113
|
+
if (options.getCommand() !== "serve" || pendingFullRegeneration) return;
|
|
9114
|
+
const generatedClassSets = [];
|
|
9115
|
+
const seenFiles = /* @__PURE__ */ new Set();
|
|
9116
|
+
for (const id of rootCssIds) {
|
|
9117
|
+
const fileKey = normalizeCssTargetFile(id);
|
|
9118
|
+
if (seenFiles.has(fileKey)) continue;
|
|
9119
|
+
seenFiles.add(fileKey);
|
|
9120
|
+
const classSet = options.generatedClassSetByFile.get(fileKey);
|
|
9121
|
+
if (classSet) generatedClassSets.push(classSet);
|
|
9122
|
+
}
|
|
9123
|
+
if (generatedClassSets.length === 0) return;
|
|
9124
|
+
const addedCandidates = /* @__PURE__ */ new Set();
|
|
9125
|
+
for (const candidate of candidates) if (generatedClassSets.some((classSet) => !classSet.has(candidate))) addedCandidates.add(candidate);
|
|
9126
|
+
if (addedCandidates.size === 0) return;
|
|
9127
|
+
apply(createChange(file, {
|
|
9128
|
+
addedCandidates,
|
|
9129
|
+
removedCandidates: /* @__PURE__ */ new Set()
|
|
9130
|
+
}));
|
|
8760
9131
|
};
|
|
8761
9132
|
return {
|
|
8762
9133
|
apply,
|
|
@@ -8765,13 +9136,19 @@ function createViteHmrCandidateState(options) {
|
|
|
8765
9136
|
createChange,
|
|
8766
9137
|
finishTarget,
|
|
8767
9138
|
hasPendingCandidateAppend: () => pendingChange != null && !pendingChange.runtimeAffecting && pendingChange.addedCandidates.size > 0,
|
|
8768
|
-
hasPendingChange: () => pendingChange != null,
|
|
9139
|
+
hasPendingChange: () => pendingChange != null || pendingFullRegeneration,
|
|
8769
9140
|
queueFullRegeneration,
|
|
9141
|
+
reconcileRuntimeCandidates,
|
|
8770
9142
|
resolve,
|
|
8771
|
-
shouldForceFullRegeneration: (resolved) =>
|
|
9143
|
+
shouldForceFullRegeneration: (file, resolved) => {
|
|
9144
|
+
if (options.getCommand() !== "serve") return false;
|
|
9145
|
+
if (pendingFullRegeneration) return pendingTargetsArmed && pendingCssTargetFiles?.has(normalizeCssTargetFile(file)) === true;
|
|
9146
|
+
return pendingChange != null && !resolved && pendingTargetsArmed && pendingCssTargetFiles?.has(normalizeCssTargetFile(file)) === true;
|
|
9147
|
+
},
|
|
8772
9148
|
snapshotDebugState: () => ({
|
|
8773
9149
|
pendingAddedCandidates: pendingChange?.addedCandidates.size ?? 0,
|
|
8774
|
-
pendingCssTargets: pendingCssTargetFiles?.size ?? 0
|
|
9150
|
+
pendingCssTargets: pendingCssTargetFiles?.size ?? 0,
|
|
9151
|
+
pendingFullRegeneration
|
|
8775
9152
|
})
|
|
8776
9153
|
};
|
|
8777
9154
|
}
|
|
@@ -8976,6 +9353,11 @@ function sameStringList(first, second) {
|
|
|
8976
9353
|
//#endregion
|
|
8977
9354
|
//#region src/bundlers/vite/shared/framework-source-candidates-plugin.ts
|
|
8978
9355
|
function createFrameworkSourceCandidatesPlugin(options) {
|
|
9356
|
+
const hasDifferentHotModules = (left, right) => left.length !== right.length || left.some((mod, index) => mod !== right[index]);
|
|
9357
|
+
const hasTemplateHotSourceModule = (modules) => modules.some((mod) => {
|
|
9358
|
+
const request = mod.url ?? mod.id;
|
|
9359
|
+
return typeof request === "string" && /\.(?:uvue|nvue)(?:\?import)?$/i.test(request);
|
|
9360
|
+
});
|
|
8979
9361
|
return {
|
|
8980
9362
|
name: `${vitePluginName}:source-candidates`,
|
|
8981
9363
|
enforce: "pre",
|
|
@@ -9041,60 +9423,70 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9041
9423
|
await options.sourceScanSession.syncChangedFile(id, changedSource);
|
|
9042
9424
|
}, { emit: false });
|
|
9043
9425
|
},
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
mod.
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
options.
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9426
|
+
handleHotUpdate: {
|
|
9427
|
+
order: "post",
|
|
9428
|
+
async handler(ctx) {
|
|
9429
|
+
recordCompilationDependencyChanges(options.runtimeState, createCompilationDependencyChanges([path.resolve(cleanUrl(ctx.file))]));
|
|
9430
|
+
return options.hmrTimingRecorder.measure("sourceCandidates.handleHotUpdate", async () => {
|
|
9431
|
+
const isSourceCandidateHotUpdate = options.shouldOwnTailwindGeneration && isSourceCandidateRequest(ctx.file);
|
|
9432
|
+
if (isSourceCandidateHotUpdate && isSourceStyleRequest(ctx.file)) {
|
|
9433
|
+
for (const mod of ctx.modules) for (const id of [
|
|
9434
|
+
mod.id,
|
|
9435
|
+
mod.url,
|
|
9436
|
+
mod.file
|
|
9437
|
+
]) if (typeof id === "string" && id.length > 0) options.rememberTailwindRootCssModule(id);
|
|
9438
|
+
}
|
|
9439
|
+
const hotSource = isSourceCandidateHotUpdate && typeof ctx.read === "function" ? await ctx.read().catch(() => void 0) : void 0;
|
|
9440
|
+
if (typeof hotSource === "string" && isCSSRequest(ctx.file)) {
|
|
9441
|
+
options.rememberOriginalCssLayerSource(ctx.file, hotSource);
|
|
9442
|
+
await options.refreshTailwindRootCssSource(ctx.file, hotSource);
|
|
9443
|
+
}
|
|
9444
|
+
const sourceCandidateChange = await options.sourceScanSession.syncChangedFile(ctx.file, hotSource);
|
|
9445
|
+
options.sourceScanSession.consumeHotUpdateChange(ctx.file);
|
|
9446
|
+
const isWebLikeHotUpdate = options.isCurrentWebLikeStylePlatform();
|
|
9447
|
+
let canUseHmrCandidateAppend = false;
|
|
9448
|
+
if (isSourceCandidateHotUpdate) {
|
|
9449
|
+
options.invalidateRecordedGeneratorCandidates();
|
|
9450
|
+
const preserveDeletedCssInHmr = options.resolveCurrentGeneratorOptions().hmr.preserveDeletedCss;
|
|
9451
|
+
canUseHmrCandidateAppend = preserveDeletedCssInHmr && !isSourceStyleRequest(ctx.file) && sourceCandidateChange !== void 0 && !sourceCandidateChange.runtimeAffecting;
|
|
9452
|
+
if (!canUseHmrCandidateAppend) {
|
|
9453
|
+
if (sourceCandidateChange === void 0) {
|
|
9454
|
+
options.hmrCandidateState.clear();
|
|
9455
|
+
if (!preserveDeletedCssInHmr && !isSourceStyleRequest(ctx.file)) options.hmrCandidateState.queueFullRegeneration();
|
|
9456
|
+
}
|
|
9457
|
+
if (isWebLikeHotUpdate) {
|
|
9458
|
+
await options.refreshRuntimeStateForAutoCssSources?.(true);
|
|
9459
|
+
await options.sourceScanSession.sync({ force: true });
|
|
9460
|
+
}
|
|
9075
9461
|
}
|
|
9076
9462
|
}
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9463
|
+
if (isSourceCandidateHotUpdate) await options.sourceScanSession.waitForPendingSyncs();
|
|
9464
|
+
if (isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file)) options.hmrCandidateState.reconcileRuntimeCandidates(ctx.file, options.sourceCandidateCollector.values(), options.tailwindRootCssModuleIds);
|
|
9465
|
+
const cssModules = await resolveHotTailwindCssModules(ctx, isSourceStyleRequest(ctx.file) ? [ctx.file] : options.tailwindRootCssModuleIds);
|
|
9466
|
+
const hotRoot = ctx.server.config?.root ?? process$1.cwd();
|
|
9467
|
+
const sourceModules = isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file) ? await resolveHotSourceModules(ctx) : ctx.modules;
|
|
9468
|
+
const hasHmrCandidateAppend = options.hmrCandidateState.hasPendingCandidateAppend() || canUseHmrCandidateAppend && sourceCandidateChange !== void 0 && sourceCandidateChange.addedCandidates.size > 0;
|
|
9469
|
+
if (isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file) && !hasHmrCandidateAppend && !isWebLikeHotUpdate && (!hasSelfAcceptingNonStyleHotModule(sourceModules) && cssModules.length === 0 || cssModules.length > 0 && options.isUniViteProject())) {
|
|
9470
|
+
sendFullReloadForUnresolvedHotUpdate(ctx);
|
|
9471
|
+
return [];
|
|
9472
|
+
}
|
|
9473
|
+
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file) && sourceModules.some((mod) => options.isNuxtPageMacroHotModule(mod.id ?? mod.url))) {
|
|
9474
|
+
sendFullReloadForUnresolvedHotUpdate(ctx);
|
|
9475
|
+
return [];
|
|
9476
|
+
}
|
|
9477
|
+
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file) && /\.(?:uvue|nvue)$/i.test(cleanUrl(ctx.file)) && !hasTemplateHotSourceModule(sourceModules)) {
|
|
9478
|
+
sendFullReloadForUnresolvedHotUpdate(ctx);
|
|
9479
|
+
return [];
|
|
9480
|
+
}
|
|
9481
|
+
const shouldSendSupplementalCssHotUpdates = !(isWebLikeHotUpdate && isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file) && sourceCandidateChange !== void 0 && options.resolveCurrentGeneratorOptions().hmr.preserveDeletedCss && !sourceCandidateChange.runtimeAffecting && sourceCandidateChange.addedCandidates.size === 0 && sourceCandidateChange.removedCandidates.size > 0);
|
|
9482
|
+
const supplementalCssFallbackIds = /* @__PURE__ */ new Set([...options.tailwindRootCssModuleIds, ...options.viteProcessedCssSourceFiles]);
|
|
9483
|
+
if (options.hmrCandidateState.hasPendingChange()) options.hmrCandidateState.armTargets(cssModules, supplementalCssFallbackIds);
|
|
9484
|
+
if (shouldSendSupplementalCssHotUpdates) sendSupplementalCssHotUpdates(ctx, cssModules, supplementalCssFallbackIds);
|
|
9485
|
+
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file)) return cssModules.length > 0 ? mergeHotModulesByIdentity(hotRoot, sourceModules, cssModules) : hasDifferentHotModules(sourceModules, ctx.modules) ? sourceModules : void 0;
|
|
9486
|
+
if (isSourceCandidateHotUpdate && !isSourceStyleRequest(ctx.file) && cssModules.length > 0) return mergeHotModulesByIdentity(hotRoot, sourceModules, cssModules);
|
|
9487
|
+
return cssModules.length > 0 ? mergeHotModulesByIdentity(hotRoot, ctx.modules, cssModules) : void 0;
|
|
9488
|
+
}, { emit: false });
|
|
9489
|
+
}
|
|
9098
9490
|
},
|
|
9099
9491
|
async buildStart() {
|
|
9100
9492
|
await options.hmrTimingRecorder.measure("sourceCandidates.buildStart", options.prepareTailwindGeneration, { emit: false });
|
|
@@ -9103,9 +9495,24 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9103
9495
|
};
|
|
9104
9496
|
}
|
|
9105
9497
|
//#endregion
|
|
9498
|
+
//#region src/bundlers/vite/shared/framework-hmr-runtime-signature.ts
|
|
9499
|
+
const WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE = /@(?:theme|source|config|plugin|apply)\b/;
|
|
9500
|
+
function createFrameworkHmrRuntimeSignature(file, source) {
|
|
9501
|
+
if (!source || !WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE.test(source)) return "";
|
|
9502
|
+
return (isSfcStyleSourceFile(cleanUrl(file)) ? extractSfcStyleSources(source).filter((styleSource) => WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE.test(styleSource)) : [source]).map((styleSource) => createRuntimeAffectingSourceSignature(styleSource, "css")).join("\0");
|
|
9503
|
+
}
|
|
9504
|
+
function hasFrameworkHmrRuntimeSourceChange(file, previousSource, nextSource) {
|
|
9505
|
+
return createFrameworkHmrRuntimeSignature(file, previousSource) !== createFrameworkHmrRuntimeSignature(file, nextSource);
|
|
9506
|
+
}
|
|
9507
|
+
//#endregion
|
|
9106
9508
|
//#region src/bundlers/vite/shared/framework-source-scan-session.ts
|
|
9107
9509
|
const SOURCE_CANDIDATE_SCAN_CACHE_MAX = 8;
|
|
9108
9510
|
const sourceCandidateScanSnapshotCache = new LRUCache({ max: SOURCE_CANDIDATE_SCAN_CACHE_MAX });
|
|
9511
|
+
async function syncFrameworkSourceCandidatesForHotUpdate(sourceScanSession, ctx) {
|
|
9512
|
+
const source = typeof ctx.read === "function" ? await ctx.read().catch(() => void 0) : void 0;
|
|
9513
|
+
await sourceScanSession.syncChangedFile(ctx.file, source);
|
|
9514
|
+
await sourceScanSession.waitForPendingSyncs();
|
|
9515
|
+
}
|
|
9109
9516
|
function createFrameworkSourceScanSession(options) {
|
|
9110
9517
|
const sourceCandidateScanCache = new LRUCache({ max: SOURCE_CANDIDATE_SCAN_CACHE_MAX });
|
|
9111
9518
|
let sourceScanEntries;
|
|
@@ -9116,6 +9523,7 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9116
9523
|
let sourceCandidateScanInvalidated = true;
|
|
9117
9524
|
const pendingSourceCandidateSyncs = /* @__PURE__ */ new Set();
|
|
9118
9525
|
const pendingSourceCandidateSyncByFile = /* @__PURE__ */ new Map();
|
|
9526
|
+
const pendingHotUpdateChangeByFile = /* @__PURE__ */ new Map();
|
|
9119
9527
|
const normalizeDependency = (file) => path.normalize(path.resolve(cleanUrl(file)));
|
|
9120
9528
|
const isDependency = (file) => sourceScanDependencies.has(normalizeDependency(file));
|
|
9121
9529
|
const invalidate = () => {
|
|
@@ -9217,6 +9625,26 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9217
9625
|
const waitForPendingSyncs = async () => {
|
|
9218
9626
|
while (pendingSourceCandidateSyncs.size > 0) await Promise.all(pendingSourceCandidateSyncs);
|
|
9219
9627
|
};
|
|
9628
|
+
const rememberHotUpdateChange = (change) => {
|
|
9629
|
+
if (!change) return;
|
|
9630
|
+
const previous = pendingHotUpdateChangeByFile.get(change.file);
|
|
9631
|
+
if (!previous) {
|
|
9632
|
+
const remembered = {
|
|
9633
|
+
...change,
|
|
9634
|
+
addedCandidates: new Set(change.addedCandidates),
|
|
9635
|
+
removedCandidates: new Set(change.removedCandidates)
|
|
9636
|
+
};
|
|
9637
|
+
pendingHotUpdateChangeByFile.set(change.file, remembered);
|
|
9638
|
+
return remembered;
|
|
9639
|
+
}
|
|
9640
|
+
for (const candidate of change.addedCandidates) {
|
|
9641
|
+
previous.addedCandidates.add(candidate);
|
|
9642
|
+
previous.removedCandidates.delete(candidate);
|
|
9643
|
+
}
|
|
9644
|
+
for (const candidate of change.removedCandidates) if (!previous.addedCandidates.delete(candidate)) previous.removedCandidates.add(candidate);
|
|
9645
|
+
previous.runtimeAffecting || (previous.runtimeAffecting = change.runtimeAffecting);
|
|
9646
|
+
return previous;
|
|
9647
|
+
};
|
|
9220
9648
|
const syncChangedFile = (id, sourceOverride) => {
|
|
9221
9649
|
if (!options.shouldOwnTailwindGeneration || !options.isCandidateRequest(id)) return Promise.resolve(void 0);
|
|
9222
9650
|
const file = cleanUrl(id);
|
|
@@ -9227,15 +9655,18 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9227
9655
|
cacheCurrent();
|
|
9228
9656
|
return (isSourceStyleRequest(file) ? readFile(file, "utf8").then((source) => options.cssMemory.refreshRememberedCssSourceBySourceFile(file, source)).catch((error) => {
|
|
9229
9657
|
if ((typeof error === "object" && error !== null && "code" in error ? error.code : void 0) !== "ENOENT") options.debug("remembered css source watch refresh failed: %s %O", file, error);
|
|
9230
|
-
}) : Promise.resolve()).then(() => options.cssMemory.refreshRememberedCssSourceByCurrentFile(file)).then(() => options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: true })));
|
|
9658
|
+
}) : Promise.resolve()).then(() => options.cssMemory.refreshRememberedCssSourceByCurrentFile(file)).then(() => rememberHotUpdateChange(options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: true }))));
|
|
9231
9659
|
}
|
|
9232
9660
|
const existingTask = pendingSourceCandidateSyncByFile.get(file);
|
|
9233
9661
|
if (existingTask) return existingTask.then(() => syncChangedFile(id, sourceOverride));
|
|
9662
|
+
const previousSource = options.sourceCandidateCollector.source(file);
|
|
9234
9663
|
const task = (sourceOverride === void 0 ? options.sourceCandidateCollector.syncCurrentFile(id) : options.sourceCandidateCollector.syncCurrentSource(id, sourceOverride)).catch((error) => {
|
|
9235
9664
|
options.debug("source candidate watch sync failed: %s %O", id, error);
|
|
9236
9665
|
}).then((change) => {
|
|
9237
9666
|
cacheCurrent();
|
|
9238
|
-
|
|
9667
|
+
const runtimeAffectingBySource = hasFrameworkHmrRuntimeSourceChange(file, previousSource, options.sourceCandidateCollector.source(file));
|
|
9668
|
+
const appliedChange = change ? options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: runtimeAffectingByDependency || runtimeAffectingBySource })) : void 0;
|
|
9669
|
+
return rememberHotUpdateChange(appliedChange) ?? pendingHotUpdateChangeByFile.get(file);
|
|
9239
9670
|
}).finally(() => {
|
|
9240
9671
|
pendingSourceCandidateSyncs.delete(task);
|
|
9241
9672
|
pendingSourceCandidateSyncByFile.delete(file);
|
|
@@ -9249,9 +9680,11 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9249
9680
|
};
|
|
9250
9681
|
return {
|
|
9251
9682
|
cacheCurrent,
|
|
9683
|
+
consumeHotUpdateChange: (id) => pendingHotUpdateChangeByFile.delete(cleanUrl(id)),
|
|
9252
9684
|
getStats: () => ({
|
|
9253
9685
|
pendingSourceCandidateSyncByFile: pendingSourceCandidateSyncByFile.size,
|
|
9254
9686
|
pendingSourceCandidateSyncs: pendingSourceCandidateSyncs.size,
|
|
9687
|
+
pendingHotUpdateChangeByFile: pendingHotUpdateChangeByFile.size,
|
|
9255
9688
|
sourceCandidateScanCache: sourceCandidateScanCache.size
|
|
9256
9689
|
}),
|
|
9257
9690
|
invalidate,
|
|
@@ -9268,12 +9701,12 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9268
9701
|
function createFrameworkTailwindRootCss(options) {
|
|
9269
9702
|
const hotSourceByFile = /* @__PURE__ */ new Map();
|
|
9270
9703
|
const moduleIds = /* @__PURE__ */ new Set();
|
|
9271
|
-
const normalizeSourceFile = (id) =>
|
|
9704
|
+
const normalizeSourceFile = (id) => resolveViteModuleIdentity(id).key;
|
|
9272
9705
|
const rememberModule = (id) => {
|
|
9273
9706
|
if (!options.shouldOwnTailwindGeneration || typeof id !== "string" || id.length === 0) return;
|
|
9274
9707
|
moduleIds.add(id);
|
|
9275
|
-
const
|
|
9276
|
-
if (isSourceStyleRequest(cleanId)) moduleIds.add(
|
|
9708
|
+
const identity = resolveViteModuleIdentity(id);
|
|
9709
|
+
if (isSourceStyleRequest(identity.cleanId)) for (const moduleId of identity.lookupIds) moduleIds.add(moduleId);
|
|
9277
9710
|
};
|
|
9278
9711
|
const register = async (id, code) => {
|
|
9279
9712
|
rememberModule(id);
|
|
@@ -9577,7 +10010,7 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
9577
10010
|
generatedClassSetByFile,
|
|
9578
10011
|
getCommand: () => resolvedConfig?.command,
|
|
9579
10012
|
getGeneratorOptions: resolveCurrentGeneratorOptions,
|
|
9580
|
-
|
|
10013
|
+
isRuntimeAffectingSource: (file) => uniAppXEnabled && !resolveCurrentGeneratorBranch().isWeb && /\.(?:uvue|nvue)$/i.test(cleanUrl(file))
|
|
9581
10014
|
});
|
|
9582
10015
|
const sourceScanSession = createFrameworkSourceScanSession({
|
|
9583
10016
|
cssMemory,
|
|
@@ -9685,8 +10118,8 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
9685
10118
|
const fullRuntime = getSourceCandidates() ?? getRecordedGeneratorCandidates() ?? await ensureRuntimeClassSet();
|
|
9686
10119
|
const transient = hookContext?.transient === true;
|
|
9687
10120
|
const pendingHmrChange = transient ? void 0 : hmrCandidateState.resolve(generatorCode, file);
|
|
9688
|
-
const forceFullHmrCssRegeneration = hmrCandidateState.shouldForceFullRegeneration(pendingHmrChange !== void 0);
|
|
9689
|
-
const runtime = fullRuntime;
|
|
10121
|
+
const forceFullHmrCssRegeneration = hmrCandidateState.shouldForceFullRegeneration(file, pendingHmrChange !== void 0);
|
|
10122
|
+
const runtime = hookContext?.sourceCandidates === void 0 ? fullRuntime : new Set(hookContext.sourceCandidates);
|
|
9690
10123
|
const importShellCss = resolveViteServeRootMiniProgramImportShell({
|
|
9691
10124
|
css: generatorTransformCode,
|
|
9692
10125
|
cssPipelineContext,
|
|
@@ -9705,7 +10138,7 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
9705
10138
|
markViteProcessedCssSource(file);
|
|
9706
10139
|
rememberTailwindRootCssModule(id);
|
|
9707
10140
|
recordGeneratorCandidates(fullRuntime);
|
|
9708
|
-
if (pendingHmrChange) hmrCandidateState.finishTarget(file);
|
|
10141
|
+
if (pendingHmrChange || forceFullHmrCssRegeneration) hmrCandidateState.finishTarget(file);
|
|
9709
10142
|
else if (!hmrCandidateState.hasPendingChange()) hmrCandidateState.clear();
|
|
9710
10143
|
cssMemory.rememberCssSource({
|
|
9711
10144
|
outputFile,
|
|
@@ -9759,8 +10192,8 @@ ${previousTracedCss}`;
|
|
|
9759
10192
|
previousCss: previousGeneratorCss,
|
|
9760
10193
|
previousClassSet: pendingHmrChange && !forceFullHmrCssRegeneration ? generatedClassSetByFile.get(fileKey) : void 0,
|
|
9761
10194
|
deferEmptyScopedCssSource: shouldDeferEmptyScopedCssSource,
|
|
9762
|
-
deferCssAdaptation: !currentGeneratorBranch.isWeb && !shouldAdaptFrameworkWatchCss(),
|
|
9763
|
-
disableSourceScan:
|
|
10195
|
+
deferCssAdaptation: !transient && !currentGeneratorBranch.isWeb && !shouldAdaptFrameworkWatchCss(),
|
|
10196
|
+
disableSourceScan: hookContext?.disableSourceScan === true,
|
|
9764
10197
|
cssStage: hookContext?.cssStage,
|
|
9765
10198
|
restoreLocalCssImports: !currentGeneratorBranch.isWeb
|
|
9766
10199
|
}), {
|
|
@@ -9814,9 +10247,9 @@ ${previousTracedCss}`;
|
|
|
9814
10247
|
source: tracedCss
|
|
9815
10248
|
});
|
|
9816
10249
|
markViteProcessedCssSource(file);
|
|
9817
|
-
rememberTailwindRootCssModule(id);
|
|
10250
|
+
if (hasTailwindRootDirectives(generatorTransformCode, { importFallback: currentGeneratorOptions.importFallback })) rememberTailwindRootCssModule(id);
|
|
9818
10251
|
recordGeneratorCandidates(fullRuntime);
|
|
9819
|
-
if (pendingHmrChange) hmrCandidateState.finishTarget(file);
|
|
10252
|
+
if (pendingHmrChange || forceFullHmrCssRegeneration) hmrCandidateState.finishTarget(file);
|
|
9820
10253
|
else if (!hmrCandidateState.hasPendingChange()) hmrCandidateState.clear();
|
|
9821
10254
|
cssMemory.rememberCssSource({
|
|
9822
10255
|
outputFile,
|
|
@@ -9827,6 +10260,11 @@ ${previousTracedCss}`;
|
|
|
9827
10260
|
return `${createBundlerGeneratedCssMarker("vite", normalizeViteProcessedCssFile(file))}
|
|
9828
10261
|
${tracedCss}`;
|
|
9829
10262
|
};
|
|
10263
|
+
const shouldDeferFrameworkPreTransformGeneration = (id, code) => frameworkCssPipelineStrategy?.shouldDeferPreTransformTailwindGeneration?.({
|
|
10264
|
+
...createCssPipelineContext(),
|
|
10265
|
+
code,
|
|
10266
|
+
id
|
|
10267
|
+
}) === true;
|
|
9830
10268
|
const rewritePlugins = createRewriteCssImportsPlugins({
|
|
9831
10269
|
getAppType: () => opts.appType,
|
|
9832
10270
|
generateTailwindCss: generateTailwindCssForVitePipeline,
|
|
@@ -9834,7 +10272,7 @@ ${tracedCss}`;
|
|
|
9834
10272
|
onTailwindRootCss: registerTailwindRootCss,
|
|
9835
10273
|
onCssSourceTransform: (id, code) => cssMemory.refreshRememberedCssSourceBySourceFile(id, code),
|
|
9836
10274
|
shouldGenerateCss: (_id, code) => hasVitePipelineTailwindGenerationDirective(code),
|
|
9837
|
-
shouldDeferGeneration: (
|
|
10275
|
+
shouldDeferGeneration: (id, code) => !shouldRewriteCssImports && hasTailwindRootDirectives(code, { importFallback: resolveCurrentGeneratorOptions().importFallback }) || shouldDeferFrameworkPreTransformGeneration(id, code),
|
|
9838
10276
|
shouldOwnTailwindGeneration,
|
|
9839
10277
|
shouldRewrite: shouldRewriteCssImports,
|
|
9840
10278
|
weappTailwindcssDirPosix
|
|
@@ -9917,6 +10355,7 @@ ${tracedCss}`;
|
|
|
9917
10355
|
getRememberedMainCssSource: cssMemory.getRememberedCssSourceEntry
|
|
9918
10356
|
});
|
|
9919
10357
|
const extraPluginPlatform = frameworkBranch.getExtraPluginPlatform?.() ?? {};
|
|
10358
|
+
const syncSourceCandidatesForHotUpdate = (ctx) => syncFrameworkSourceCandidatesForHotUpdate(sourceScanSession, ctx);
|
|
9920
10359
|
const prepareTailwindGeneration = async () => {
|
|
9921
10360
|
if (sourceScanSession.shouldDiscoverAutoCssSources(autoCssSourcesDiscovered)) await discoverAndRegisterAutoCssSources();
|
|
9922
10361
|
await sourceScanSession.sync();
|
|
@@ -9929,10 +10368,13 @@ ${tracedCss}`;
|
|
|
9929
10368
|
getResolvedConfig,
|
|
9930
10369
|
isEnabled: shouldEnableFrameworkExtraPlugins,
|
|
9931
10370
|
isIosPlatform: extraPluginPlatform.isIosPlatform === true,
|
|
10371
|
+
isNativeAppStyleTarget: () => frameworkCssPipelineStrategy?.isNativeAppStyleTarget?.(createCssPipelineContext()) === true,
|
|
10372
|
+
isWebGeneratorTarget: () => resolveCurrentGeneratorBranch().isWeb,
|
|
9932
10373
|
jsHandler,
|
|
9933
10374
|
mainCssChunkMatcher,
|
|
9934
10375
|
runtimeState,
|
|
9935
10376
|
styleHandler,
|
|
10377
|
+
syncSourceCandidatesForHotUpdate,
|
|
9936
10378
|
tailwindRootCssModuleIds,
|
|
9937
10379
|
uniAppX,
|
|
9938
10380
|
viteProcessedCssSourceFiles: processedCssRegistry.sourceFiles
|
|
@@ -10002,12 +10444,14 @@ ${tracedCss}`;
|
|
|
10002
10444
|
syncCssEntriesFromAnchor
|
|
10003
10445
|
});
|
|
10004
10446
|
const plugins = [
|
|
10447
|
+
...extraPlugins,
|
|
10005
10448
|
...rewritePlugins,
|
|
10006
10449
|
sourceCandidatesPlugin,
|
|
10007
10450
|
...createViteCssGenerationPlugins({
|
|
10008
10451
|
generateCss: generateTailwindCssForVitePipeline,
|
|
10009
10452
|
getCommand: () => resolvedConfig?.command,
|
|
10010
10453
|
onTailwindRootCss: registerTailwindRootCss,
|
|
10454
|
+
shouldDeferGeneration: shouldDeferFrameworkPreTransformGeneration,
|
|
10011
10455
|
shouldGenerate: () => shouldOwnTailwindGeneration,
|
|
10012
10456
|
shouldGenerateBuild: () => resolveCurrentGeneratorBranch().isWeb
|
|
10013
10457
|
}),
|
|
@@ -10030,7 +10474,6 @@ ${tracedCss}`;
|
|
|
10030
10474
|
},
|
|
10031
10475
|
postPlugin
|
|
10032
10476
|
];
|
|
10033
|
-
plugins.push(...extraPlugins);
|
|
10034
10477
|
plugins.push(cssFinalizerOutputPlugin);
|
|
10035
10478
|
plugins.push(...createBuiltinViteStyleInjectorPlugins(styleInjector, () => frameworkBranch.styleInjectorDelegate));
|
|
10036
10479
|
return plugins;
|
|
@@ -10292,7 +10735,8 @@ function resolveUniAppXNativeCssHandlerOptions(opts) {
|
|
|
10292
10735
|
//#endregion
|
|
10293
10736
|
//#region src/bundlers/vite/frameworks/uni-app-x/index.ts
|
|
10294
10737
|
function isUniAppXNativeAppStyleTarget(context) {
|
|
10295
|
-
|
|
10738
|
+
const stylePlatform = context?.resolveStylePlatform?.();
|
|
10739
|
+
return resolveUniUtsPlatform().isApp || stylePlatform === "app" || stylePlatform === "app-plus" || stylePlatform?.startsWith("app-") === true || isUniAppXNativeAppOutDir(context?.resolvedConfig?.build?.outDir) || isUniAppXNativeAppOutDir(context?.resolvedConfig?.root);
|
|
10296
10740
|
}
|
|
10297
10741
|
function isUniAppXHarmonyAppStyleTarget(context) {
|
|
10298
10742
|
const uniUtsPlatform = resolveUniUtsPlatform();
|
|
@@ -10319,6 +10763,9 @@ const uniAppXCssPipelineStrategy = {
|
|
|
10319
10763
|
if (!context.cssHandlerOptions.isMainChunk && hasTailwindApplyDirective(context.generatorCode)) return false;
|
|
10320
10764
|
return true;
|
|
10321
10765
|
},
|
|
10766
|
+
shouldDeferPreTransformTailwindGeneration(context) {
|
|
10767
|
+
return resolveUniAppXCssTarget(context.id) === "uvue" && hasTailwindApplyDirective(context.code) && !hasTailwindRootDirectives(context.code, { importFallback: true });
|
|
10768
|
+
},
|
|
10322
10769
|
transformGeneratedCss(css, context) {
|
|
10323
10770
|
const webCss = context.shouldApplyWebCssCompat ? context.defaultWebCssCompat(css) : css;
|
|
10324
10771
|
return withUniAppXWebPreflightReset(context.removeScopedPreflight(webCss), context.currentGeneratorBranch.isWeb);
|
|
@@ -10341,10 +10788,13 @@ function createUniAppXVitePlugins(options = {}) {
|
|
|
10341
10788
|
getResolvedConfig: context.getResolvedConfig,
|
|
10342
10789
|
isEnabled: context.isEnabled,
|
|
10343
10790
|
isIosPlatform: context.isIosPlatform,
|
|
10791
|
+
isNativeAppStyleTarget: context.isNativeAppStyleTarget,
|
|
10792
|
+
isWebGeneratorTarget: context.isWebGeneratorTarget,
|
|
10344
10793
|
jsHandler: context.jsHandler,
|
|
10345
10794
|
mainCssChunkMatcher: context.mainCssChunkMatcher,
|
|
10346
10795
|
runtimeState: context.runtimeState,
|
|
10347
10796
|
styleHandler: context.styleHandler,
|
|
10797
|
+
syncSourceCandidatesForHotUpdate: context.syncSourceCandidatesForHotUpdate,
|
|
10348
10798
|
tailwindRootCssModuleIds: context.tailwindRootCssModuleIds,
|
|
10349
10799
|
uniAppX: context.uniAppX,
|
|
10350
10800
|
viteProcessedCssSourceFiles: context.viteProcessedCssSourceFiles
|