weapp-tailwindcss 5.2.8 → 5.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +4 -1
- package/dist/bundlers/vite/generate-bundle/types.d.ts +6 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-hmr-candidate-state.d.ts +3 -2
- package/dist/bundlers/vite/shared/framework-hmr-runtime-signature.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{transform-DVGsr8cV.js → transform-DhDe9eSf.js} +107 -8
- package/dist/{transform-DzVJW6Dp.cjs → transform-GzbxfNGA.cjs} +106 -7
- package/dist/uni-app-x/component-local-style-binding.d.ts +6 -0
- package/dist/uni-app-x/component-local-style.d.ts +1 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +2 -0
- package/dist/uni-app-x/vite/style-request.d.ts +12 -0
- package/dist/{vite-BJJqWc_F.js → vite-8l9_S4Qi.js} +181 -48
- package/dist/{vite-V86H6PZa.cjs → vite-Dcx59GRQ.cjs} +181 -48
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/package.json +2 -2
|
@@ -5273,7 +5273,7 @@ function normalizeRootMiniProgramImportShellAssets(bundle, options) {
|
|
|
5273
5273
|
//#endregion
|
|
5274
5274
|
//#region src/bundlers/vite/generate-bundle/finalize/bundle.ts
|
|
5275
5275
|
async function finalizeGenerateBundle(options) {
|
|
5276
|
-
const { activeProcessCacheKeys, activeProcessHashKeys, activeViteCssCacheFiles, bundle, bundleFiles, cache, cssTaskFactories, cssPipelineStrategy, createCssPipelineContext, debug, defaultStyleOutputExtension, formatIteration, generatorCandidateSignature, generatorRuntime, getCssHandlerOptions, getSourceCandidateSourcesForEntries, getSourceCandidatesForEntries, getViteCssCacheStats, getViteProcessedCssAssetResults, hmrTimingRecorder, hmrTimingStartedAt, isHarmonyAppStyleTarget, isNativeAppStyleTarget, isViteProcessedCssAsset, isWebGeneratorTarget, jsAfterCss, jsTaskFactories, lastCssResultByFile, lastCssSourceHashByFile, linkedByEntry, markCssAssetProcessed, metrics, onEnd, onUpdate, opts, outDir, pendingLinkedUpdates, pruneViteCssCaches, recordCssAssetResult, recordTimingDetail, recordViteProcessedCssAssetResult, rootDir, runtime, runtimeState, shouldPreserveAppCssExtension, snapshot, sourceCandidates, sourceRoot, state, styleHandler, tasks, timingDetails, transformRuntime, transformWebTargetCss, useIncrementalMode } = options;
|
|
5276
|
+
const { activeProcessCacheKeys, activeProcessHashKeys, activeViteCssCacheFiles, bundle, bundleFiles, cache, cssTaskFactories, cssPipelineStrategy, createCssPipelineContext, debug, defaultStyleOutputExtension, formatIteration, generatorCandidateSignature, generatorRuntime, getCssHandlerOptions, getSourceCandidateSourcesForEntries, getSourceCandidatesForEntries, getViteCssCacheStats, getViteProcessedCssAssetResults, hmrTimingRecorder, hmrTimingStartedAt, isHarmonyAppStyleTarget, isNativeAppStyleTarget, isViteProcessedCssAsset, isWebGeneratorTarget, jsAfterCss, jsTaskFactories, lastCssResultByFile, lastCssSourceHashByFile, linkedByEntry, markCssAssetProcessed, metrics, onEnd, onUpdate, opts, outDir, pendingLinkedUpdates, pendingRememberedCssReplayUpdates, pruneViteCssCaches, recordCssAssetResult, recordTimingDetail, recordViteProcessedCssAssetResult, rootDir, runtime, runtimeState, shouldPreserveAppCssExtension, snapshot, sourceCandidates, sourceRoot, state, styleHandler, tasks, timingDetails, transformRuntime, transformWebTargetCss, useIncrementalMode } = options;
|
|
5277
5277
|
const tasksStart = performance.now();
|
|
5278
5278
|
if (cssTaskFactories.length > 0) {
|
|
5279
5279
|
const cssTask = require_v4_generation_core.runWithConcurrency(cssTaskFactories, resolveViteCssTaskConcurrency(useIncrementalMode, runtimeState.tailwindRuntime.majorVersion)).then(() => void 0);
|
|
@@ -5319,7 +5319,7 @@ async function finalizeGenerateBundle(options) {
|
|
|
5319
5319
|
});
|
|
5320
5320
|
recordTimingDetail("finalize.processedCss.collect", collectStartedAt);
|
|
5321
5321
|
const injectStartedAt = performance.now();
|
|
5322
|
-
|
|
5322
|
+
let injected = injectViteProcessedCssIntoMainCssAssets(bundle, {
|
|
5323
5323
|
opts,
|
|
5324
5324
|
cssPipelineStrategy,
|
|
5325
5325
|
createCssPipelineContext,
|
|
@@ -5336,6 +5336,26 @@ async function finalizeGenerateBundle(options) {
|
|
|
5336
5336
|
onUpdate,
|
|
5337
5337
|
recordTimingDetail
|
|
5338
5338
|
});
|
|
5339
|
+
if (pendingRememberedCssReplayUpdates.length > 0) {
|
|
5340
|
+
for (const update of pendingRememberedCssReplayUpdates) recordViteProcessedCssAssetResult?.(update.file, update.css, update);
|
|
5341
|
+
injected += injectViteProcessedCssIntoMainCssAssets(bundle, {
|
|
5342
|
+
opts,
|
|
5343
|
+
cssPipelineStrategy,
|
|
5344
|
+
createCssPipelineContext,
|
|
5345
|
+
getViteProcessedCssAssetResults: () => pendingRememberedCssReplayUpdates.map((update) => [update.file, {
|
|
5346
|
+
css: update.css,
|
|
5347
|
+
injectIntoMain: update.injectIntoMain,
|
|
5348
|
+
outputFile: update.outputFile
|
|
5349
|
+
}]),
|
|
5350
|
+
markCssAssetProcessed,
|
|
5351
|
+
recordCssAssetResult,
|
|
5352
|
+
transformCss: transformWebTargetCss,
|
|
5353
|
+
debug,
|
|
5354
|
+
onUpdate,
|
|
5355
|
+
recordTimingDetail
|
|
5356
|
+
});
|
|
5357
|
+
debug("inject remembered css replay updates after framework css collection: %d", pendingRememberedCssReplayUpdates.length);
|
|
5358
|
+
}
|
|
5339
5359
|
recordTimingDetail("finalize.processedCss.inject", injectStartedAt);
|
|
5340
5360
|
return injected;
|
|
5341
5361
|
};
|
|
@@ -6143,11 +6163,22 @@ function resolveUniAppXCssTarget(id) {
|
|
|
6143
6163
|
function isCssModuleExport(code) {
|
|
6144
6164
|
return CSS_MODULE_EXPORT_RE.test(code);
|
|
6145
6165
|
}
|
|
6166
|
+
function resolvePreprocessorTransform(code, id, lang, options) {
|
|
6167
|
+
if (!isPreprocessorRequest(id, lang)) return;
|
|
6168
|
+
if (options.isIosPlatform) {
|
|
6169
|
+
const normalizedCode = (0, _weapp_tailwindcss_postcss.normalizeTailwindcssV4InfinityCalcCss)(code);
|
|
6170
|
+
return { result: normalizedCode === code ? void 0 : {
|
|
6171
|
+
code: normalizedCode,
|
|
6172
|
+
map: null
|
|
6173
|
+
} };
|
|
6174
|
+
}
|
|
6175
|
+
if (options.isWebGeneratorTarget && !options.isNativeAppStyleTarget) return { result: void 0 };
|
|
6176
|
+
}
|
|
6146
6177
|
//#endregion
|
|
6147
6178
|
//#region src/uni-app-x/vite.ts
|
|
6148
6179
|
let transformUVuePromise;
|
|
6149
6180
|
function loadTransformUVue() {
|
|
6150
|
-
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-
|
|
6181
|
+
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-GzbxfNGA.cjs")).then((mod) => mod.transformUVue));
|
|
6151
6182
|
return transformUVuePromise;
|
|
6152
6183
|
}
|
|
6153
6184
|
const UVUE_NVUE_QUERY_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
@@ -6156,7 +6187,7 @@ function resolveUniAppXJsTransformEnabled(uniAppX) {
|
|
|
6156
6187
|
return uniAppX === void 0 ? true : require_options.isUniAppXEnabled(uniAppX);
|
|
6157
6188
|
}
|
|
6158
6189
|
function createUniAppXPlugins(options) {
|
|
6159
|
-
const { appType, customAttributesEntities, disabledDefaultTemplateHandler, isIosPlatform: providedIosPlatform, mainCssChunkMatcher, runtimeState, styleHandler, syncSourceCandidatesForHotUpdate, tailwindRootCssModuleIds = [], generateCss, jsHandler, ensureRuntimeClassSet, getResolvedConfig, isEnabled = () => true, uniAppX, viteProcessedCssSourceFiles = [] } = options;
|
|
6190
|
+
const { appType, customAttributesEntities, disabledDefaultTemplateHandler, isIosPlatform: providedIosPlatform, mainCssChunkMatcher, runtimeState, styleHandler, syncSourceCandidatesForHotUpdate, tailwindRootCssModuleIds = [], generateCss, jsHandler, ensureRuntimeClassSet, getResolvedConfig, isEnabled = () => true, isNativeAppStyleTarget = () => false, isWebGeneratorTarget = () => require_generator.resolveUniUtsPlatform().isWeb, uniAppX, viteProcessedCssSourceFiles = [] } = options;
|
|
6160
6191
|
const resolvedUniAppXOptions = require_options.resolveUniAppXOptions(uniAppX);
|
|
6161
6192
|
const utsPlatform = require_generator.resolveUniUtsPlatform();
|
|
6162
6193
|
const isIosPlatform = providedIosPlatform ?? utsPlatform.isAppIos;
|
|
@@ -6272,14 +6303,12 @@ function createUniAppXPlugins(options) {
|
|
|
6272
6303
|
if (!isEnabled()) return;
|
|
6273
6304
|
await runtimeState.readyPromise;
|
|
6274
6305
|
const { query } = parseVueRequest(id);
|
|
6275
|
-
const
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
};
|
|
6282
|
-
}
|
|
6306
|
+
const preprocessor = resolvePreprocessorTransform(code, id, query.lang, {
|
|
6307
|
+
isIosPlatform,
|
|
6308
|
+
isNativeAppStyleTarget: isNativeAppStyleTarget(),
|
|
6309
|
+
isWebGeneratorTarget: isWebGeneratorTarget()
|
|
6310
|
+
});
|
|
6311
|
+
if (preprocessor) return preprocessor.result;
|
|
6283
6312
|
return transformStyle(code, id, query, this);
|
|
6284
6313
|
}
|
|
6285
6314
|
}];
|
|
@@ -6564,10 +6593,33 @@ function shouldSkipRawRememberedCssSource(rawSource, sourceFile) {
|
|
|
6564
6593
|
const cleanSourceFile = sourceFile.replace(/[?#].*$/, "");
|
|
6565
6594
|
return SOURCE_STYLE_OUTPUT_EXT_RE.test(cleanSourceFile) && !canProcessViteSourceStyleAsCss(rawSource, sourceFile);
|
|
6566
6595
|
}
|
|
6596
|
+
function resolveRememberedCssReplayOutputFile(outputFile, targetByFile) {
|
|
6597
|
+
const outputKey = require_source_candidate_scan_signature.normalizeOutputPathKey(outputFile);
|
|
6598
|
+
for (const [shellFile, targetFile] of targetByFile ?? []) if (require_source_candidate_scan_signature.normalizeOutputPathKey(shellFile) === outputKey) return targetFile;
|
|
6599
|
+
return outputFile;
|
|
6600
|
+
}
|
|
6601
|
+
function createRememberedCssReplayUpdates(css, sourceFile, outputFile, injectIntoMain) {
|
|
6602
|
+
const updates = [{
|
|
6603
|
+
css,
|
|
6604
|
+
file: sourceFile,
|
|
6605
|
+
injectIntoMain,
|
|
6606
|
+
outputFile
|
|
6607
|
+
}];
|
|
6608
|
+
if (outputFile !== sourceFile) updates.push({
|
|
6609
|
+
css,
|
|
6610
|
+
file: outputFile,
|
|
6611
|
+
injectIntoMain,
|
|
6612
|
+
outputFile
|
|
6613
|
+
});
|
|
6614
|
+
return updates;
|
|
6615
|
+
}
|
|
6567
6616
|
async function processRememberedCssReplay(options) {
|
|
6568
|
-
const { addWatchFile, activeViteCssCacheFiles, bundle, bundleFiles, cache, changedCssFiles = /* @__PURE__ */ new Set(), createScopedGeneratorRuntime, createScopedSourceCandidateGetter, createScopedSourceCandidateSourceGetter, cssTaskFactories, cssPipelineContext, cssPipelineStrategy, debug, defaultStyleOutputExtension, emitOrReplayCssAsset, generatorRuntime, generatorPlatform, getCssHandlerOptions, getCssUserHandlerOptions, getRememberedCssSignature, getRememberedCssSources, isNativeAppStyleTarget, isWebGeneratorTarget, lastCssRawSourceHashByFile = /* @__PURE__ */ new Map(), lastCssResultByFile, lastCssSourceHashByFile, markCssAssetProcessed, metrics, normalizeViteCssCacheKey, onUpdate, opts, recordCssAssetResult, recordViteProcessedCssAssetResult, rootDir, runtimeState, setRememberedCssSignature, shouldInjectCssIntoMainFromOutput, shouldPreserveAppCssExtension, sourceRoot, styleHandler, timeTask, useIncrementalMode } = options;
|
|
6617
|
+
const { addWatchFile, activeViteCssCacheFiles, bundle, bundleFiles, cache, changedCssFiles = /* @__PURE__ */ new Set(), createScopedGeneratorRuntime, createScopedSourceCandidateGetter, createScopedSourceCandidateSourceGetter, cssTaskFactories, cssPipelineContext, cssPipelineStrategy, debug, defaultStyleOutputExtension, emitOrReplayCssAsset, generatorRuntime, generatorPlatform, getCssHandlerOptions, getCssUserHandlerOptions, getRememberedCssSignature, getRememberedCssSources, frameworkRootImportShellTargetByFile, isNativeAppStyleTarget, isWebGeneratorTarget, lastCssRawSourceHashByFile = /* @__PURE__ */ new Map(), lastCssResultByFile, lastCssSourceHashByFile, markCssAssetProcessed, metrics, normalizeViteCssCacheKey, onUpdate, opts, pendingRememberedCssReplayUpdates, recordCssAssetResult, recordViteProcessedCssAssetResult, rootDir, runtimeState, setRememberedCssSignature, shouldInjectCssIntoMainFromOutput, shouldPreserveAppCssExtension, sourceRoot, styleHandler, timeTask, useIncrementalMode } = options;
|
|
6569
6618
|
const rememberedReplayGroups = collectRememberedCssReplayGroups(getRememberedCssSources?.(), opts, rootDir, isWebGeneratorTarget, shouldPreserveAppCssExtension, sourceRoot, defaultStyleOutputExtension, bundleFiles);
|
|
6570
|
-
|
|
6619
|
+
const normalizedBundleFiles = new Set(bundleFiles.map(require_source_candidate_scan_signature.normalizeOutputPathKey));
|
|
6620
|
+
for (const [rememberedOutputFile, rememberedGroup] of rememberedReplayGroups) {
|
|
6621
|
+
const outputFile = resolveRememberedCssReplayOutputFile(rememberedOutputFile, frameworkRootImportShellTargetByFile);
|
|
6622
|
+
if (outputFile !== rememberedOutputFile) debug("css replay use framework root import shell target: %s -> %s", rememberedOutputFile, outputFile);
|
|
6571
6623
|
if (isHTMLRequest(outputFile) || options.opts.htmlMatcher(outputFile)) continue;
|
|
6572
6624
|
const replayableRememberedGroup = rememberedGroup.filter(({ remembered }) => {
|
|
6573
6625
|
const shouldSkip = shouldSkipRawRememberedCssSource(remembered.rawSource, remembered.sourceFile);
|
|
@@ -6581,7 +6633,7 @@ async function processRememberedCssReplay(options) {
|
|
|
6581
6633
|
const generatorRawSource = isWebGeneratorTarget ? rawSource : require_v4_generation_core.normalizeMiniProgramGeneratorCssSource(rawSource, outputFile);
|
|
6582
6634
|
activeViteCssCacheFiles.add(normalizeViteCssCacheKey(outputFile));
|
|
6583
6635
|
activeViteCssCacheFiles.add(normalizeViteCssCacheKey(sourceFile));
|
|
6584
|
-
const outputCssHandlerOptions = getCssHandlerOptions(
|
|
6636
|
+
const outputCssHandlerOptions = getCssHandlerOptions(rememberedOutputFile);
|
|
6585
6637
|
const cssHandlerOptions = {
|
|
6586
6638
|
...getCssHandlerOptions(sourceFile),
|
|
6587
6639
|
isMainChunk: outputCssHandlerOptions.isMainChunk
|
|
@@ -6600,7 +6652,19 @@ async function processRememberedCssReplay(options) {
|
|
|
6600
6652
|
const cssSourceChanged = changedCssFiles.has(outputFile) || changedCssFiles.has(sourceFile) || previousRawSourceHash != null && previousRawSourceHash !== rawSourceHash;
|
|
6601
6653
|
const previousCss = useIncrementalMode && !cssSourceChanged && getLastCssSourceHash(lastCssSourceHashByFile, outputFile) === cssRuntimeAffectingHash ? getLastCssResult(lastCssResultByFile, outputFile) : void 0;
|
|
6602
6654
|
const allRememberedSignaturesFresh = rememberedKeys.length > 0 && rememberedKeys.every((key) => getRememberedCssSignature?.(key) === rememberedCssRuntimeSignature);
|
|
6603
|
-
if (bundleFiles.includes(
|
|
6655
|
+
if (bundleFiles.includes(rememberedOutputFile) || bundleFiles.includes(sourceFile)) continue;
|
|
6656
|
+
const shouldMergeReplayIntoFrameworkRootTarget = outputFile !== rememberedOutputFile && normalizedBundleFiles.has(require_source_candidate_scan_signature.normalizeOutputPathKey(outputFile));
|
|
6657
|
+
if (allRememberedSignaturesFresh) if (!shouldMergeReplayIntoFrameworkRootTarget) continue;
|
|
6658
|
+
else {
|
|
6659
|
+
const cachedCss = getLastCssResult(lastCssResultByFile, outputFile);
|
|
6660
|
+
if (cachedCss != null) {
|
|
6661
|
+
pendingRememberedCssReplayUpdates.push(...createRememberedCssReplayUpdates(cachedCss, sourceFile, outputFile, true));
|
|
6662
|
+
metrics.css.cacheHits++;
|
|
6663
|
+
debug("css replay cached result into framework root target: %s", outputFile);
|
|
6664
|
+
continue;
|
|
6665
|
+
}
|
|
6666
|
+
debug("css replay framework root target cache miss, regenerate: %s", outputFile);
|
|
6667
|
+
}
|
|
6604
6668
|
const sourceTraceSources = scopedSourceCandidateSourceGetter ? await require_source_candidate_scan_signature.createScopedGeneratorSourceTraceMap(generatorRawSource, sourceFile, scopedSourceCandidateSourceGetter) : void 0;
|
|
6605
6669
|
const sourceTraceTokenSources = sourceTraceSources ? require_v4_generation_core.createCssTokenSourceMap(sourceTraceSources, opts) : void 0;
|
|
6606
6670
|
const annotateCss = (css) => require_v4_generation_core.annotateCssSourceTrace(css, {
|
|
@@ -6608,7 +6672,7 @@ async function processRememberedCssReplay(options) {
|
|
|
6608
6672
|
tokenSources: sourceTraceTokenSources
|
|
6609
6673
|
});
|
|
6610
6674
|
const shouldRecordRememberedReplayCss = useIncrementalMode || isNativeAppStyleTarget;
|
|
6611
|
-
const shouldEmitRememberedReplayCssAsset = shouldRecordRememberedReplayCss;
|
|
6675
|
+
const shouldEmitRememberedReplayCssAsset = shouldRecordRememberedReplayCss && !shouldMergeReplayIntoFrameworkRootTarget;
|
|
6612
6676
|
if (!shouldRecordRememberedReplayCss) continue;
|
|
6613
6677
|
const shouldPreserveLocalImportWrapper = shouldPreserveFrameworkRootMiniProgramImportShell({
|
|
6614
6678
|
css: rawSource,
|
|
@@ -6676,14 +6740,10 @@ async function processRememberedCssReplay(options) {
|
|
|
6676
6740
|
registerGeneratorDependencies$1({ addWatchFile }, generated.dependencies);
|
|
6677
6741
|
recordCssAssetResult?.(outputFile, css);
|
|
6678
6742
|
const shouldInjectReplayCssIntoMain = shouldInjectCssIntoMainFromOutput(outputFile, sourceFile, outputCssHandlerOptions);
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
if (outputFile !== sourceFile) recordViteProcessedCssAssetResult?.(outputFile, css, {
|
|
6684
|
-
injectIntoMain: outputCssHandlerOptions.isMainChunk ? false : shouldInjectReplayCssIntoMain,
|
|
6685
|
-
outputFile
|
|
6686
|
-
});
|
|
6743
|
+
const injectIntoMain = shouldMergeReplayIntoFrameworkRootTarget ? true : outputCssHandlerOptions.isMainChunk ? false : shouldInjectReplayCssIntoMain;
|
|
6744
|
+
const replayUpdates = createRememberedCssReplayUpdates(css, sourceFile, outputFile, injectIntoMain);
|
|
6745
|
+
if (shouldMergeReplayIntoFrameworkRootTarget) pendingRememberedCssReplayUpdates.push(...replayUpdates);
|
|
6746
|
+
else for (const update of replayUpdates) recordViteProcessedCssAssetResult?.(update.file, update.css, update);
|
|
6687
6747
|
debug("css replay generated result: %s bytes=%d", outputFile, css.length);
|
|
6688
6748
|
}
|
|
6689
6749
|
if (shouldEmitRememberedReplayCssAsset) emitRememberedCssAsset(css);
|
|
@@ -7575,6 +7635,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7575
7635
|
const tasks = [];
|
|
7576
7636
|
const cssTaskFactories = [];
|
|
7577
7637
|
const jsTaskFactories = [];
|
|
7638
|
+
const pendingRememberedCssReplayUpdates = [];
|
|
7578
7639
|
const entryPlanningStartedAt = performance.now();
|
|
7579
7640
|
for (const entry of snapshot.entries) {
|
|
7580
7641
|
const { file, output: originalSource, source: originalEntrySource, type } = entry;
|
|
@@ -7800,6 +7861,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7800
7861
|
debug,
|
|
7801
7862
|
defaultStyleOutputExtension,
|
|
7802
7863
|
emitOrReplayCssAsset,
|
|
7864
|
+
frameworkRootImportShellTargetByFile,
|
|
7803
7865
|
generatorPlatform,
|
|
7804
7866
|
generatorRuntime,
|
|
7805
7867
|
getCssHandlerOptions,
|
|
@@ -7816,6 +7878,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7816
7878
|
normalizeViteCssCacheKey,
|
|
7817
7879
|
onUpdate,
|
|
7818
7880
|
opts,
|
|
7881
|
+
pendingRememberedCssReplayUpdates,
|
|
7819
7882
|
recordCssAssetResult,
|
|
7820
7883
|
recordViteProcessedCssAssetResult,
|
|
7821
7884
|
rootDir,
|
|
@@ -7867,6 +7930,7 @@ function createGenerateBundleHook$1(context) {
|
|
|
7867
7930
|
opts,
|
|
7868
7931
|
outDir,
|
|
7869
7932
|
pendingLinkedUpdates,
|
|
7933
|
+
pendingRememberedCssReplayUpdates,
|
|
7870
7934
|
pruneViteCssCaches,
|
|
7871
7935
|
recordCssAssetResult,
|
|
7872
7936
|
recordTimingDetail,
|
|
@@ -8931,24 +8995,27 @@ function wrapViteCssPostTransform(config, transformCss) {
|
|
|
8931
8995
|
}
|
|
8932
8996
|
//#endregion
|
|
8933
8997
|
//#region src/bundlers/vite/shared/framework-hmr-candidate-state.ts
|
|
8934
|
-
const WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE = /@(?:theme|source|config|plugin|apply)\b/;
|
|
8935
8998
|
function createViteHmrCandidateState(options) {
|
|
8936
8999
|
let pendingChange;
|
|
8937
9000
|
let pendingCssTargetFiles;
|
|
9001
|
+
let pendingTargetsArmed = false;
|
|
8938
9002
|
let pendingFullRegeneration = false;
|
|
8939
9003
|
const normalizeCssTargetFile = (file) => normalizeVitePersistentCacheKey((0, _weapp_tailwindcss_shared.cleanUrl)(file));
|
|
8940
9004
|
const clear = () => {
|
|
8941
9005
|
pendingChange = void 0;
|
|
8942
9006
|
pendingCssTargetFiles = void 0;
|
|
9007
|
+
pendingTargetsArmed = false;
|
|
8943
9008
|
pendingFullRegeneration = false;
|
|
8944
9009
|
};
|
|
8945
9010
|
const queueFullRegeneration = () => {
|
|
8946
9011
|
pendingChange = void 0;
|
|
8947
9012
|
pendingCssTargetFiles = void 0;
|
|
9013
|
+
pendingTargetsArmed = false;
|
|
8948
9014
|
pendingFullRegeneration = true;
|
|
8949
9015
|
};
|
|
8950
9016
|
const queueChange = (change) => {
|
|
8951
9017
|
var _pendingChange;
|
|
9018
|
+
if (pendingFullRegeneration) return;
|
|
8952
9019
|
pendingFullRegeneration = false;
|
|
8953
9020
|
if (!pendingChange) {
|
|
8954
9021
|
pendingChange = {
|
|
@@ -8970,7 +9037,7 @@ function createViteHmrCandidateState(options) {
|
|
|
8970
9037
|
const createChange = (file, change, changeOptions = {}) => ({
|
|
8971
9038
|
...change,
|
|
8972
9039
|
file,
|
|
8973
|
-
runtimeAffecting: changeOptions.runtimeAffecting === true || options.isRuntimeAffectingSource?.(file) === true || require_v4_generation_core.isSourceStyleRequest(file)
|
|
9040
|
+
runtimeAffecting: changeOptions.runtimeAffecting === true || options.isRuntimeAffectingSource?.(file) === true || require_v4_generation_core.isSourceStyleRequest(file)
|
|
8974
9041
|
});
|
|
8975
9042
|
const apply = (change) => {
|
|
8976
9043
|
if (require_v4_generation_core.isSourceStyleRequest(change.file)) {
|
|
@@ -8984,7 +9051,7 @@ function createViteHmrCandidateState(options) {
|
|
|
8984
9051
|
const preserveDeletedCss = options.getGeneratorOptions().hmr.preserveDeletedCss;
|
|
8985
9052
|
if (preserveDeletedCss) {
|
|
8986
9053
|
if (change.addedCandidates.size > 0) queueChange(change);
|
|
8987
|
-
else if (!pendingChange) clear();
|
|
9054
|
+
else if (!pendingChange && !pendingFullRegeneration) clear();
|
|
8988
9055
|
return change;
|
|
8989
9056
|
}
|
|
8990
9057
|
clear();
|
|
@@ -8993,28 +9060,26 @@ function createViteHmrCandidateState(options) {
|
|
|
8993
9060
|
};
|
|
8994
9061
|
const resolve = (generatorCode, file) => {
|
|
8995
9062
|
const fileKey = normalizeCssTargetFile(file);
|
|
8996
|
-
if (options.getCommand() !== "serve" || !pendingChange || pendingChange.runtimeAffecting || pendingChange.addedCandidates.size === 0 || options.getGeneratorOptions().target === "weapp" && require_generator.hasUserCssLayerBlocks(generatorCode) || !options.cleanGeneratedCssByFile.has(fileKey) || !options.generatedClassSetByFile.has(fileKey) ||
|
|
9063
|
+
if (options.getCommand() !== "serve" || !pendingChange || pendingChange.runtimeAffecting || pendingChange.addedCandidates.size === 0 || options.getGeneratorOptions().target === "weapp" && require_generator.hasUserCssLayerBlocks(generatorCode) || !options.cleanGeneratedCssByFile.has(fileKey) || !options.generatedClassSetByFile.has(fileKey) || pendingTargetsArmed && !pendingCssTargetFiles?.has(fileKey)) return;
|
|
8997
9064
|
return pendingChange;
|
|
8998
9065
|
};
|
|
8999
9066
|
const finishTarget = (file) => {
|
|
9000
|
-
if (!pendingChange) return;
|
|
9001
|
-
if (!pendingCssTargetFiles)
|
|
9002
|
-
clear();
|
|
9003
|
-
return;
|
|
9004
|
-
}
|
|
9067
|
+
if (!pendingChange && !pendingFullRegeneration) return;
|
|
9068
|
+
if (!pendingTargetsArmed || !pendingCssTargetFiles) return;
|
|
9005
9069
|
pendingCssTargetFiles.delete(normalizeCssTargetFile(file));
|
|
9006
9070
|
if (pendingCssTargetFiles.size === 0) clear();
|
|
9007
9071
|
};
|
|
9008
9072
|
const armTargets = (cssModules, fallbackCssIds) => {
|
|
9009
|
-
if (!pendingChange) {
|
|
9073
|
+
if (!pendingChange && !pendingFullRegeneration) {
|
|
9010
9074
|
pendingCssTargetFiles = void 0;
|
|
9075
|
+
pendingTargetsArmed = false;
|
|
9011
9076
|
return;
|
|
9012
9077
|
}
|
|
9013
9078
|
const targets = /* @__PURE__ */ new Set();
|
|
9014
9079
|
const addTarget = (file) => {
|
|
9015
9080
|
if (!file) return;
|
|
9016
9081
|
const key = normalizeCssTargetFile(file);
|
|
9017
|
-
if (options.cleanGeneratedCssByFile.has(key)) targets.add(key);
|
|
9082
|
+
if (pendingFullRegeneration || options.cleanGeneratedCssByFile.has(key)) targets.add(key);
|
|
9018
9083
|
};
|
|
9019
9084
|
for (const module of cssModules) {
|
|
9020
9085
|
addTarget(module.id);
|
|
@@ -9022,7 +9087,28 @@ function createViteHmrCandidateState(options) {
|
|
|
9022
9087
|
addTarget(module.url);
|
|
9023
9088
|
}
|
|
9024
9089
|
for (const id of fallbackCssIds) addTarget(id);
|
|
9025
|
-
pendingCssTargetFiles = targets
|
|
9090
|
+
pendingCssTargetFiles = targets;
|
|
9091
|
+
pendingTargetsArmed = true;
|
|
9092
|
+
};
|
|
9093
|
+
const reconcileRuntimeCandidates = (file, candidates, rootCssIds) => {
|
|
9094
|
+
if (options.getCommand() !== "serve" || pendingFullRegeneration) return;
|
|
9095
|
+
const generatedClassSets = [];
|
|
9096
|
+
const seenFiles = /* @__PURE__ */ new Set();
|
|
9097
|
+
for (const id of rootCssIds) {
|
|
9098
|
+
const fileKey = normalizeCssTargetFile(id);
|
|
9099
|
+
if (seenFiles.has(fileKey)) continue;
|
|
9100
|
+
seenFiles.add(fileKey);
|
|
9101
|
+
const classSet = options.generatedClassSetByFile.get(fileKey);
|
|
9102
|
+
if (classSet) generatedClassSets.push(classSet);
|
|
9103
|
+
}
|
|
9104
|
+
if (generatedClassSets.length === 0) return;
|
|
9105
|
+
const addedCandidates = /* @__PURE__ */ new Set();
|
|
9106
|
+
for (const candidate of candidates) if (generatedClassSets.some((classSet) => !classSet.has(candidate))) addedCandidates.add(candidate);
|
|
9107
|
+
if (addedCandidates.size === 0) return;
|
|
9108
|
+
apply(createChange(file, {
|
|
9109
|
+
addedCandidates,
|
|
9110
|
+
removedCandidates: /* @__PURE__ */ new Set()
|
|
9111
|
+
}));
|
|
9026
9112
|
};
|
|
9027
9113
|
return {
|
|
9028
9114
|
apply,
|
|
@@ -9031,13 +9117,19 @@ function createViteHmrCandidateState(options) {
|
|
|
9031
9117
|
createChange,
|
|
9032
9118
|
finishTarget,
|
|
9033
9119
|
hasPendingCandidateAppend: () => pendingChange != null && !pendingChange.runtimeAffecting && pendingChange.addedCandidates.size > 0,
|
|
9034
|
-
hasPendingChange: () => pendingChange != null,
|
|
9120
|
+
hasPendingChange: () => pendingChange != null || pendingFullRegeneration,
|
|
9035
9121
|
queueFullRegeneration,
|
|
9122
|
+
reconcileRuntimeCandidates,
|
|
9036
9123
|
resolve,
|
|
9037
|
-
shouldForceFullRegeneration: (resolved) =>
|
|
9124
|
+
shouldForceFullRegeneration: (file, resolved) => {
|
|
9125
|
+
if (options.getCommand() !== "serve") return false;
|
|
9126
|
+
if (pendingFullRegeneration) return pendingTargetsArmed && pendingCssTargetFiles?.has(normalizeCssTargetFile(file)) === true;
|
|
9127
|
+
return pendingChange != null && !resolved && pendingTargetsArmed && pendingCssTargetFiles?.has(normalizeCssTargetFile(file)) === true;
|
|
9128
|
+
},
|
|
9038
9129
|
snapshotDebugState: () => ({
|
|
9039
9130
|
pendingAddedCandidates: pendingChange?.addedCandidates.size ?? 0,
|
|
9040
|
-
pendingCssTargets: pendingCssTargetFiles?.size ?? 0
|
|
9131
|
+
pendingCssTargets: pendingCssTargetFiles?.size ?? 0,
|
|
9132
|
+
pendingFullRegeneration
|
|
9041
9133
|
})
|
|
9042
9134
|
};
|
|
9043
9135
|
}
|
|
@@ -9331,6 +9423,7 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9331
9423
|
await options.refreshTailwindRootCssSource(ctx.file, hotSource);
|
|
9332
9424
|
}
|
|
9333
9425
|
const sourceCandidateChange = await options.sourceScanSession.syncChangedFile(ctx.file, hotSource);
|
|
9426
|
+
options.sourceScanSession.consumeHotUpdateChange(ctx.file);
|
|
9334
9427
|
const isWebLikeHotUpdate = options.isCurrentWebLikeStylePlatform();
|
|
9335
9428
|
let canUseHmrCandidateAppend = false;
|
|
9336
9429
|
if (isSourceCandidateHotUpdate) {
|
|
@@ -9349,6 +9442,7 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9349
9442
|
}
|
|
9350
9443
|
}
|
|
9351
9444
|
if (isSourceCandidateHotUpdate) await options.sourceScanSession.waitForPendingSyncs();
|
|
9445
|
+
if (isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file)) options.hmrCandidateState.reconcileRuntimeCandidates(ctx.file, options.sourceCandidateCollector.values(), options.tailwindRootCssModuleIds);
|
|
9352
9446
|
const cssModules = await resolveHotTailwindCssModules(ctx, require_v4_generation_core.isSourceStyleRequest(ctx.file) ? [ctx.file] : options.tailwindRootCssModuleIds);
|
|
9353
9447
|
const hotRoot = ctx.server.config?.root ?? node_process.default.cwd();
|
|
9354
9448
|
const sourceModules = isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) ? await resolveHotSourceModules(ctx) : ctx.modules;
|
|
@@ -9367,7 +9461,7 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9367
9461
|
}
|
|
9368
9462
|
const shouldSendSupplementalCssHotUpdates = !(isWebLikeHotUpdate && isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) && sourceCandidateChange !== void 0 && options.resolveCurrentGeneratorOptions().hmr.preserveDeletedCss && !sourceCandidateChange.runtimeAffecting && sourceCandidateChange.addedCandidates.size === 0 && sourceCandidateChange.removedCandidates.size > 0);
|
|
9369
9463
|
const supplementalCssFallbackIds = /* @__PURE__ */ new Set([...options.tailwindRootCssModuleIds, ...options.viteProcessedCssSourceFiles]);
|
|
9370
|
-
if (
|
|
9464
|
+
if (options.hmrCandidateState.hasPendingChange()) options.hmrCandidateState.armTargets(cssModules, supplementalCssFallbackIds);
|
|
9371
9465
|
if (shouldSendSupplementalCssHotUpdates) sendSupplementalCssHotUpdates(ctx, cssModules, supplementalCssFallbackIds);
|
|
9372
9466
|
if (isWebLikeHotUpdate && isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file)) return cssModules.length > 0 ? mergeHotModulesByIdentity(hotRoot, sourceModules, cssModules) : hasDifferentHotModules(sourceModules, ctx.modules) ? sourceModules : void 0;
|
|
9373
9467
|
if (isSourceCandidateHotUpdate && !require_v4_generation_core.isSourceStyleRequest(ctx.file) && cssModules.length > 0) return mergeHotModulesByIdentity(hotRoot, sourceModules, cssModules);
|
|
@@ -9382,6 +9476,16 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9382
9476
|
};
|
|
9383
9477
|
}
|
|
9384
9478
|
//#endregion
|
|
9479
|
+
//#region src/bundlers/vite/shared/framework-hmr-runtime-signature.ts
|
|
9480
|
+
const WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE = /@(?:theme|source|config|plugin|apply)\b/;
|
|
9481
|
+
function createFrameworkHmrRuntimeSignature(file, source) {
|
|
9482
|
+
if (!source || !WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE.test(source)) return "";
|
|
9483
|
+
return (isSfcStyleSourceFile((0, _weapp_tailwindcss_shared.cleanUrl)(file)) ? extractSfcStyleSources(source).filter((styleSource) => WEB_HMR_RUNTIME_AFFECTING_DIRECTIVE_RE.test(styleSource)) : [source]).map((styleSource) => require_v4_generation_core.createRuntimeAffectingSourceSignature(styleSource, "css")).join("\0");
|
|
9484
|
+
}
|
|
9485
|
+
function hasFrameworkHmrRuntimeSourceChange(file, previousSource, nextSource) {
|
|
9486
|
+
return createFrameworkHmrRuntimeSignature(file, previousSource) !== createFrameworkHmrRuntimeSignature(file, nextSource);
|
|
9487
|
+
}
|
|
9488
|
+
//#endregion
|
|
9385
9489
|
//#region src/bundlers/vite/shared/framework-source-scan-session.ts
|
|
9386
9490
|
const SOURCE_CANDIDATE_SCAN_CACHE_MAX = 8;
|
|
9387
9491
|
const sourceCandidateScanSnapshotCache = new lru_cache.LRUCache({ max: SOURCE_CANDIDATE_SCAN_CACHE_MAX });
|
|
@@ -9400,6 +9504,7 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9400
9504
|
let sourceCandidateScanInvalidated = true;
|
|
9401
9505
|
const pendingSourceCandidateSyncs = /* @__PURE__ */ new Set();
|
|
9402
9506
|
const pendingSourceCandidateSyncByFile = /* @__PURE__ */ new Map();
|
|
9507
|
+
const pendingHotUpdateChangeByFile = /* @__PURE__ */ new Map();
|
|
9403
9508
|
const normalizeDependency = (file) => node_path.default.normalize(node_path.default.resolve((0, _weapp_tailwindcss_shared.cleanUrl)(file)));
|
|
9404
9509
|
const isDependency = (file) => sourceScanDependencies.has(normalizeDependency(file));
|
|
9405
9510
|
const invalidate = () => {
|
|
@@ -9501,6 +9606,26 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9501
9606
|
const waitForPendingSyncs = async () => {
|
|
9502
9607
|
while (pendingSourceCandidateSyncs.size > 0) await Promise.all(pendingSourceCandidateSyncs);
|
|
9503
9608
|
};
|
|
9609
|
+
const rememberHotUpdateChange = (change) => {
|
|
9610
|
+
if (!change) return;
|
|
9611
|
+
const previous = pendingHotUpdateChangeByFile.get(change.file);
|
|
9612
|
+
if (!previous) {
|
|
9613
|
+
const remembered = {
|
|
9614
|
+
...change,
|
|
9615
|
+
addedCandidates: new Set(change.addedCandidates),
|
|
9616
|
+
removedCandidates: new Set(change.removedCandidates)
|
|
9617
|
+
};
|
|
9618
|
+
pendingHotUpdateChangeByFile.set(change.file, remembered);
|
|
9619
|
+
return remembered;
|
|
9620
|
+
}
|
|
9621
|
+
for (const candidate of change.addedCandidates) {
|
|
9622
|
+
previous.addedCandidates.add(candidate);
|
|
9623
|
+
previous.removedCandidates.delete(candidate);
|
|
9624
|
+
}
|
|
9625
|
+
for (const candidate of change.removedCandidates) if (!previous.addedCandidates.delete(candidate)) previous.removedCandidates.add(candidate);
|
|
9626
|
+
previous.runtimeAffecting || (previous.runtimeAffecting = change.runtimeAffecting);
|
|
9627
|
+
return previous;
|
|
9628
|
+
};
|
|
9504
9629
|
const syncChangedFile = (id, sourceOverride) => {
|
|
9505
9630
|
if (!options.shouldOwnTailwindGeneration || !options.isCandidateRequest(id)) return Promise.resolve(void 0);
|
|
9506
9631
|
const file = (0, _weapp_tailwindcss_shared.cleanUrl)(id);
|
|
@@ -9511,15 +9636,18 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9511
9636
|
cacheCurrent();
|
|
9512
9637
|
return (require_v4_generation_core.isSourceStyleRequest(file) ? (0, node_fs_promises.readFile)(file, "utf8").then((source) => options.cssMemory.refreshRememberedCssSourceBySourceFile(file, source)).catch((error) => {
|
|
9513
9638
|
if ((typeof error === "object" && error !== null && "code" in error ? error.code : void 0) !== "ENOENT") options.debug("remembered css source watch refresh failed: %s %O", file, error);
|
|
9514
|
-
}) : Promise.resolve()).then(() => options.cssMemory.refreshRememberedCssSourceByCurrentFile(file)).then(() => options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: true })));
|
|
9639
|
+
}) : Promise.resolve()).then(() => options.cssMemory.refreshRememberedCssSourceByCurrentFile(file)).then(() => rememberHotUpdateChange(options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: true }))));
|
|
9515
9640
|
}
|
|
9516
9641
|
const existingTask = pendingSourceCandidateSyncByFile.get(file);
|
|
9517
9642
|
if (existingTask) return existingTask.then(() => syncChangedFile(id, sourceOverride));
|
|
9643
|
+
const previousSource = options.sourceCandidateCollector.source(file);
|
|
9518
9644
|
const task = (sourceOverride === void 0 ? options.sourceCandidateCollector.syncCurrentFile(id) : options.sourceCandidateCollector.syncCurrentSource(id, sourceOverride)).catch((error) => {
|
|
9519
9645
|
options.debug("source candidate watch sync failed: %s %O", id, error);
|
|
9520
9646
|
}).then((change) => {
|
|
9521
9647
|
cacheCurrent();
|
|
9522
|
-
|
|
9648
|
+
const runtimeAffectingBySource = hasFrameworkHmrRuntimeSourceChange(file, previousSource, options.sourceCandidateCollector.source(file));
|
|
9649
|
+
const appliedChange = change ? options.hmrCandidateState.apply(options.hmrCandidateState.createChange(file, change, { runtimeAffecting: runtimeAffectingByDependency || runtimeAffectingBySource })) : void 0;
|
|
9650
|
+
return rememberHotUpdateChange(appliedChange) ?? pendingHotUpdateChangeByFile.get(file);
|
|
9523
9651
|
}).finally(() => {
|
|
9524
9652
|
pendingSourceCandidateSyncs.delete(task);
|
|
9525
9653
|
pendingSourceCandidateSyncByFile.delete(file);
|
|
@@ -9533,9 +9661,11 @@ function createFrameworkSourceScanSession(options) {
|
|
|
9533
9661
|
};
|
|
9534
9662
|
return {
|
|
9535
9663
|
cacheCurrent,
|
|
9664
|
+
consumeHotUpdateChange: (id) => pendingHotUpdateChangeByFile.delete((0, _weapp_tailwindcss_shared.cleanUrl)(id)),
|
|
9536
9665
|
getStats: () => ({
|
|
9537
9666
|
pendingSourceCandidateSyncByFile: pendingSourceCandidateSyncByFile.size,
|
|
9538
9667
|
pendingSourceCandidateSyncs: pendingSourceCandidateSyncs.size,
|
|
9668
|
+
pendingHotUpdateChangeByFile: pendingHotUpdateChangeByFile.size,
|
|
9539
9669
|
sourceCandidateScanCache: sourceCandidateScanCache.size
|
|
9540
9670
|
}),
|
|
9541
9671
|
invalidate,
|
|
@@ -9861,8 +9991,7 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
9861
9991
|
generatedClassSetByFile,
|
|
9862
9992
|
getCommand: () => resolvedConfig?.command,
|
|
9863
9993
|
getGeneratorOptions: resolveCurrentGeneratorOptions,
|
|
9864
|
-
|
|
9865
|
-
isRuntimeAffectingSource: (file) => uniAppXEnabled && /\.(?:uvue|nvue)$/i.test((0, _weapp_tailwindcss_shared.cleanUrl)(file))
|
|
9994
|
+
isRuntimeAffectingSource: (file) => uniAppXEnabled && !resolveCurrentGeneratorBranch().isWeb && /\.(?:uvue|nvue)$/i.test((0, _weapp_tailwindcss_shared.cleanUrl)(file))
|
|
9866
9995
|
});
|
|
9867
9996
|
const sourceScanSession = createFrameworkSourceScanSession({
|
|
9868
9997
|
cssMemory,
|
|
@@ -9970,7 +10099,7 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
9970
10099
|
const fullRuntime = getSourceCandidates() ?? getRecordedGeneratorCandidates() ?? await ensureRuntimeClassSet();
|
|
9971
10100
|
const transient = hookContext?.transient === true;
|
|
9972
10101
|
const pendingHmrChange = transient ? void 0 : hmrCandidateState.resolve(generatorCode, file);
|
|
9973
|
-
const forceFullHmrCssRegeneration = hmrCandidateState.shouldForceFullRegeneration(pendingHmrChange !== void 0);
|
|
10102
|
+
const forceFullHmrCssRegeneration = hmrCandidateState.shouldForceFullRegeneration(file, pendingHmrChange !== void 0);
|
|
9974
10103
|
const runtime = hookContext?.sourceCandidates === void 0 ? fullRuntime : new Set(hookContext.sourceCandidates);
|
|
9975
10104
|
const importShellCss = resolveViteServeRootMiniProgramImportShell({
|
|
9976
10105
|
css: generatorTransformCode,
|
|
@@ -9990,7 +10119,7 @@ function createViteFrameworkPlugins$1(options = {}, frameworkBranch) {
|
|
|
9990
10119
|
markViteProcessedCssSource(file);
|
|
9991
10120
|
rememberTailwindRootCssModule(id);
|
|
9992
10121
|
recordGeneratorCandidates(fullRuntime);
|
|
9993
|
-
if (pendingHmrChange) hmrCandidateState.finishTarget(file);
|
|
10122
|
+
if (pendingHmrChange || forceFullHmrCssRegeneration) hmrCandidateState.finishTarget(file);
|
|
9994
10123
|
else if (!hmrCandidateState.hasPendingChange()) hmrCandidateState.clear();
|
|
9995
10124
|
cssMemory.rememberCssSource({
|
|
9996
10125
|
outputFile,
|
|
@@ -10101,7 +10230,7 @@ ${previousTracedCss}`;
|
|
|
10101
10230
|
markViteProcessedCssSource(file);
|
|
10102
10231
|
if (require_generator.hasTailwindRootDirectives(generatorTransformCode, { importFallback: currentGeneratorOptions.importFallback })) rememberTailwindRootCssModule(id);
|
|
10103
10232
|
recordGeneratorCandidates(fullRuntime);
|
|
10104
|
-
if (pendingHmrChange) hmrCandidateState.finishTarget(file);
|
|
10233
|
+
if (pendingHmrChange || forceFullHmrCssRegeneration) hmrCandidateState.finishTarget(file);
|
|
10105
10234
|
else if (!hmrCandidateState.hasPendingChange()) hmrCandidateState.clear();
|
|
10106
10235
|
cssMemory.rememberCssSource({
|
|
10107
10236
|
outputFile,
|
|
@@ -10220,6 +10349,8 @@ ${tracedCss}`;
|
|
|
10220
10349
|
getResolvedConfig,
|
|
10221
10350
|
isEnabled: shouldEnableFrameworkExtraPlugins,
|
|
10222
10351
|
isIosPlatform: extraPluginPlatform.isIosPlatform === true,
|
|
10352
|
+
isNativeAppStyleTarget: () => frameworkCssPipelineStrategy?.isNativeAppStyleTarget?.(createCssPipelineContext()) === true,
|
|
10353
|
+
isWebGeneratorTarget: () => resolveCurrentGeneratorBranch().isWeb,
|
|
10223
10354
|
jsHandler,
|
|
10224
10355
|
mainCssChunkMatcher,
|
|
10225
10356
|
runtimeState,
|
|
@@ -10638,6 +10769,8 @@ function createUniAppXVitePlugins(options = {}) {
|
|
|
10638
10769
|
getResolvedConfig: context.getResolvedConfig,
|
|
10639
10770
|
isEnabled: context.isEnabled,
|
|
10640
10771
|
isIosPlatform: context.isIosPlatform,
|
|
10772
|
+
isNativeAppStyleTarget: context.isNativeAppStyleTarget,
|
|
10773
|
+
isWebGeneratorTarget: context.isWebGeneratorTarget,
|
|
10641
10774
|
jsHandler: context.jsHandler,
|
|
10642
10775
|
mainCssChunkMatcher: context.mainCssChunkMatcher,
|
|
10643
10776
|
runtimeState: context.runtimeState,
|
package/dist/vite.cjs
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-Dcx59GRQ.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-8l9_S4Qi.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.9",
|
|
5
5
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -215,8 +215,8 @@
|
|
|
215
215
|
"oxc-walker": "^1.1.1",
|
|
216
216
|
"semver": "~7.8.5",
|
|
217
217
|
"yaml": "^2.9.0",
|
|
218
|
-
"@weapp-tailwindcss/postcss": "3.2.6",
|
|
219
218
|
"@weapp-tailwindcss/logger": "2.0.1",
|
|
219
|
+
"@weapp-tailwindcss/postcss": "3.2.7",
|
|
220
220
|
"@weapp-tailwindcss/reset": "0.1.2",
|
|
221
221
|
"@weapp-tailwindcss/shared": "2.0.1",
|
|
222
222
|
"tailwindcss-config": "2.0.2",
|