weapp-tailwindcss 5.1.11 → 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-oI2ReOic.mjs → vite-DF1gE6a5.mjs} +35 -23
- package/dist/{vite-DODC15Fr.js → vite-VGfkFQkC.js} +50 -38
- 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 +3 -3
- 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);
|
|
@@ -6612,8 +6625,9 @@ function createViteRuntimeClassSet(options) {
|
|
|
6612
6625
|
}
|
|
6613
6626
|
async function refreshRuntimeState(force) {
|
|
6614
6627
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
6628
|
+
const shouldRefresh = force || invalidation.changed;
|
|
6615
6629
|
const refreshed = await refreshTailwindRuntimeState(runtimeState, {
|
|
6616
|
-
force:
|
|
6630
|
+
force: shouldRefresh,
|
|
6617
6631
|
clearCache: force || invalidation.changed
|
|
6618
6632
|
});
|
|
6619
6633
|
if (invalidation.changed) debug("runtime signature changed, refresh triggered. signature: %s", invalidation.signature);
|
|
@@ -7019,11 +7033,12 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7019
7033
|
if (autoCssSourceContent.get(sourceFile) === sourceCss) continue;
|
|
7020
7034
|
autoCssSourceContent.set(sourceFile, sourceCss);
|
|
7021
7035
|
await syncTailwindCssSourceCandidates(sourceFile, sourceCss);
|
|
7036
|
+
const resolved = await resolveTailwindV4EntriesFromCssCached(sourceCss, sourceBase);
|
|
7022
7037
|
changed = upsertTailwindV4CssSource(opts, {
|
|
7023
7038
|
file: sourceFile,
|
|
7024
7039
|
base: sourceBase,
|
|
7025
7040
|
css: sourceCss,
|
|
7026
|
-
dependencies:
|
|
7041
|
+
dependencies: resolved?.dependencies ?? []
|
|
7027
7042
|
}) || changed;
|
|
7028
7043
|
}
|
|
7029
7044
|
if (!changed) return;
|
|
@@ -7336,9 +7351,10 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7336
7351
|
const recordViteProcessedCssAssetResult = (file, css, options = {}) => {
|
|
7337
7352
|
const key = normalizeVitePersistentCacheKey(file);
|
|
7338
7353
|
const previous = viteProcessedCssAssetResults.get(key);
|
|
7354
|
+
const injectIntoMain = previous?.injectIntoMain === true ? true : options.injectIntoMain ?? previous?.injectIntoMain;
|
|
7339
7355
|
touchMapEntry(viteProcessedCssAssetResults, key, {
|
|
7340
7356
|
css,
|
|
7341
|
-
injectIntoMain
|
|
7357
|
+
injectIntoMain,
|
|
7342
7358
|
outputFile: options.outputFile ?? previous?.outputFile
|
|
7343
7359
|
});
|
|
7344
7360
|
};
|
|
@@ -7437,7 +7453,7 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7437
7453
|
const fullRuntime = getSourceCandidates() ?? getRecordedGeneratorCandidates() ?? await ensureRuntimeClassSet();
|
|
7438
7454
|
const pendingHmrChange = resolvePendingHmrCandidateChange(generatorCode, file);
|
|
7439
7455
|
const forceFullHmrCssRegeneration = pendingFullHmrCssRegeneration || resolvedConfig?.command === "serve" && pendingHmrCandidateChange !== void 0 && pendingHmrChange === void 0;
|
|
7440
|
-
const runtime =
|
|
7456
|
+
const runtime = fullRuntime;
|
|
7441
7457
|
if (pendingHmrChange && currentGeneratorOptions.target === "weapp" && filterUnsupportedMiniProgramTailwindV4Candidates(pendingHmrChange.addedCandidates).size === 0) {
|
|
7442
7458
|
const previousTracedCss = tracedGeneratedCssByFile.get(file);
|
|
7443
7459
|
if (previousTracedCss !== void 0) {
|
|
@@ -7461,8 +7477,6 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7461
7477
|
cssHandlerOptions,
|
|
7462
7478
|
generatorCode: generatorTransformCode
|
|
7463
7479
|
}) ?? true);
|
|
7464
|
-
const previousCss = pendingHmrChange && !forceFullHmrCssRegeneration ? cleanGeneratedCssByFile.get(file) : void 0;
|
|
7465
|
-
const previousGeneratorCss = previousCss && !currentGeneratorBranch.isWeb ? normalizeMiniProgramGeneratorCssSource(previousCss, outputFile) : previousCss;
|
|
7466
7480
|
const generated = await hmrTimingRecorder.measure("generateCss.serve", () => generateTailwindV4Css({
|
|
7467
7481
|
opts,
|
|
7468
7482
|
runtimeState,
|
|
@@ -7477,10 +7491,8 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7477
7491
|
generatorPlatform: resolveGeneratorPlatform(),
|
|
7478
7492
|
styleHandler,
|
|
7479
7493
|
debug,
|
|
7480
|
-
previousCss: previousGeneratorCss,
|
|
7481
|
-
previousClassSet: pendingHmrChange && !forceFullHmrCssRegeneration ? generatedClassSetByFile.get(file) : void 0,
|
|
7482
7494
|
deferEmptyScopedCssSource: shouldDeferEmptyScopedCssSource,
|
|
7483
|
-
disableSourceScan:
|
|
7495
|
+
disableSourceScan: false,
|
|
7484
7496
|
restoreLocalCssImports: !currentGeneratorBranch.isWeb
|
|
7485
7497
|
}), {
|
|
7486
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);
|
|
@@ -6618,8 +6631,9 @@ function createViteRuntimeClassSet(options) {
|
|
|
6618
6631
|
}
|
|
6619
6632
|
async function refreshRuntimeState(force) {
|
|
6620
6633
|
const invalidation = resolveRuntimeRefreshOptions();
|
|
6634
|
+
const shouldRefresh = force || invalidation.changed;
|
|
6621
6635
|
const refreshed = await require_context.refreshTailwindRuntimeState(runtimeState, {
|
|
6622
|
-
force:
|
|
6636
|
+
force: shouldRefresh,
|
|
6623
6637
|
clearCache: force || invalidation.changed
|
|
6624
6638
|
});
|
|
6625
6639
|
if (invalidation.changed) debug("runtime signature changed, refresh triggered. signature: %s", invalidation.signature);
|
|
@@ -6832,7 +6846,7 @@ function resolveImplicitTailwindcssBasedirFromViteRoot(root) {
|
|
|
6832
6846
|
}
|
|
6833
6847
|
//#endregion
|
|
6834
6848
|
//#region src/bundlers/vite/shared/create-framework-plugins.ts
|
|
6835
|
-
const debug =
|
|
6849
|
+
const debug = require_wxml.createDebug();
|
|
6836
6850
|
const weappTailwindcssPackageDir = require_source_candidate_scan_signature.resolvePackageDir("weapp-tailwindcss");
|
|
6837
6851
|
const weappTailwindcssDirPosix = require_source_candidate_scan_signature.slash(weappTailwindcssPackageDir);
|
|
6838
6852
|
const SOURCE_CANDIDATE_SCAN_CACHE_MAX = 8;
|
|
@@ -7025,11 +7039,12 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7025
7039
|
if (autoCssSourceContent.get(sourceFile) === sourceCss) continue;
|
|
7026
7040
|
autoCssSourceContent.set(sourceFile, sourceCss);
|
|
7027
7041
|
await syncTailwindCssSourceCandidates(sourceFile, sourceCss);
|
|
7042
|
+
const resolved = await require_tailwindcss.resolveTailwindV4EntriesFromCssCached(sourceCss, sourceBase);
|
|
7028
7043
|
changed = require_generator.upsertTailwindV4CssSource(opts, {
|
|
7029
7044
|
file: sourceFile,
|
|
7030
7045
|
base: sourceBase,
|
|
7031
7046
|
css: sourceCss,
|
|
7032
|
-
dependencies:
|
|
7047
|
+
dependencies: resolved?.dependencies ?? []
|
|
7033
7048
|
}) || changed;
|
|
7034
7049
|
}
|
|
7035
7050
|
if (!changed) return;
|
|
@@ -7342,9 +7357,10 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7342
7357
|
const recordViteProcessedCssAssetResult = (file, css, options = {}) => {
|
|
7343
7358
|
const key = normalizeVitePersistentCacheKey(file);
|
|
7344
7359
|
const previous = viteProcessedCssAssetResults.get(key);
|
|
7360
|
+
const injectIntoMain = previous?.injectIntoMain === true ? true : options.injectIntoMain ?? previous?.injectIntoMain;
|
|
7345
7361
|
touchMapEntry(viteProcessedCssAssetResults, key, {
|
|
7346
7362
|
css,
|
|
7347
|
-
injectIntoMain
|
|
7363
|
+
injectIntoMain,
|
|
7348
7364
|
outputFile: options.outputFile ?? previous?.outputFile
|
|
7349
7365
|
});
|
|
7350
7366
|
};
|
|
@@ -7443,7 +7459,7 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7443
7459
|
const fullRuntime = getSourceCandidates() ?? getRecordedGeneratorCandidates() ?? await ensureRuntimeClassSet();
|
|
7444
7460
|
const pendingHmrChange = resolvePendingHmrCandidateChange(generatorCode, file);
|
|
7445
7461
|
const forceFullHmrCssRegeneration = pendingFullHmrCssRegeneration || resolvedConfig?.command === "serve" && pendingHmrCandidateChange !== void 0 && pendingHmrChange === void 0;
|
|
7446
|
-
const runtime =
|
|
7462
|
+
const runtime = fullRuntime;
|
|
7447
7463
|
if (pendingHmrChange && currentGeneratorOptions.target === "weapp" && require_generator.filterUnsupportedMiniProgramTailwindV4Candidates(pendingHmrChange.addedCandidates).size === 0) {
|
|
7448
7464
|
const previousTracedCss = tracedGeneratedCssByFile.get(file);
|
|
7449
7465
|
if (previousTracedCss !== void 0) {
|
|
@@ -7467,8 +7483,6 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7467
7483
|
cssHandlerOptions,
|
|
7468
7484
|
generatorCode: generatorTransformCode
|
|
7469
7485
|
}) ?? true);
|
|
7470
|
-
const previousCss = pendingHmrChange && !forceFullHmrCssRegeneration ? cleanGeneratedCssByFile.get(file) : void 0;
|
|
7471
|
-
const previousGeneratorCss = previousCss && !currentGeneratorBranch.isWeb ? require_hmr_timing.normalizeMiniProgramGeneratorCssSource(previousCss, outputFile) : previousCss;
|
|
7472
7486
|
const generated = await hmrTimingRecorder.measure("generateCss.serve", () => require_source_candidate_scan_signature.generateTailwindV4Css({
|
|
7473
7487
|
opts,
|
|
7474
7488
|
runtimeState,
|
|
@@ -7483,10 +7497,8 @@ function createViteFrameworkPlugins(options = {}, frameworkBranch) {
|
|
|
7483
7497
|
generatorPlatform: resolveGeneratorPlatform(),
|
|
7484
7498
|
styleHandler,
|
|
7485
7499
|
debug,
|
|
7486
|
-
previousCss: previousGeneratorCss,
|
|
7487
|
-
previousClassSet: pendingHmrChange && !forceFullHmrCssRegeneration ? generatedClassSetByFile.get(file) : void 0,
|
|
7488
7500
|
deferEmptyScopedCssSource: shouldDeferEmptyScopedCssSource,
|
|
7489
|
-
disableSourceScan:
|
|
7501
|
+
disableSourceScan: false,
|
|
7490
7502
|
restoreLocalCssImports: !currentGeneratorBranch.isWeb
|
|
7491
7503
|
}), {
|
|
7492
7504
|
file,
|
|
@@ -8026,7 +8038,7 @@ function withUniAppXWebPreflightReset(css, enabled) {
|
|
|
8026
8038
|
//#endregion
|
|
8027
8039
|
//#region src/bundlers/vite/uni-app-x-css-options.ts
|
|
8028
8040
|
function resolveUniAppXNativeCssHandlerOptions(opts) {
|
|
8029
|
-
const uniUtsPlatform =
|
|
8041
|
+
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
8030
8042
|
if (!require_generator.shouldUseNativeAppCssBranch(require_generator.resolveGeneratorRuntimeBranch(require_generator.normalizeWeappTailwindcssGeneratorOptions(opts.generator, {
|
|
8031
8043
|
appType: opts.appType,
|
|
8032
8044
|
platform: opts.cssOptions?.platform ?? opts.platform,
|
|
@@ -8047,10 +8059,10 @@ function resolveUniAppXNativeCssHandlerOptions(opts) {
|
|
|
8047
8059
|
//#endregion
|
|
8048
8060
|
//#region src/bundlers/vite/frameworks/uni-app-x/index.ts
|
|
8049
8061
|
function isUniAppXNativeAppStyleTarget() {
|
|
8050
|
-
return
|
|
8062
|
+
return require_generator.resolveUniUtsPlatform().isApp;
|
|
8051
8063
|
}
|
|
8052
8064
|
function isUniAppXHarmonyAppStyleTarget(context) {
|
|
8053
|
-
const uniUtsPlatform =
|
|
8065
|
+
const uniUtsPlatform = require_generator.resolveUniUtsPlatform();
|
|
8054
8066
|
const canInferHarmonyAppStyleTarget = !uniUtsPlatform.normalized || uniUtsPlatform.isApp;
|
|
8055
8067
|
return uniUtsPlatform.isAppHarmony || canInferHarmonyAppStyleTarget && (context.bundle != null && isUniAppXHarmonyBundle(context.bundle) || isUniAppXHarmonyOutDir(context.resolvedConfig?.build?.outDir));
|
|
8056
8068
|
}
|
|
@@ -8083,7 +8095,7 @@ function createUniAppXVitePlugins(options = {}) {
|
|
|
8083
8095
|
return createViteFrameworkPlugins(options, {
|
|
8084
8096
|
frameworkName: "uni-app-x",
|
|
8085
8097
|
cssPipelineStrategy: uniAppXCssPipelineStrategy,
|
|
8086
|
-
getExtraPluginPlatform: () => ({ isIosPlatform:
|
|
8098
|
+
getExtraPluginPlatform: () => ({ isIosPlatform: require_generator.resolveUniUtsPlatform().isAppIos }),
|
|
8087
8099
|
styleInjectorDelegate: require_source_candidate_scan_signature.viteStyleInjectorDelegates.uniApp,
|
|
8088
8100
|
isRuntimeClassSetFeatureEnabled: () => true,
|
|
8089
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);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { B as stripUnmatchedTailwindSourceMediaCloseFragments, E as resolveTailwindcssOptions, F as removeTailwindV4GeneratedUserCssArtifacts, H as finalizeMiniProgramCss, I as removeTailwindV4GeneratorAtRules, J as hasTailwindApplyDirective, K as stripMiniProgramCssSpecificityPlaceholders, M as isCommentOnlyCss, P as removeMiniProgramHoverSelectors, Q as normalizeTailwindConfigDirectives, W as pruneMiniProgramGeneratedCss, X as hasTailwindRootDirectives, Z as hasTailwindSourceDirectives, ct as hasTailwindGeneratedCssMarkers, g as upsertTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveSourceScanPath, nt as removeTailwindSourceDirectives, o as resolveRuntimeBranch, st as hasTailwindGeneratedCss, tt as parseImportRequest, vt as getTailwindV4IncrementalGenerateCacheStats, z as stripTailwindSourceMediaFragments } from "./generator-BvPcmqxU.mjs";
|
|
2
|
+
import { g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature, p as resolveViteSourceScanEntries } from "./tailwindcss-DZT_pWrd.mjs";
|
|
3
|
+
import { r as getGroupedEntries } from "./utils-MVwpU07P.mjs";
|
|
4
|
+
import { b as md5Hash, c as _defineProperty, y as createDebug } from "./wxml-DdGdeqaH.mjs";
|
|
5
|
+
import { d as refreshTailwindRuntimeState, i as pluginName, l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, r as resolveStyleOptionsFromContext, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-xSJE588m.mjs";
|
|
6
|
+
import { getDefaultCssPreflight } from "./defaults.mjs";
|
|
7
|
+
import { A as processCachedTask, C as removeGeneratedSelectorCompatCss, D as createCssSourceTraceCacheSignature, E as annotateCssSourceTrace, O as createCssTokenSourceMap, S as scoreTailwindV4CssSourceFileMatch, T as hasMiniProgramTailwindV4PreflightReset, a as isSourceCandidateRequest, c as collectStrictEscapedRuntimeCandidates, f as pushConcurrentTaskFactories, i as createSourceCandidateStore, k as isCssSourceTraceEnabled, l as createEscapeFragments, n as emitHmrTiming, o as resolveSourceCandidateScanFiles, p as resolveTaskConcurrency, s as createBundleRuntimeClassSetManager, w as createCssSourceOrderAppend, y as isPureLocalCssImportWrapper } from "./hmr-timing-hRhRAjYV.mjs";
|
|
8
|
+
import { E as stripRequestQuery, F as resolvePluginDisabledState, L as createBuiltinWebpackStyleInjectorPlugin, N as stripBundlerGeneratedCssMarkers, O as resolveOutputSpecifier, P as resolvePackageDir, T as isSourceStyleRequest, V as resolveWebpackFrameworkProfile, a as createCandidateSignature, f as classifyBundleEntry, j as hasBundlerGeneratedCssMarker, k as toAbsoluteOutputPath, m as updateBundleBuildState, p as createBundleBuildState, r as createScopedGeneratorRuntime, t as createSourceCandidateScanSignature, w as generateTailwindV4Css, x as createRuntimeAffectingSourceSignature, z as webpackStyleInjectorDelegates } from "./source-candidate-scan-signature-t4XKAQ04.mjs";
|
|
8
9
|
import Module, { createRequire } from "node:module";
|
|
9
10
|
import fs from "node:fs";
|
|
10
11
|
import path from "node:path";
|
|
@@ -1752,7 +1753,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1752
1753
|
debug("html cache hit: %s", file);
|
|
1753
1754
|
},
|
|
1754
1755
|
transform: async () => {
|
|
1755
|
-
const
|
|
1756
|
+
const wxml = await compilerOptions.templateHandler(readRawSource(), defaultTemplateHandlerOptions);
|
|
1757
|
+
const source = new ConcatSource(wxml);
|
|
1756
1758
|
debug("html handle: %s", file);
|
|
1757
1759
|
return { result: source };
|
|
1758
1760
|
}
|
|
@@ -1891,7 +1893,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1891
1893
|
transform: async () => {
|
|
1892
1894
|
const source = readCurrentProcessedRawSource();
|
|
1893
1895
|
const processedBareSelectorSourceCss = processedSourceCss ?? (hasTailwindGeneratedAssetCss ? removeWebpackTailwindGeneratedAssetCss(source) : void 0);
|
|
1894
|
-
const
|
|
1896
|
+
const handledCss = hasTailwindGeneratedAssetCss && !hasGeneratedCssMarker ? isWebGeneratorTarget ? source : (await compilerOptions.styleHandler(source, cssHandlerOptionsForProcessedAsset)).css : source;
|
|
1897
|
+
const nextCss = stripTrailingLineWhitespace(finalizeCssAssetSource(handledCss, {
|
|
1895
1898
|
cssPreflight: cssHandlerOptionsForProcessedAsset.isMainChunk,
|
|
1896
1899
|
generatedCss: hasGeneratedCssMarker || hasTailwindGeneratedAssetCss
|
|
1897
1900
|
}));
|
|
@@ -2006,18 +2009,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2006
2009
|
const currentAssetMissingUserCss = !(currentAssetUserCssWithoutMarkers.trim().length > 0 && !isCommentOnlyCss(currentAssetUserCssWithoutMarkers)) ? "" : filterExistingCssRules(currentAssetUserCssWithoutMarkers, loaderGeneratedCssWithoutMarkers);
|
|
2007
2010
|
if (isConfiguredMainCssSource && !cssHandlerOptions.isMainChunk) {
|
|
2008
2011
|
debug("css skip duplicate webpack loader main generation: %s <- %s", file, sourceFile);
|
|
2009
|
-
|
|
2012
|
+
const userCss = currentAssetMissingUserCss.trim().length === 0 || isCommentOnlyCss(currentAssetMissingUserCss) ? "" : finalizeCssAssetSource(currentAssetMissingUserCss, {
|
|
2010
2013
|
cssPreflight: false,
|
|
2011
2014
|
generatedCss: false
|
|
2012
|
-
})
|
|
2015
|
+
});
|
|
2016
|
+
return { result: new ConcatSource(finalizeTracedCss(userCss, cssHandlerOptions)) };
|
|
2013
2017
|
}
|
|
2014
|
-
const
|
|
2018
|
+
const mergedLoaderCss = currentAssetUserCss === void 0 ? loaderGeneratedCss.css : createWebpackGeneratorUserCssSourceAppend({
|
|
2015
2019
|
css: currentAssetUserCss === void 0 ? loaderGeneratedCss.css : currentAssetHasProcessedUrl ? removeGeneratedSelectorCompatCss(loaderGeneratedCss.css, currentAssetUserCss) : filterExistingCssRules(currentAssetUserCss, loaderGeneratedCss.css),
|
|
2016
2020
|
processed: true
|
|
2017
2021
|
}, currentAssetUserCss === void 0 ? void 0 : {
|
|
2018
2022
|
css: currentAssetUserCss,
|
|
2019
2023
|
processed: true
|
|
2020
|
-
}).css
|
|
2024
|
+
}).css;
|
|
2025
|
+
const finalizedLoaderCss = finalizeCssAssetSource(mergedLoaderCss, {
|
|
2021
2026
|
cssPreflight: cssHandlerOptions.isMainChunk,
|
|
2022
2027
|
generatedCss: true,
|
|
2023
2028
|
preserveExistingPreflight: shouldPreserveExistingPreflight
|
|
@@ -2174,13 +2179,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2174
2179
|
generatedCss: false
|
|
2175
2180
|
});
|
|
2176
2181
|
const missingSourceBareUserCss = finalizedSourceBareUserCss.trim().length === 0 ? "" : filterExistingCssRules(finalizedGeneratedCss, finalizedSourceBareUserCss);
|
|
2177
|
-
const
|
|
2182
|
+
const css = finalizeTracedCss(missingSourceBareUserCss.trim().length === 0 ? finalizedGeneratedCss : createWebpackGeneratorUserCssSourceAppend({
|
|
2178
2183
|
css: finalizedGeneratedCss,
|
|
2179
2184
|
processed: true
|
|
2180
2185
|
}, {
|
|
2181
2186
|
css: missingSourceBareUserCss,
|
|
2182
2187
|
processed: true
|
|
2183
|
-
}).css, cssHandlerOptions, { finalized: true })
|
|
2188
|
+
}).css, cssHandlerOptions, { finalized: true });
|
|
2189
|
+
const source = new ConcatSource(css);
|
|
2184
2190
|
if (generated) {
|
|
2185
2191
|
for (const className of generated.classSet) generatorRuntimeSet.add(className);
|
|
2186
2192
|
debug("css handle via tailwind v%s engine(%s): %s", runtimeState.tailwindRuntime.majorVersion, generated.target, file);
|
|
@@ -2244,7 +2250,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2244
2250
|
});
|
|
2245
2251
|
}
|
|
2246
2252
|
//#endregion
|
|
2247
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
2253
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.4_oxc-resolver@11.20.0_tsx@4.23.0_typescript@6.0.3_unrun@0.2.37_synckit@0.1_ef728048c31c93ef751206e871d1f97d/node_modules/tsdown/esm-shims.js
|
|
2248
2254
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
2249
2255
|
const getDirname = () => path.dirname(getFilename());
|
|
2250
2256
|
const __dirname = /* @__PURE__ */ getDirname();
|