weapp-tailwindcss 5.1.10 → 5.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache-options-DavPxrhC.js +16 -0
- package/dist/cache-options-DwBtLwQe.mjs +5 -0
- package/dist/cli.js +10 -6
- package/dist/cli.mjs +10 -6
- package/dist/context-DRRgW7i2.js +1311 -0
- package/dist/context-xSJE588m.mjs +1234 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/defaults.js +119 -5
- package/dist/defaults.mjs +114 -1
- package/dist/{generator-ROzBodj6.mjs → generator-BvPcmqxU.mjs} +9 -139
- package/dist/{generator-Bz94KTkH.js → generator-CS10c9g1.js} +18 -154
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-BKqMb_Ds.mjs → gulp-BEOzXrbp.mjs} +5 -4
- package/dist/{gulp-DfOLvYLs.js → gulp-DNZZvUMq.js} +6 -5
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DOTdH18A.js → hmr-timing-DW1g3zjl.js} +17 -15
- package/dist/{hmr-timing-DwtYJdwb.mjs → hmr-timing-hRhRAjYV.mjs} +5 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/object-BJSWl-E5.mjs +9 -0
- package/dist/object-COs_Mw6p.js +14 -0
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/presets.js +5 -5
- package/dist/presets.mjs +3 -3
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-BrWuBTjY.js → source-candidate-scan-signature-CMgu5bJk.js} +6 -6
- package/dist/{source-candidate-scan-signature-CQ04hiox.mjs → source-candidate-scan-signature-t4XKAQ04.mjs} +3 -3
- package/dist/{tailwindcss-hzy_WaC9.mjs → tailwindcss-DZT_pWrd.mjs} +132 -2
- package/dist/{tailwindcss-Dn5DVlkI.js → tailwindcss-z9JMF-qU.js} +140 -10
- package/dist/{transform-DZQETx51.js → transform-COFRlmDF.js} +13 -13
- package/dist/{transform-BgnNYkIG.mjs → transform-D5JUgMpE.mjs} +1 -1
- package/dist/{utils-D3h8j7Mk.js → utils-CuKLf1Zv.js} +0 -15
- package/dist/{utils-DodxWHGz.mjs → utils-MVwpU07P.mjs} +1 -8
- package/dist/{vite-BimHmlSp.mjs → vite-DF1gE6a5.mjs} +36 -30
- package/dist/{vite-bztpcI8_.js → vite-VGfkFQkC.js} +51 -45
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +6 -2
- package/dist/{webpack-CCapGlNg.mjs → webpack-CTYm19zA.mjs} +22 -16
- package/dist/{webpack-XxBCIrBp.js → webpack-CzXjfvYS.js} +28 -22
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/dist/{context-y2BGCok4.js → wxml-Ce10eREX.js} +37 -1286
- package/dist/{context-DzkSFEVL.mjs → wxml-DdGdeqaH.mjs} +13 -1235
- package/package.json +2 -2
- package/dist/defaults-9B6aMyZb.mjs +0 -118
- package/dist/defaults-nsf4VNMX.js +0 -154
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { resolveImplicitAppTypeFromViteRoot } from "./framework.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { At as resolveTailwindV4CssSourceBase, E as resolveTailwindcssOptions, J as hasTailwindApplyDirective, K as stripMiniProgramCssSpecificityPlaceholders, N as normalizeEmptyTailwindCustomVariants, Nt as filterUnsupportedMiniProgramTailwindV4Candidates, Q as normalizeTailwindConfigDirectives, U as hasMiniProgramCssSpecificityPlaceholders, X as hasTailwindRootDirectives, Y as hasTailwindNonRootGenerationDirectives, Z as hasTailwindSourceDirectives, a as resolveGeneratorRuntimeBranch, b as normalizeCssEntries, c as shouldUseNativeAppCssBranch, ct as hasTailwindGeneratedCssMarkers, et as normalizeTailwindSourceForGenerator, ft as stripGeneratorPlaceholderMarkers, g as upsertTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, j as hasUserCssLayerBlocks, l as resolveUniUtsPlatform, m as filterTailwindV4CssSourceRoots, nt as removeTailwindSourceDirectives, q as hasLocalCssImport, s as shouldUseMiniProgramCssBranch, tt as parseImportRequest, vt as getTailwindV4IncrementalGenerateCacheStats, x as findNearestPackageRoot, y as isTailwindV4CssEntry } from "./generator-BvPcmqxU.mjs";
|
|
3
|
+
import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
|
|
4
|
+
import { _ as resolveViteTailwindV4CssDependencies, a as findTailwindConfig, f as createViteSourceScanMatcher, g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as resolveViteSourceScanEntries, r as isUniAppXEnabled } from "./tailwindcss-DZT_pWrd.mjs";
|
|
5
|
+
import "./utils-MVwpU07P.mjs";
|
|
6
|
+
import { g as replaceWxml, y as createDebug } from "./wxml-DdGdeqaH.mjs";
|
|
7
|
+
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-xSJE588m.mjs";
|
|
8
|
+
import { A as processCachedTask, D as createCssSourceTraceCacheSignature, E as annotateCssSourceTrace, O as createCssTokenSourceMap, S as scoreTailwindV4CssSourceFileMatch, _ as normalizeMiniProgramGeneratorCssSource, a as isSourceCandidateRequest, d as validateCandidatesByGenerator, g as mergeMarkedUserLayerComponentsCss, h as extractMarkedUserLayerComponentsCss, m as runWithConcurrency, r as createSourceCandidateCollector, s as createBundleRuntimeClassSetManager, t as createHmrTimingRecorder, v as normalizeMiniProgramImportShell, y as isPureLocalCssImportWrapper } from "./hmr-timing-hRhRAjYV.mjs";
|
|
9
|
+
import { A as createBundlerGeneratedCssMarker, B as resolveViteFrameworkProfile, C as createBundleModuleGraphOptions, D as normalizeOutputPathKey, E as stripRequestQuery, F as resolvePluginDisabledState, I as createBuiltinViteStyleInjectorPlugins, M as parseBundlerGeneratedCssMarkerBlocks, N as stripBundlerGeneratedCssMarkers, P as resolvePackageDir, R as viteStyleInjectorDelegates, S as applyLinkedResults, T as isSourceStyleRequest, _ as isCSSRequest, a as createCandidateSignature, b as slash, c as getSnapshotHash, d as buildBundleSnapshot, g as formatPostcssSourceMap, h as cleanUrl, i as createScopedGeneratorSourceTraceMap, j as hasBundlerGeneratedCssMarker, k as toAbsoluteOutputPath, l as hasRuntimeAffectingSourceChanges, m as updateBundleBuildState, n as createScopedGeneratorCandidateSignature, o as createJsHashSalt, p as createBundleBuildState, r as createScopedGeneratorRuntime, s as createLinkedImpactSignature, t as createSourceCandidateScanSignature, u as summarizeStringDiff, v as isHTMLRequest, w as generateTailwindV4Css, x as createRuntimeAffectingSourceSignature, y as normalizePath } from "./source-candidate-scan-signature-t4XKAQ04.mjs";
|
|
8
10
|
import { t as logger$1 } from "./logger-BNzxZbZj.mjs";
|
|
9
11
|
import fs, { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
10
12
|
import path from "node:path";
|
|
@@ -476,15 +478,19 @@ function collectExplicitTailwindV4CssEntries(opts) {
|
|
|
476
478
|
];
|
|
477
479
|
return [...new Set(entries.filter((entry) => typeof entry === "string" && entry.length > 0))];
|
|
478
480
|
}
|
|
481
|
+
function shouldKeepSingleExplicitCssEntrySource(source) {
|
|
482
|
+
return /@plugin\b/.test(source);
|
|
483
|
+
}
|
|
479
484
|
function collectConfiguredTailwindV4CssSourceEntries(opts, fallbackBase) {
|
|
480
485
|
const entries = [];
|
|
481
486
|
const seen = /* @__PURE__ */ new Set();
|
|
482
487
|
const explicitCssEntries = collectExplicitTailwindV4CssEntries(opts);
|
|
483
|
-
for (const cssEntry of explicitCssEntries
|
|
488
|
+
for (const cssEntry of explicitCssEntries) {
|
|
484
489
|
if (typeof cssEntry !== "string" || cssEntry.length === 0) continue;
|
|
485
490
|
const resolvedFile = path.isAbsolute(cssEntry) ? path.resolve(cssEntry) : path.resolve(fallbackBase, cssEntry);
|
|
486
491
|
if (!existsSync(resolvedFile)) continue;
|
|
487
492
|
const source = readFileSync(resolvedFile, "utf8");
|
|
493
|
+
if (explicitCssEntries.length <= 1 && !shouldKeepSingleExplicitCssEntrySource(source)) continue;
|
|
488
494
|
const key = `${resolvedFile}\0${source}`;
|
|
489
495
|
if (seen.has(key)) continue;
|
|
490
496
|
seen.add(key);
|
|
@@ -3454,7 +3460,7 @@ function resolveUniAppXStyleIsolationEnabled(root) {
|
|
|
3454
3460
|
//#region src/uni-app-x/vite.ts
|
|
3455
3461
|
let transformUVuePromise;
|
|
3456
3462
|
function loadTransformUVue() {
|
|
3457
|
-
transformUVuePromise ?? (transformUVuePromise = import("./transform-
|
|
3463
|
+
transformUVuePromise ?? (transformUVuePromise = import("./transform-D5JUgMpE.mjs").then((mod) => mod.transformUVue));
|
|
3458
3464
|
return transformUVuePromise;
|
|
3459
3465
|
}
|
|
3460
3466
|
const preprocessorLangs = /* @__PURE__ */ new Set([
|
|
@@ -3800,7 +3806,8 @@ function processJsBundleEntry(options) {
|
|
|
3800
3806
|
return;
|
|
3801
3807
|
}
|
|
3802
3808
|
const currentSource = originalEntrySource;
|
|
3803
|
-
const
|
|
3809
|
+
const absoluteFile = path.resolve(outDir, file);
|
|
3810
|
+
const precheckOptions = createHandlerOptions(absoluteFile, {
|
|
3804
3811
|
uniAppX: resolveUniAppXJsTransformEnabled$1(uniAppX),
|
|
3805
3812
|
babelParserOptions: {
|
|
3806
3813
|
plugins: ["typescript"],
|
|
@@ -4659,6 +4666,9 @@ function inferPlatformFromViteOutDir$1(outDir) {
|
|
|
4659
4666
|
const normalized = segment.trim().toLowerCase();
|
|
4660
4667
|
if (normalized === "h5" || normalized === "web" || normalized === "app" || normalized === "app-plus" || normalized.startsWith("app-") || normalized.startsWith("mp-") || normalized.startsWith("quickapp-webview")) return normalized;
|
|
4661
4668
|
}
|
|
4669
|
+
function hasTailwindPluginDirective(source) {
|
|
4670
|
+
return /@plugin\b/.test(source);
|
|
4671
|
+
}
|
|
4662
4672
|
function createGenerateBundleHook(context) {
|
|
4663
4673
|
const state = createBundleBuildState();
|
|
4664
4674
|
const lastCssResultByFile = /* @__PURE__ */ new Map();
|
|
@@ -5256,8 +5266,9 @@ function createGenerateBundleHook(context) {
|
|
|
5256
5266
|
if (!hasUsableRememberedTailwindSource) {
|
|
5257
5267
|
const configuredTailwindV4CssSourceEntries = getConfiguredTailwindV4CssSourceEntries();
|
|
5258
5268
|
const isCurrentRootMiniProgramStyleOutput = opts.cssMatcher(outputFile) && isMiniProgramStyleOutputFile(outputFile) && !normalizeOutputPathKey(outputFile.replace(/[?#].*$/, "")).includes("/");
|
|
5259
|
-
|
|
5260
|
-
|
|
5269
|
+
const configuredEntriesForCurrentRootMiniProgramStyle = isCurrentRootMiniProgramStyleOutput && !hasTailwindGenerationSource(rawSource) ? configuredTailwindV4CssSourceEntries.filter((entry) => hasTailwindPluginDirective(entry.source)) : configuredTailwindV4CssSourceEntries;
|
|
5270
|
+
if (isCurrentRootMiniProgramStyleOutput && (hasTailwindGenerationSource(rawSource) || configuredEntriesForCurrentRootMiniProgramStyle.length > 0)) {
|
|
5271
|
+
const configuredGenerationSource = selectTailwindV4GenerationCssSourceForOutput(outputFile, configuredEntriesForCurrentRootMiniProgramStyle, rawSource, {
|
|
5261
5272
|
cwd: opts.tailwindcssBasedir,
|
|
5262
5273
|
outputRoot: outDir,
|
|
5263
5274
|
projectRoot: sourceRoot ?? rootDir
|
|
@@ -5501,7 +5512,7 @@ function createGenerateBundleHook(context) {
|
|
|
5501
5512
|
const runTransform = async () => {
|
|
5502
5513
|
const start = performance.now();
|
|
5503
5514
|
await runtimeState.readyPromise;
|
|
5504
|
-
const previousCss = !vitePipelineCssAsset && useIncrementalMode && !hasRuntimeAffectingChanges && !snapshot.changedByType.css.has(file) ? getLastCssResult(lastCssResultByFile, outputFile, file) : void 0;
|
|
5515
|
+
const previousCss = !vitePipelineCssAsset && useIncrementalMode && !generatorCandidatesChanged && !hasRuntimeAffectingChanges && !snapshot.changedByType.css.has(file) ? getLastCssResult(lastCssResultByFile, outputFile, file) : void 0;
|
|
5505
5516
|
const generatorTransformRawSource = generatorRawSource;
|
|
5506
5517
|
const previousGeneratorCss = previousCss && !isWebGeneratorTarget ? normalizeMiniProgramGeneratorRawSource(previousCss, outputFile) : previousCss;
|
|
5507
5518
|
const generated = hasTailwindGenerationSource(generatorTransformRawSource) || hasBundlerGeneratedCssMarker(rawSource) ? await generateTailwindV4Css({
|
|
@@ -5523,7 +5534,8 @@ function createGenerateBundleHook(context) {
|
|
|
5523
5534
|
...usesConfiguredTailwindV4FallbackSource ? { restoreLocalCssImports: false } : {}
|
|
5524
5535
|
}) : void 0;
|
|
5525
5536
|
if (generated) {
|
|
5526
|
-
const
|
|
5537
|
+
const outputCss = transformWebTargetCss(generated.css);
|
|
5538
|
+
const tracedCss = removeRootCoveredCssFromScopedAsset(annotateCss(outputCss));
|
|
5527
5539
|
registerGeneratorDependencies$1({ addWatchFile }, generated.dependencies);
|
|
5528
5540
|
if (envFlags.debugCssDiff) debug("css diff %s: %s", generatorSourceFile, summarizeStringDiff(generatorRawSource, tracedCss));
|
|
5529
5541
|
debug("css generated result: %s bytes=%d", file, tracedCss.length);
|
|
@@ -6283,7 +6295,8 @@ function resolveHotTailwindCssModules(ctx, tailwindRootCssModuleIds) {
|
|
|
6283
6295
|
};
|
|
6284
6296
|
const collectModule = (mod) => {
|
|
6285
6297
|
if (mod == null || seenModules.has(mod)) return;
|
|
6286
|
-
|
|
6298
|
+
const modId = mod.id ?? mod.url;
|
|
6299
|
+
if (!isHotSourceStyleModule(modId)) return;
|
|
6287
6300
|
seenModules.add(mod);
|
|
6288
6301
|
ctx.server.moduleGraph.invalidateModule(mod);
|
|
6289
6302
|
modules.push(mod);
|
|
@@ -6351,7 +6364,7 @@ function includesHotModule(modules, target) {
|
|
|
6351
6364
|
});
|
|
6352
6365
|
}
|
|
6353
6366
|
function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
6354
|
-
|
|
6367
|
+
return {
|
|
6355
6368
|
type: "js-update",
|
|
6356
6369
|
timestamp,
|
|
6357
6370
|
path: hotUrl,
|
|
@@ -6359,12 +6372,6 @@ function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
|
6359
6372
|
explicitImportRequired: false,
|
|
6360
6373
|
isWithinCircularImport: false
|
|
6361
6374
|
};
|
|
6362
|
-
return {
|
|
6363
|
-
type: "css-update",
|
|
6364
|
-
timestamp,
|
|
6365
|
-
path: hotUrl,
|
|
6366
|
-
acceptedPath: hotUrl
|
|
6367
|
-
};
|
|
6368
6375
|
}
|
|
6369
6376
|
function hasSelfAcceptingNonStyleHotModule(modules) {
|
|
6370
6377
|
return modules.some((mod) => {
|
|
@@ -6618,8 +6625,9 @@ function createViteRuntimeClassSet(options) {
|
|
|
6618
6625
|
}
|
|
6619
6626
|
async function refreshRuntimeState(force) {
|
|
6620
6627
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
6628
|
+
const shouldRefresh = force || invalidation.changed;
|
|
6621
6629
|
const refreshed = await refreshTailwindRuntimeState(runtimeState, {
|
|
6622
|
-
force:
|
|
6630
|
+
force: shouldRefresh,
|
|
6623
6631
|
clearCache: force || invalidation.changed
|
|
6624
6632
|
});
|
|
6625
6633
|
if (invalidation.changed) debug("runtime signature changed, refresh triggered. signature: %s", invalidation.signature);
|
|
@@ -7025,11 +7033,12 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7025
7033
|
if (autoCssSourceContent.get(sourceFile) === sourceCss) continue;
|
|
7026
7034
|
autoCssSourceContent.set(sourceFile, sourceCss);
|
|
7027
7035
|
await syncTailwindCssSourceCandidates(sourceFile, sourceCss);
|
|
7036
|
+
const resolved = await resolveTailwindV4EntriesFromCssCached(sourceCss, sourceBase);
|
|
7028
7037
|
changed = upsertTailwindV4CssSource(opts, {
|
|
7029
7038
|
file: sourceFile,
|
|
7030
7039
|
base: sourceBase,
|
|
7031
7040
|
css: sourceCss,
|
|
7032
|
-
dependencies:
|
|
7041
|
+
dependencies: resolved?.dependencies ?? []
|
|
7033
7042
|
}) || changed;
|
|
7034
7043
|
}
|
|
7035
7044
|
if (!changed) return;
|
|
@@ -7342,9 +7351,10 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7342
7351
|
const recordViteProcessedCssAssetResult = (file, css, options = {}) => {
|
|
7343
7352
|
const key = normalizeVitePersistentCacheKey(file);
|
|
7344
7353
|
const previous = viteProcessedCssAssetResults.get(key);
|
|
7354
|
+
const injectIntoMain = previous?.injectIntoMain === true ? true : options.injectIntoMain ?? previous?.injectIntoMain;
|
|
7345
7355
|
touchMapEntry(viteProcessedCssAssetResults, key, {
|
|
7346
7356
|
css,
|
|
7347
|
-
injectIntoMain
|
|
7357
|
+
injectIntoMain,
|
|
7348
7358
|
outputFile: options.outputFile ?? previous?.outputFile
|
|
7349
7359
|
});
|
|
7350
7360
|
};
|
|
@@ -7443,7 +7453,7 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7443
7453
|
const fullRuntime = getSourceCandidates() ?? getRecordedGeneratorCandidates() ?? await ensureRuntimeClassSet();
|
|
7444
7454
|
const pendingHmrChange = resolvePendingHmrCandidateChange(generatorCode, file);
|
|
7445
7455
|
const forceFullHmrCssRegeneration = pendingFullHmrCssRegeneration || resolvedConfig?.command === "serve" && pendingHmrCandidateChange !== void 0 && pendingHmrChange === void 0;
|
|
7446
|
-
const runtime =
|
|
7456
|
+
const runtime = fullRuntime;
|
|
7447
7457
|
if (pendingHmrChange && currentGeneratorOptions.target === "weapp" && filterUnsupportedMiniProgramTailwindV4Candidates(pendingHmrChange.addedCandidates).size === 0) {
|
|
7448
7458
|
const previousTracedCss = tracedGeneratedCssByFile.get(file);
|
|
7449
7459
|
if (previousTracedCss !== void 0) {
|
|
@@ -7467,8 +7477,6 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7467
7477
|
cssHandlerOptions,
|
|
7468
7478
|
generatorCode: generatorTransformCode
|
|
7469
7479
|
}) ?? true);
|
|
7470
|
-
const previousCss = pendingHmrChange && !forceFullHmrCssRegeneration ? cleanGeneratedCssByFile.get(file) : void 0;
|
|
7471
|
-
const previousGeneratorCss = previousCss && !currentGeneratorBranch.isWeb ? normalizeMiniProgramGeneratorCssSource(previousCss, outputFile) : previousCss;
|
|
7472
7480
|
const generated = await hmrTimingRecorder.measure("generateCss.serve", () => generateTailwindV4Css({
|
|
7473
7481
|
opts,
|
|
7474
7482
|
runtimeState,
|
|
@@ -7483,10 +7491,8 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7483
7491
|
generatorPlatform: resolveGeneratorPlatform(),
|
|
7484
7492
|
styleHandler,
|
|
7485
7493
|
debug,
|
|
7486
|
-
previousCss: previousGeneratorCss,
|
|
7487
|
-
previousClassSet: pendingHmrChange && !forceFullHmrCssRegeneration ? generatedClassSetByFile.get(file) : void 0,
|
|
7488
7494
|
deferEmptyScopedCssSource: shouldDeferEmptyScopedCssSource,
|
|
7489
|
-
disableSourceScan:
|
|
7495
|
+
disableSourceScan: false,
|
|
7490
7496
|
restoreLocalCssImports: !currentGeneratorBranch.isWeb
|
|
7491
7497
|
}), {
|
|
7492
7498
|
file,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
3
|
+
const require_generator = require("./generator-CS10c9g1.js");
|
|
4
|
+
const require_object = require("./object-COs_Mw6p.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-z9JMF-qU.js");
|
|
6
|
+
require("./utils-CuKLf1Zv.js");
|
|
7
|
+
const require_wxml = require("./wxml-Ce10eREX.js");
|
|
8
|
+
const require_context = require("./context-DRRgW7i2.js");
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-DW1g3zjl.js");
|
|
10
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-CMgu5bJk.js");
|
|
9
11
|
require("./logger-TlKT3xmR.js");
|
|
10
12
|
let node_fs = require("node:fs");
|
|
11
13
|
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
@@ -141,7 +143,7 @@ function cssToStyleExport(source) {
|
|
|
141
143
|
result[match[1]] = { "": declarations };
|
|
142
144
|
const className = unescapeCssClassSelector(match[1]);
|
|
143
145
|
result[className] = { "": declarations };
|
|
144
|
-
result[
|
|
146
|
+
result[require_wxml.replaceWxml(className)] = { "": declarations };
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
});
|
|
@@ -179,14 +181,14 @@ function createStyleValueFromApplySources(sources, utilityStyles) {
|
|
|
179
181
|
if (!className) continue;
|
|
180
182
|
const declarations = {};
|
|
181
183
|
for (const applyRule of applyRules) for (const utility of (0, _tailwindcss_mangle_engine.splitCandidateTokens)(applyRule.params)) {
|
|
182
|
-
const utilityDeclarations = utilityStyles[utility]?.[""] ?? utilityStyles[
|
|
184
|
+
const utilityDeclarations = utilityStyles[utility]?.[""] ?? utilityStyles[require_wxml.replaceWxml(utility)]?.[""];
|
|
183
185
|
if (utilityDeclarations) Object.assign(declarations, utilityDeclarations);
|
|
184
186
|
}
|
|
185
187
|
if (Object.keys(declarations).length > 0) {
|
|
186
188
|
const unescapedClassName = unescapeCssClassSelector(className);
|
|
187
189
|
result[className] = { "": declarations };
|
|
188
190
|
result[unescapedClassName] = { "": declarations };
|
|
189
|
-
result[
|
|
191
|
+
result[require_wxml.replaceWxml(unescapedClassName)] = { "": declarations };
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
});
|
|
@@ -482,15 +484,19 @@ function collectExplicitTailwindV4CssEntries(opts) {
|
|
|
482
484
|
];
|
|
483
485
|
return [...new Set(entries.filter((entry) => typeof entry === "string" && entry.length > 0))];
|
|
484
486
|
}
|
|
487
|
+
function shouldKeepSingleExplicitCssEntrySource(source) {
|
|
488
|
+
return /@plugin\b/.test(source);
|
|
489
|
+
}
|
|
485
490
|
function collectConfiguredTailwindV4CssSourceEntries(opts, fallbackBase) {
|
|
486
491
|
const entries = [];
|
|
487
492
|
const seen = /* @__PURE__ */ new Set();
|
|
488
493
|
const explicitCssEntries = collectExplicitTailwindV4CssEntries(opts);
|
|
489
|
-
for (const cssEntry of explicitCssEntries
|
|
494
|
+
for (const cssEntry of explicitCssEntries) {
|
|
490
495
|
if (typeof cssEntry !== "string" || cssEntry.length === 0) continue;
|
|
491
496
|
const resolvedFile = node_path.default.isAbsolute(cssEntry) ? node_path.default.resolve(cssEntry) : node_path.default.resolve(fallbackBase, cssEntry);
|
|
492
497
|
if (!(0, node_fs.existsSync)(resolvedFile)) continue;
|
|
493
498
|
const source = (0, node_fs.readFileSync)(resolvedFile, "utf8");
|
|
499
|
+
if (explicitCssEntries.length <= 1 && !shouldKeepSingleExplicitCssEntrySource(source)) continue;
|
|
494
500
|
const key = `${resolvedFile}\0${source}`;
|
|
495
501
|
if (seen.has(key)) continue;
|
|
496
502
|
seen.add(key);
|
|
@@ -3460,7 +3466,7 @@ function resolveUniAppXStyleIsolationEnabled(root) {
|
|
|
3460
3466
|
//#region src/uni-app-x/vite.ts
|
|
3461
3467
|
let transformUVuePromise;
|
|
3462
3468
|
function loadTransformUVue() {
|
|
3463
|
-
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-
|
|
3469
|
+
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-COFRlmDF.js")).then((mod) => mod.transformUVue));
|
|
3464
3470
|
return transformUVuePromise;
|
|
3465
3471
|
}
|
|
3466
3472
|
const preprocessorLangs = /* @__PURE__ */ new Set([
|
|
@@ -3494,7 +3500,7 @@ function isCssModuleExport(code) {
|
|
|
3494
3500
|
function createUniAppXPlugins(options) {
|
|
3495
3501
|
const { appType, customAttributesEntities, disabledDefaultTemplateHandler, isIosPlatform: providedIosPlatform, mainCssChunkMatcher, runtimeState, styleHandler, generateCss, jsHandler, ensureRuntimeClassSet, getResolvedConfig, isEnabled = () => true, uniAppX } = options;
|
|
3496
3502
|
const resolvedUniAppXOptions = require_tailwindcss.resolveUniAppXOptions(uniAppX);
|
|
3497
|
-
const utsPlatform =
|
|
3503
|
+
const utsPlatform = require_generator.resolveUniUtsPlatform();
|
|
3498
3504
|
const isIosPlatform = providedIosPlatform ?? utsPlatform.isAppIos;
|
|
3499
3505
|
const isHarmonyPlatform = utsPlatform.isAppHarmony;
|
|
3500
3506
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
@@ -3527,7 +3533,7 @@ function createUniAppXPlugins(options) {
|
|
|
3527
3533
|
return isHarmonyPlatform && resolvedUniAppXOptions.componentLocalStyles.enabled;
|
|
3528
3534
|
}
|
|
3529
3535
|
function isHarmonyBuildTarget() {
|
|
3530
|
-
if (
|
|
3536
|
+
if (require_generator.resolveUniUtsPlatform().isAppHarmony) return true;
|
|
3531
3537
|
return isUniAppXHarmonyOutDir(getResolvedConfig()?.build?.outDir);
|
|
3532
3538
|
}
|
|
3533
3539
|
async function transformStyle(code, id, query, hookContext) {
|
|
@@ -3541,7 +3547,7 @@ function createUniAppXPlugins(options) {
|
|
|
3541
3547
|
const cacheKey = `${mainCssChunkMatcher(id, appType) ? "1" : "0"}:${id}`;
|
|
3542
3548
|
let styleHandlerOptions = cssHandlerOptionsCache.get(cacheKey);
|
|
3543
3549
|
if (!styleHandlerOptions) {
|
|
3544
|
-
styleHandlerOptions =
|
|
3550
|
+
styleHandlerOptions = require_object.omitUndefined({
|
|
3545
3551
|
isMainChunk: mainCssChunkMatcher(id, appType),
|
|
3546
3552
|
uniAppXCssTarget: resolveUniAppXCssTarget(id),
|
|
3547
3553
|
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
@@ -3604,7 +3610,7 @@ function createUniAppXPlugins(options) {
|
|
|
3604
3610
|
const transformUVue = await loadTransformUVue();
|
|
3605
3611
|
const enableComponentLocalStyle = shouldEnableComponentLocalStyle();
|
|
3606
3612
|
const enablePageLocalStyle = shouldEnableHarmonyPageLocalStyle();
|
|
3607
|
-
if (customAttributesEntities.length > 0 || disabledDefaultTemplateHandler || enableComponentLocalStyle || enablePageLocalStyle) return transformUVue(code, id, jsHandler, currentRuntimeSet,
|
|
3613
|
+
if (customAttributesEntities.length > 0 || disabledDefaultTemplateHandler || enableComponentLocalStyle || enablePageLocalStyle) return transformUVue(code, id, jsHandler, currentRuntimeSet, require_object.omitUndefined({
|
|
3608
3614
|
...customAttributesEntities.length > 0 ? { customAttributesEntities } : {},
|
|
3609
3615
|
...disabledDefaultTemplateHandler ? { disabledDefaultTemplateHandler } : {},
|
|
3610
3616
|
...enableComponentLocalStyle ? { enableComponentLocalStyle } : {},
|
|
@@ -3633,7 +3639,7 @@ function createUniAppXPlugins(options) {
|
|
|
3633
3639
|
order: "post",
|
|
3634
3640
|
async handler(_options, bundle) {
|
|
3635
3641
|
if (!isEnabled()) return;
|
|
3636
|
-
const currentUtsPlatform =
|
|
3642
|
+
const currentUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
3637
3643
|
const canInferHarmonyTarget = !currentUtsPlatform.normalized || currentUtsPlatform.isApp;
|
|
3638
3644
|
const isHarmonyTarget = currentUtsPlatform.isAppHarmony || canInferHarmonyTarget && isHarmonyBuildTarget();
|
|
3639
3645
|
if (!currentUtsPlatform.isApp && !isHarmonyTarget) return;
|
|
@@ -3806,7 +3812,8 @@ function processJsBundleEntry(options) {
|
|
|
3806
3812
|
return;
|
|
3807
3813
|
}
|
|
3808
3814
|
const currentSource = originalEntrySource;
|
|
3809
|
-
const
|
|
3815
|
+
const absoluteFile = node_path.default.resolve(outDir, file);
|
|
3816
|
+
const precheckOptions = createHandlerOptions(absoluteFile, {
|
|
3810
3817
|
uniAppX: resolveUniAppXJsTransformEnabled$1(uniAppX),
|
|
3811
3818
|
babelParserOptions: {
|
|
3812
3819
|
plugins: ["typescript"],
|
|
@@ -4665,6 +4672,9 @@ function inferPlatformFromViteOutDir$1(outDir) {
|
|
|
4665
4672
|
const normalized = segment.trim().toLowerCase();
|
|
4666
4673
|
if (normalized === "h5" || normalized === "web" || normalized === "app" || normalized === "app-plus" || normalized.startsWith("app-") || normalized.startsWith("mp-") || normalized.startsWith("quickapp-webview")) return normalized;
|
|
4667
4674
|
}
|
|
4675
|
+
function hasTailwindPluginDirective(source) {
|
|
4676
|
+
return /@plugin\b/.test(source);
|
|
4677
|
+
}
|
|
4668
4678
|
function createGenerateBundleHook(context) {
|
|
4669
4679
|
const state = require_source_candidate_scan_signature.createBundleBuildState();
|
|
4670
4680
|
const lastCssResultByFile = /* @__PURE__ */ new Map();
|
|
@@ -4717,7 +4727,7 @@ function createGenerateBundleHook(context) {
|
|
|
4717
4727
|
const getCssSource = (sourceFile) => getKnownCssSource?.(sourceFile) ?? getSourceCandidateSource?.(sourceFile);
|
|
4718
4728
|
const { cache, onEnd, onStart, onUpdate, styleHandler, templateHandler, jsHandler, uniAppX } = opts;
|
|
4719
4729
|
const resolvedConfig = getResolvedConfig();
|
|
4720
|
-
const uniUtsPlatform =
|
|
4730
|
+
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
4721
4731
|
const generatorPlatform = opts.cssOptions?.platform ?? opts.platform ?? inferPlatformFromViteOutDir$1(resolvedConfig?.build?.outDir);
|
|
4722
4732
|
const generatorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions(opts.generator, {
|
|
4723
4733
|
appType: opts.appType,
|
|
@@ -5262,8 +5272,9 @@ function createGenerateBundleHook(context) {
|
|
|
5262
5272
|
if (!hasUsableRememberedTailwindSource) {
|
|
5263
5273
|
const configuredTailwindV4CssSourceEntries = getConfiguredTailwindV4CssSourceEntries();
|
|
5264
5274
|
const isCurrentRootMiniProgramStyleOutput = opts.cssMatcher(outputFile) && isMiniProgramStyleOutputFile(outputFile) && !require_source_candidate_scan_signature.normalizeOutputPathKey(outputFile.replace(/[?#].*$/, "")).includes("/");
|
|
5265
|
-
|
|
5266
|
-
|
|
5275
|
+
const configuredEntriesForCurrentRootMiniProgramStyle = isCurrentRootMiniProgramStyleOutput && !hasTailwindGenerationSource(rawSource) ? configuredTailwindV4CssSourceEntries.filter((entry) => hasTailwindPluginDirective(entry.source)) : configuredTailwindV4CssSourceEntries;
|
|
5276
|
+
if (isCurrentRootMiniProgramStyleOutput && (hasTailwindGenerationSource(rawSource) || configuredEntriesForCurrentRootMiniProgramStyle.length > 0)) {
|
|
5277
|
+
const configuredGenerationSource = selectTailwindV4GenerationCssSourceForOutput(outputFile, configuredEntriesForCurrentRootMiniProgramStyle, rawSource, {
|
|
5267
5278
|
cwd: opts.tailwindcssBasedir,
|
|
5268
5279
|
outputRoot: outDir,
|
|
5269
5280
|
projectRoot: sourceRoot ?? rootDir
|
|
@@ -5507,7 +5518,7 @@ function createGenerateBundleHook(context) {
|
|
|
5507
5518
|
const runTransform = async () => {
|
|
5508
5519
|
const start = performance.now();
|
|
5509
5520
|
await runtimeState.readyPromise;
|
|
5510
|
-
const previousCss = !vitePipelineCssAsset && useIncrementalMode && !hasRuntimeAffectingChanges && !snapshot.changedByType.css.has(file) ? getLastCssResult(lastCssResultByFile, outputFile, file) : void 0;
|
|
5521
|
+
const previousCss = !vitePipelineCssAsset && useIncrementalMode && !generatorCandidatesChanged && !hasRuntimeAffectingChanges && !snapshot.changedByType.css.has(file) ? getLastCssResult(lastCssResultByFile, outputFile, file) : void 0;
|
|
5511
5522
|
const generatorTransformRawSource = generatorRawSource;
|
|
5512
5523
|
const previousGeneratorCss = previousCss && !isWebGeneratorTarget ? normalizeMiniProgramGeneratorRawSource(previousCss, outputFile) : previousCss;
|
|
5513
5524
|
const generated = hasTailwindGenerationSource(generatorTransformRawSource) || require_source_candidate_scan_signature.hasBundlerGeneratedCssMarker(rawSource) ? await require_source_candidate_scan_signature.generateTailwindV4Css({
|
|
@@ -5529,7 +5540,8 @@ function createGenerateBundleHook(context) {
|
|
|
5529
5540
|
...usesConfiguredTailwindV4FallbackSource ? { restoreLocalCssImports: false } : {}
|
|
5530
5541
|
}) : void 0;
|
|
5531
5542
|
if (generated) {
|
|
5532
|
-
const
|
|
5543
|
+
const outputCss = transformWebTargetCss(generated.css);
|
|
5544
|
+
const tracedCss = removeRootCoveredCssFromScopedAsset(annotateCss(outputCss));
|
|
5533
5545
|
registerGeneratorDependencies$1({ addWatchFile }, generated.dependencies);
|
|
5534
5546
|
if (envFlags.debugCssDiff) debug("css diff %s: %s", generatorSourceFile, require_source_candidate_scan_signature.summarizeStringDiff(generatorRawSource, tracedCss));
|
|
5535
5547
|
debug("css generated result: %s bytes=%d", file, tracedCss.length);
|
|
@@ -5788,7 +5800,7 @@ function createViteCssFinalizerOutputPlugin(context) {
|
|
|
5788
5800
|
async handler(_options, bundle) {
|
|
5789
5801
|
const { opts, runtimeState, ensureRuntimeClassSet, cssPipelineStrategy, isCssAssetProcessed, markCssAssetProcessed, debug, getResolvedConfig, recordCssAssetResult, recordViteProcessedCssAssetResult, getViteProcessedCssAssetResults, getRecordedGeneratorCandidates, getSourceCandidates, getSourceCandidatesForEntries, getSourceCandidateSourcesForEntries, waitForSourceCandidateSyncs, rememberMainCssSource, getRememberedMainCssSource, isViteProcessedCssAsset } = context;
|
|
5790
5802
|
const resolvedConfig = getResolvedConfig();
|
|
5791
|
-
const uniUtsPlatform =
|
|
5803
|
+
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
5792
5804
|
const generatorPlatform = opts.cssOptions?.platform ?? opts.platform ?? inferPlatformFromViteOutDir(resolvedConfig?.build?.outDir);
|
|
5793
5805
|
const generatorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions(opts.generator, {
|
|
5794
5806
|
appType: opts.appType,
|
|
@@ -6289,7 +6301,8 @@ function resolveHotTailwindCssModules(ctx, tailwindRootCssModuleIds) {
|
|
|
6289
6301
|
};
|
|
6290
6302
|
const collectModule = (mod) => {
|
|
6291
6303
|
if (mod == null || seenModules.has(mod)) return;
|
|
6292
|
-
|
|
6304
|
+
const modId = mod.id ?? mod.url;
|
|
6305
|
+
if (!isHotSourceStyleModule(modId)) return;
|
|
6293
6306
|
seenModules.add(mod);
|
|
6294
6307
|
ctx.server.moduleGraph.invalidateModule(mod);
|
|
6295
6308
|
modules.push(mod);
|
|
@@ -6357,7 +6370,7 @@ function includesHotModule(modules, target) {
|
|
|
6357
6370
|
});
|
|
6358
6371
|
}
|
|
6359
6372
|
function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
6360
|
-
|
|
6373
|
+
return {
|
|
6361
6374
|
type: "js-update",
|
|
6362
6375
|
timestamp,
|
|
6363
6376
|
path: hotUrl,
|
|
@@ -6365,12 +6378,6 @@ function createSupplementalHotUpdate(hotUrl, timestamp) {
|
|
|
6365
6378
|
explicitImportRequired: false,
|
|
6366
6379
|
isWithinCircularImport: false
|
|
6367
6380
|
};
|
|
6368
|
-
return {
|
|
6369
|
-
type: "css-update",
|
|
6370
|
-
timestamp,
|
|
6371
|
-
path: hotUrl,
|
|
6372
|
-
acceptedPath: hotUrl
|
|
6373
|
-
};
|
|
6374
6381
|
}
|
|
6375
6382
|
function hasSelfAcceptingNonStyleHotModule(modules) {
|
|
6376
6383
|
return modules.some((mod) => {
|
|
@@ -6624,8 +6631,9 @@ function createViteRuntimeClassSet(options) {
|
|
|
6624
6631
|
}
|
|
6625
6632
|
async function refreshRuntimeState(force) {
|
|
6626
6633
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
6634
|
+
const shouldRefresh = force || invalidation.changed;
|
|
6627
6635
|
const refreshed = await require_context.refreshTailwindRuntimeState(runtimeState, {
|
|
6628
|
-
force:
|
|
6636
|
+
force: shouldRefresh,
|
|
6629
6637
|
clearCache: force || invalidation.changed
|
|
6630
6638
|
});
|
|
6631
6639
|
if (invalidation.changed) debug("runtime signature changed, refresh triggered. signature: %s", invalidation.signature);
|
|
@@ -6838,7 +6846,7 @@ function resolveImplicitTailwindcssBasedirFromViteRoot(root) {
|
|
|
6838
6846
|
}
|
|
6839
6847
|
//#endregion
|
|
6840
6848
|
//#region src/bundlers/vite/shared/create-framework-plugins.ts
|
|
6841
|
-
const debug =
|
|
6849
|
+
const debug = require_wxml.createDebug();
|
|
6842
6850
|
const weappTailwindcssPackageDir = require_source_candidate_scan_signature.resolvePackageDir("weapp-tailwindcss");
|
|
6843
6851
|
const weappTailwindcssDirPosix = require_source_candidate_scan_signature.slash(weappTailwindcssPackageDir);
|
|
6844
6852
|
const SOURCE_CANDIDATE_SCAN_CACHE_MAX = 8;
|
|
@@ -7031,11 +7039,12 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7031
7039
|
if (autoCssSourceContent.get(sourceFile) === sourceCss) continue;
|
|
7032
7040
|
autoCssSourceContent.set(sourceFile, sourceCss);
|
|
7033
7041
|
await syncTailwindCssSourceCandidates(sourceFile, sourceCss);
|
|
7042
|
+
const resolved = await require_tailwindcss.resolveTailwindV4EntriesFromCssCached(sourceCss, sourceBase);
|
|
7034
7043
|
changed = require_generator.upsertTailwindV4CssSource(opts, {
|
|
7035
7044
|
file: sourceFile,
|
|
7036
7045
|
base: sourceBase,
|
|
7037
7046
|
css: sourceCss,
|
|
7038
|
-
dependencies:
|
|
7047
|
+
dependencies: resolved?.dependencies ?? []
|
|
7039
7048
|
}) || changed;
|
|
7040
7049
|
}
|
|
7041
7050
|
if (!changed) return;
|
|
@@ -7348,9 +7357,10 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7348
7357
|
const recordViteProcessedCssAssetResult = (file, css, options = {}) => {
|
|
7349
7358
|
const key = normalizeVitePersistentCacheKey(file);
|
|
7350
7359
|
const previous = viteProcessedCssAssetResults.get(key);
|
|
7360
|
+
const injectIntoMain = previous?.injectIntoMain === true ? true : options.injectIntoMain ?? previous?.injectIntoMain;
|
|
7351
7361
|
touchMapEntry(viteProcessedCssAssetResults, key, {
|
|
7352
7362
|
css,
|
|
7353
|
-
injectIntoMain
|
|
7363
|
+
injectIntoMain,
|
|
7354
7364
|
outputFile: options.outputFile ?? previous?.outputFile
|
|
7355
7365
|
});
|
|
7356
7366
|
};
|
|
@@ -7449,7 +7459,7 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7449
7459
|
const fullRuntime = getSourceCandidates() ?? getRecordedGeneratorCandidates() ?? await ensureRuntimeClassSet();
|
|
7450
7460
|
const pendingHmrChange = resolvePendingHmrCandidateChange(generatorCode, file);
|
|
7451
7461
|
const forceFullHmrCssRegeneration = pendingFullHmrCssRegeneration || resolvedConfig?.command === "serve" && pendingHmrCandidateChange !== void 0 && pendingHmrChange === void 0;
|
|
7452
|
-
const runtime =
|
|
7462
|
+
const runtime = fullRuntime;
|
|
7453
7463
|
if (pendingHmrChange && currentGeneratorOptions.target === "weapp" && require_generator.filterUnsupportedMiniProgramTailwindV4Candidates(pendingHmrChange.addedCandidates).size === 0) {
|
|
7454
7464
|
const previousTracedCss = tracedGeneratedCssByFile.get(file);
|
|
7455
7465
|
if (previousTracedCss !== void 0) {
|
|
@@ -7473,8 +7483,6 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7473
7483
|
cssHandlerOptions,
|
|
7474
7484
|
generatorCode: generatorTransformCode
|
|
7475
7485
|
}) ?? true);
|
|
7476
|
-
const previousCss = pendingHmrChange && !forceFullHmrCssRegeneration ? cleanGeneratedCssByFile.get(file) : void 0;
|
|
7477
|
-
const previousGeneratorCss = previousCss && !currentGeneratorBranch.isWeb ? require_hmr_timing.normalizeMiniProgramGeneratorCssSource(previousCss, outputFile) : previousCss;
|
|
7478
7486
|
const generated = await hmrTimingRecorder.measure("generateCss.serve", () => require_source_candidate_scan_signature.generateTailwindV4Css({
|
|
7479
7487
|
opts,
|
|
7480
7488
|
runtimeState,
|
|
@@ -7489,10 +7497,8 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7489
7497
|
generatorPlatform: resolveGeneratorPlatform(),
|
|
7490
7498
|
styleHandler,
|
|
7491
7499
|
debug,
|
|
7492
|
-
previousCss: previousGeneratorCss,
|
|
7493
|
-
previousClassSet: pendingHmrChange && !forceFullHmrCssRegeneration ? generatedClassSetByFile.get(file) : void 0,
|
|
7494
7500
|
deferEmptyScopedCssSource: shouldDeferEmptyScopedCssSource,
|
|
7495
|
-
disableSourceScan:
|
|
7501
|
+
disableSourceScan: false,
|
|
7496
7502
|
restoreLocalCssImports: !currentGeneratorBranch.isWeb
|
|
7497
7503
|
}), {
|
|
7498
7504
|
file,
|
|
@@ -8032,7 +8038,7 @@ function withUniAppXWebPreflightReset(css, enabled) {
|
|
|
8032
8038
|
//#endregion
|
|
8033
8039
|
//#region src/bundlers/vite/uni-app-x-css-options.ts
|
|
8034
8040
|
function resolveUniAppXNativeCssHandlerOptions(opts) {
|
|
8035
|
-
const uniUtsPlatform =
|
|
8041
|
+
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
8036
8042
|
if (!require_generator.shouldUseNativeAppCssBranch(require_generator.resolveGeneratorRuntimeBranch(require_generator.normalizeWeappTailwindcssGeneratorOptions(opts.generator, {
|
|
8037
8043
|
appType: opts.appType,
|
|
8038
8044
|
platform: opts.cssOptions?.platform ?? opts.platform,
|
|
@@ -8053,10 +8059,10 @@ function resolveUniAppXNativeCssHandlerOptions(opts) {
|
|
|
8053
8059
|
//#endregion
|
|
8054
8060
|
//#region src/bundlers/vite/frameworks/uni-app-x/index.ts
|
|
8055
8061
|
function isUniAppXNativeAppStyleTarget() {
|
|
8056
|
-
return
|
|
8062
|
+
return require_generator.resolveUniUtsPlatform().isApp;
|
|
8057
8063
|
}
|
|
8058
8064
|
function isUniAppXHarmonyAppStyleTarget(context) {
|
|
8059
|
-
const uniUtsPlatform =
|
|
8065
|
+
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
8060
8066
|
const canInferHarmonyAppStyleTarget = !uniUtsPlatform.normalized || uniUtsPlatform.isApp;
|
|
8061
8067
|
return uniUtsPlatform.isAppHarmony || canInferHarmonyAppStyleTarget && (context.bundle != null && isUniAppXHarmonyBundle(context.bundle) || isUniAppXHarmonyOutDir(context.resolvedConfig?.build?.outDir));
|
|
8062
8068
|
}
|
|
@@ -8089,7 +8095,7 @@ function createUniAppXVitePlugins(options = {}) {
|
|
|
8089
8095
|
return createViteFrameworkPlugins(options, {
|
|
8090
8096
|
frameworkName: "uni-app-x",
|
|
8091
8097
|
cssPipelineStrategy: uniAppXCssPipelineStrategy,
|
|
8092
|
-
getExtraPluginPlatform: () => ({ isIosPlatform:
|
|
8098
|
+
getExtraPluginPlatform: () => ({ isIosPlatform: require_generator.resolveUniUtsPlatform().isAppIos }),
|
|
8093
8099
|
styleInjectorDelegate: require_source_candidate_scan_signature.viteStyleInjectorDelegates.uniApp,
|
|
8094
8100
|
isRuntimeClassSetFeatureEnabled: () => true,
|
|
8095
8101
|
createExtraPlugins: (context) => createUniAppXPlugins({
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vite = require("./vite-
|
|
2
|
+
const require_vite = require("./vite-VGfkFQkC.js");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-DF1gE6a5.mjs";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -7086,7 +7086,8 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
7086
7086
|
return false;
|
|
7087
7087
|
};
|
|
7088
7088
|
const resolvesMemberExpressionToIgnore = (path, seen) => {
|
|
7089
|
-
|
|
7089
|
+
const propertyPath = path.get("property");
|
|
7090
|
+
if (propertyMatches(propertyPath)) return true;
|
|
7090
7091
|
const objectPath = path.get("object");
|
|
7091
7092
|
if (objectPath.isIdentifier()) {
|
|
7092
7093
|
const binding = (objectPath?.scope)?.getBinding?.(objectPath.node.name);
|
|
@@ -7153,7 +7154,10 @@ function createTaggedTemplateIgnore({ matcher, names }) {
|
|
|
7153
7154
|
return current;
|
|
7154
7155
|
};
|
|
7155
7156
|
const evaluateTagPath = (tagPath, seen) => {
|
|
7156
|
-
if (tagPath.isCallExpression?.() || tagPath.node.type === "CallExpression")
|
|
7157
|
+
if (tagPath.isCallExpression?.() || tagPath.node.type === "CallExpression") {
|
|
7158
|
+
const calleePath = tagPath.get("callee");
|
|
7159
|
+
return evaluateTagPath(calleePath, seen);
|
|
7160
|
+
}
|
|
7157
7161
|
if (tagPath.isIdentifier()) {
|
|
7158
7162
|
if (matchesIgnoreName(tagPath.node.name)) return true;
|
|
7159
7163
|
const binding = tagPath?.scope?.getBinding?.(tagPath.node.name);
|