weapp-tailwindcss 5.1.2 → 5.1.4
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/README.md +1 -1
- package/dist/auto-CrJJc5rK.mjs +13 -0
- package/dist/bundlers/gulp/index.d.ts +3 -3
- package/dist/bundlers/rspack/index.d.ts +20 -0
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +12 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +1 -0
- package/dist/bundlers/vite/serve-js-transform.d.ts +11 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +4 -1
- package/dist/cli.js +8 -8
- package/dist/cli.mjs +8 -8
- package/dist/{context-C-r8ki7x.mjs → context-Bkpmt3ja.mjs} +62 -36
- package/dist/{context-CH4HFZP2.js → context-DCVMkTRj.js} +76 -44
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro/auto.d.ts +1 -1
- package/dist/css-macro/postcss.js +2 -2
- package/dist/css-macro.js +3 -3
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-CmFBmxsr.js → defaults-DQhgnnn-.js} +1 -1
- package/dist/defaults.js +1 -1
- package/dist/framework/index.d.ts +7 -2
- package/dist/framework/platform.d.ts +2 -0
- package/dist/framework.js +39 -8
- package/dist/framework.mjs +33 -6
- package/dist/{generator-BsPIaLtV.mjs → generator-24-HgU9F.mjs} +5 -3
- package/dist/{generator-B6pUjNdD.js → generator-CilgHtxb.js} +6 -4
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-CTdcASq8.mjs → gulp-0RsqkF_d.mjs} +4 -4
- package/dist/{gulp-BBCeA7ky.js → gulp-Bogfnoki.js} +12 -11
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-BRx-KnBh.mjs → hmr-timing-BRNaz8Od.mjs} +62 -166
- package/dist/{hmr-timing-Da1eI8S0.js → hmr-timing-BV6nFPoT.js} +65 -187
- package/dist/index.js +9 -4
- package/dist/index.mjs +7 -6
- package/dist/postcss-html-transform.js +2 -2
- package/dist/postcss.js +2 -2
- package/dist/postcss.mjs +2 -2
- package/dist/presets/shared.d.ts +4 -0
- package/dist/presets.js +32 -16
- package/dist/presets.mjs +28 -14
- package/dist/reset.js +2 -2
- package/dist/rspack.d.ts +3 -0
- package/dist/rspack.js +68 -0
- package/dist/rspack.mjs +62 -0
- package/dist/{source-candidate-scan-signature-Dugfplms.mjs → source-candidate-scan-signature-BB1hvW68.mjs} +12 -6
- package/dist/{source-candidate-scan-signature-BO6JSskQ.js → source-candidate-scan-signature-CaDT0gkj.js} +16 -9
- package/dist/tailwindcss/v4-engine/css-macro-source.d.ts +2 -0
- package/dist/{tailwindcss-B5mRo0-M.mjs → tailwindcss-D0JF0fuZ.mjs} +6 -6
- package/dist/{tailwindcss-dbrbY4cd.js → tailwindcss-D2xs4OEu.js} +11 -11
- package/dist/{transform-DeqFRp1D.mjs → transform-BP86eSZp.mjs} +19 -19
- package/dist/{transform-BLleu_bA.js → transform-CXCQ28Tc.js} +47 -47
- package/dist/{utils-BCa37Wqj.js → utils-D3h8j7Mk.js} +2 -2
- package/dist/{v4-engine-C3qSwQ-e.mjs → v4-engine-BuuYDXt1.mjs} +58 -118
- package/dist/{v4-engine-ON_oSLfO.js → v4-engine-CKtsdKxK.js} +66 -120
- package/dist/{vite-CXmUiI9f.mjs → vite-B1SlBmqO.mjs} +436 -73
- package/dist/{vite-Da4uEG_u.js → vite-BYgT1ir9.js} +443 -80
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +143 -216
- package/dist/weapp-tw-runtime-classset-loader.js +2 -2
- package/dist/{webpack-CrFZmdo7.mjs → webpack-Bg6pefpb.mjs} +109 -18
- package/dist/{webpack-Cwqnznng.js → webpack-khSwkXP5.js} +115 -24
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +9 -4
- package/dist/auto-Ba6hDrse.mjs +0 -13
- /package/dist/{chunk-emK7D4bc.js → rolldown-runtime-emK7D4bc.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as hasTailwindRootDirectives, D as normalizeTailwindSourceForGenerator, G as getTailwindV4IncrementalGenerateCacheStats, T as normalizeTailwindConfigDirectives, U as prependConfigDirective, o as hasConfiguredTailwindV4CssRoots, s as upsertTailwindV4CssSource } from "./v4-engine-
|
|
2
|
-
import { S as createDebug, b as ensureRuntimeClassSet, l as shouldSkipJsTransform, n as normalizeStyleHandlerMajorVersion, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-
|
|
3
|
-
import { l as getRuntimeClassSetSignature, p as resolveViteSourceScanEntries } from "./tailwindcss-
|
|
4
|
-
import { F as createCssTokenSourceMap, L as processCachedTask, N as annotateCssSourceTrace, P as createCssSourceTraceCacheSignature, n as emitHmrTiming, r as createSourceCandidateCollector, s as createBundleRuntimeClassSetManager, u as generateCssByGenerator, v as rewriteLocalCssImportRequestsForOutput, y as splitLocalCssImports } from "./hmr-timing-
|
|
1
|
+
import { C as hasTailwindRootDirectives, D as normalizeTailwindSourceForGenerator, G as getTailwindV4IncrementalGenerateCacheStats, T as normalizeTailwindConfigDirectives, U as prependConfigDirective, o as hasConfiguredTailwindV4CssRoots, s as upsertTailwindV4CssSource } from "./v4-engine-BuuYDXt1.mjs";
|
|
2
|
+
import { S as createDebug, b as ensureRuntimeClassSet, l as shouldSkipJsTransform, n as normalizeStyleHandlerMajorVersion, t as getCompilerContext, y as createTailwindRuntimeReadyPromise } from "./context-Bkpmt3ja.mjs";
|
|
3
|
+
import { l as getRuntimeClassSetSignature, p as resolveViteSourceScanEntries } from "./tailwindcss-D0JF0fuZ.mjs";
|
|
4
|
+
import { F as createCssTokenSourceMap, L as processCachedTask, N as annotateCssSourceTrace, P as createCssSourceTraceCacheSignature, n as emitHmrTiming, r as createSourceCandidateCollector, s as createBundleRuntimeClassSetManager, u as generateCssByGenerator, v as rewriteLocalCssImportRequestsForOutput, y as splitLocalCssImports } from "./hmr-timing-BRNaz8Od.mjs";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_v4_engine = require("./v4-engine-
|
|
3
|
-
const require_context = require("./context-
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
|
+
const require_v4_engine = require("./v4-engine-CKtsdKxK.js");
|
|
3
|
+
const require_context = require("./context-DCVMkTRj.js");
|
|
4
|
+
const require_tailwindcss = require("./tailwindcss-D2xs4OEu.js");
|
|
5
|
+
const require_hmr_timing = require("./hmr-timing-BV6nFPoT.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
|
-
node_fs =
|
|
7
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
8
8
|
let node_path = require("node:path");
|
|
9
|
-
node_path =
|
|
9
|
+
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
10
10
|
let node_process = require("node:process");
|
|
11
|
-
node_process =
|
|
11
|
+
node_process = require_rolldown_runtime.__toESM(node_process);
|
|
12
12
|
let node_buffer = require("node:buffer");
|
|
13
13
|
let node_stream = require("node:stream");
|
|
14
|
-
node_stream =
|
|
14
|
+
node_stream = require_rolldown_runtime.__toESM(node_stream);
|
|
15
|
+
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
15
16
|
//#region src/bundlers/gulp/module-graph.ts
|
|
16
17
|
const MODULE_EXTENSIONS = [
|
|
17
18
|
".js",
|
|
@@ -313,7 +314,7 @@ function createPlugins(options = {}) {
|
|
|
313
314
|
const sourceFile = node_path.default.resolve(file.path);
|
|
314
315
|
const sourceCss = require_v4_engine.normalizeTailwindSourceForGenerator(require_v4_engine.normalizeTailwindConfigDirectives(rawSource, node_path.default.dirname(sourceFile)), { importFallback: true });
|
|
315
316
|
const config = runtimeState.tailwindRuntime.options?.tailwindcss?.config;
|
|
316
|
-
const generatorSourceCss = require_v4_engine.prependConfigDirective(
|
|
317
|
+
const generatorSourceCss = require_v4_engine.prependConfigDirective((0, _weapp_tailwindcss_postcss.splitLocalCssImports)(sourceCss)?.source ?? sourceCss, config);
|
|
317
318
|
if (!require_v4_engine.upsertTailwindV4CssSource(opts, {
|
|
318
319
|
file: sourceFile,
|
|
319
320
|
base: node_path.default.dirname(sourceFile),
|
|
@@ -444,7 +445,7 @@ function createPlugins(options = {}) {
|
|
|
444
445
|
async transform() {
|
|
445
446
|
await runtimeState.readyPromise;
|
|
446
447
|
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, rawSource, options);
|
|
447
|
-
const outputCss =
|
|
448
|
+
const outputCss = (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(require_hmr_timing.annotateCssSourceTrace((shouldUseGenerator ? await require_hmr_timing.generateCssByGenerator({
|
|
448
449
|
opts,
|
|
449
450
|
runtimeState,
|
|
450
451
|
runtime: nextRuntimeSet,
|
package/dist/gulp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_gulp = require("./gulp-Bogfnoki.js");
|
|
3
3
|
exports.WeappTailwindcss = require_gulp.createPlugins;
|
|
4
4
|
exports.createPlugins = require_gulp.createPlugins;
|
|
5
5
|
exports.weappTailwindcss = require_gulp.createPlugins;
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlugins } from "./gulp-
|
|
1
|
+
import { t as createPlugins } from "./gulp-0RsqkF_d.mjs";
|
|
2
2
|
export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as resolveCssEntrySource, B as stripTailwindBanner, C as hasTailwindRootDirectives, E as normalizeTailwindSourceDirectives, F as hasTailwindGeneratedCssMarkers, H as normalizeConfigDirective, I as splitGeneratorPlaceholderCssBySourceOrder, J as FULL_SOURCE_SCAN_EXTENSION_RE, L as splitTailwindGeneratedCssByBanner, M as VITE_MARKER_RE, N as createCssAppend, O as parseImportRequest, P as hasTailwindGeneratedCss, Q as isFileMatchedByTailwindSourceEntries, R as splitTailwindV4GeneratedCssBySourceOrder, U as prependConfigDirective, V as stripTailwindBanners, i as resolveTailwindV4SourceOptionsFromRuntime, it as toPosixPath$1, j as GENERATOR_PLACEHOLDER_MARKER_RE, k as removeTailwindSourceDirectives,
|
|
2
|
-
import { a as resolveGeneratorRuntimeBranch, i as normalizeWeappTailwindcssGeneratorOptions, s as shouldUseMiniProgramCssBranch, t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import {
|
|
4
|
-
import { h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, r as isUniAppXEnabled } from "./tailwindcss-
|
|
1
|
+
import { A as resolveCssEntrySource, B as stripTailwindBanner, C as hasTailwindRootDirectives, E as normalizeTailwindSourceDirectives, F as hasTailwindGeneratedCssMarkers, H as normalizeConfigDirective, I as splitGeneratorPlaceholderCssBySourceOrder, J as FULL_SOURCE_SCAN_EXTENSION_RE, L as splitTailwindGeneratedCssByBanner, M as VITE_MARKER_RE, N as createCssAppend, O as parseImportRequest, P as hasTailwindGeneratedCss, Q as isFileMatchedByTailwindSourceEntries, R as splitTailwindV4GeneratedCssBySourceOrder, U as prependConfigDirective, V as stripTailwindBanners, ct as omitUndefined, i as resolveTailwindV4SourceOptionsFromRuntime, it as toPosixPath$1, j as GENERATOR_PLACEHOLDER_MARKER_RE, k as removeTailwindSourceDirectives, n as resolveTailwindV4SourceFromRuntime, nt as resolveSourceScanPath, rt as resolveTailwindV4CssSourceBase, st as filterUnsupportedMiniProgramTailwindV4Candidates, t as resolveTailwindV4Source$1, ut as loadTailwindV4DesignSystem, w as hasTailwindSourceDirectives, x as hasTailwindApplyDirective, z as stripGeneratorPlaceholderMarkers } from "./v4-engine-BuuYDXt1.mjs";
|
|
2
|
+
import { a as resolveGeneratorRuntimeBranch, i as normalizeWeappTailwindcssGeneratorOptions, s as shouldUseMiniProgramCssBranch, t as createWeappTailwindcssGenerator } from "./generator-24-HgU9F.mjs";
|
|
3
|
+
import { S as createDebug, g as traverse, h as babelParse, m as replaceWxml, r as resolveStyleOptionsFromContext, w as md5Hash } from "./context-Bkpmt3ja.mjs";
|
|
4
|
+
import { h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, r as isUniAppXEnabled } from "./tailwindcss-D0JF0fuZ.mjs";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { extractRawCandidatesWithPositions, extractSourceCandidates, extractValidCandidates, resolveProjectSourceFiles, resolveValidTailwindV4Candidates, splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
9
|
-
import { filterExistingCssRules, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, postcss, pruneMiniProgramGeneratedCss, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, stripMiniProgramCssSpecificityPlaceholders, transformWebCssCompat } from "@weapp-tailwindcss/postcss";
|
|
9
|
+
import { cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, filterExistingCssRules, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, postcss, pruneMiniProgramGeneratedCss, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, splitLocalCssImports, splitLocalCssImportsRoot, stripMiniProgramCssSpecificityPlaceholders, transformWebCssCompat } from "@weapp-tailwindcss/postcss";
|
|
10
10
|
import { LRUCache } from "lru-cache";
|
|
11
11
|
import { readFile } from "node:fs/promises";
|
|
12
12
|
import { MappingChars2String, unescape } from "@weapp-core/escape";
|
|
@@ -158,8 +158,10 @@ function hasMiniProgramTailwindV4PreflightReset(css) {
|
|
|
158
158
|
}
|
|
159
159
|
function finalizeMiniProgramGeneratorCss(css, target, _majorVersion, cssPreflight, options = {}) {
|
|
160
160
|
if (target !== "weapp") return css;
|
|
161
|
+
const injectPreflight = options.injectPreflight !== false && !hasMiniProgramTailwindV4PreflightReset(css);
|
|
161
162
|
return finalizeMiniProgramCss(css, {
|
|
162
|
-
cssPreflight:
|
|
163
|
+
cssPreflight: cssPreflight === false ? false : injectPreflight ? cssPreflight : void 0,
|
|
164
|
+
cssSelectorReplacement: options.styleOptions?.cssOptions?.cssSelectorReplacement ?? options.styleOptions?.cssSelectorReplacement,
|
|
163
165
|
isTailwindcssV4: true,
|
|
164
166
|
tailwindcssV4GradientFallback: options.styleOptions?.cssOptions?.tailwindcssV4GradientFallback ?? options.styleOptions?.tailwindcssV4GradientFallback
|
|
165
167
|
});
|
|
@@ -171,11 +173,11 @@ function shouldInjectMiniProgramPreflightForGeneratorCss(opts, options) {
|
|
|
171
173
|
}
|
|
172
174
|
function mergeScopedRuntimeWithCurrentRuntime(scopedRuntime, runtime, options) {
|
|
173
175
|
if (options.isolateCssSource) {
|
|
174
|
-
if (options.matchedCssSourceFile) return new Set([...scopedRuntime, ...options.currentCssCandidates ?? []]);
|
|
175
|
-
return new Set([...scopedRuntime, ...options.currentCssCandidates ?? []]);
|
|
176
|
+
if (options.matchedCssSourceFile) return /* @__PURE__ */ new Set([...scopedRuntime, ...options.currentCssCandidates ?? []]);
|
|
177
|
+
return /* @__PURE__ */ new Set([...scopedRuntime, ...options.currentCssCandidates ?? []]);
|
|
176
178
|
}
|
|
177
179
|
if (runtime.size === 0 || !options.cssHandlerOptions.isMainChunk) return scopedRuntime;
|
|
178
|
-
return new Set([...scopedRuntime, ...runtime]);
|
|
180
|
+
return /* @__PURE__ */ new Set([...scopedRuntime, ...runtime]);
|
|
179
181
|
}
|
|
180
182
|
function shouldIsolateScopedCssSource(_majorVersion, source, sourceEntries, options) {
|
|
181
183
|
if (options.target !== "weapp") return false;
|
|
@@ -237,7 +239,7 @@ function shouldUseGeneratorForCurrentCss(_majorVersion, cssHandlerOptions, optio
|
|
|
237
239
|
return options.forceGenerator === true || options.hasGeneratedCss || options.hasGeneratedMarkers || options.hasSourceDirectives || hasApplyDirectives || hasSourceCssDirectives || cssHandlerOptions.isMainChunk && (options.configuredCssSourceCount ?? 0) > 0 || cssHandlerOptions.isMainChunk && options.rawSource.includes("weapp-tailwindcss") || options.target === "web" && cssHandlerOptions.isMainChunk && (options.runtimeCandidateCount ?? 0) > 0;
|
|
238
240
|
}
|
|
239
241
|
function createRuntimeWithCurrentCssCandidates(runtime, currentCssCandidates, isolateCurrentCssCandidates) {
|
|
240
|
-
return isolateCurrentCssCandidates ? new Set(currentCssCandidates) : currentCssCandidates.length > 0 ? new Set([...runtime, ...currentCssCandidates]) : runtime;
|
|
242
|
+
return isolateCurrentCssCandidates ? new Set(currentCssCandidates) : currentCssCandidates.length > 0 ? /* @__PURE__ */ new Set([...runtime, ...currentCssCandidates]) : runtime;
|
|
241
243
|
}
|
|
242
244
|
function mergeGeneratorResults(generatedResults) {
|
|
243
245
|
const firstGenerated = generatedResults[0];
|
|
@@ -259,7 +261,7 @@ function mergeGeneratorResults(generatedResults) {
|
|
|
259
261
|
//#endregion
|
|
260
262
|
//#region src/bundlers/shared/generator-css/legacy-selectors.ts
|
|
261
263
|
const CLASS_SELECTOR_RE = /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i;
|
|
262
|
-
const MINI_PROGRAM_THEME_SCOPE_SELECTORS = new Set([
|
|
264
|
+
const MINI_PROGRAM_THEME_SCOPE_SELECTORS = /* @__PURE__ */ new Set([
|
|
263
265
|
":host",
|
|
264
266
|
"page",
|
|
265
267
|
".tw-root",
|
|
@@ -322,7 +324,7 @@ function escapeCompatSelectorClasses(selector) {
|
|
|
322
324
|
function normalizeCompatSelectors(selector) {
|
|
323
325
|
const normalized = normalizeCompatSelector(selector);
|
|
324
326
|
if (!normalized) return [];
|
|
325
|
-
const selectors = new Set([normalized]);
|
|
327
|
+
const selectors = /* @__PURE__ */ new Set([normalized]);
|
|
326
328
|
const escaped = normalizeCompatSelector(escapeCompatSelectorClasses(normalized));
|
|
327
329
|
if (escaped) selectors.add(escaped);
|
|
328
330
|
return [...selectors];
|
|
@@ -673,7 +675,7 @@ function resolveSourceSideCssEntrySource(file, sourceOptions, resolveOptions = {
|
|
|
673
675
|
for (const sourceFile of createSourceStylePathCandidates(file, sourceOptions)) try {
|
|
674
676
|
const source = sourceOptions.sourceFile && path.resolve(sourceOptions.sourceFile) === path.resolve(sourceFile) && typeof sourceOptions.sourceCss === "string" ? sourceOptions.sourceCss : existsSync(sourceFile) ? readFileSync(sourceFile, "utf8") : void 0;
|
|
675
677
|
if (source === void 0) continue;
|
|
676
|
-
const directiveSources = extractStyleDirectiveSourcesDeep(source, sourceFile, new Set([path.resolve(sourceFile)]));
|
|
678
|
+
const directiveSources = extractStyleDirectiveSourcesDeep(source, sourceFile, /* @__PURE__ */ new Set([path.resolve(sourceFile)]));
|
|
677
679
|
for (const styleSource of directiveSources) {
|
|
678
680
|
const cssEntrySource = resolveCssEntrySource(styleSource.source, path.dirname(styleSource.file), resolveOptions);
|
|
679
681
|
if (cssEntrySource) return {
|
|
@@ -880,7 +882,8 @@ function createSingleTailwindV4SourceOptions(sourceOptions, options) {
|
|
|
880
882
|
baseFallbacks: sourceOptions.baseFallbacks,
|
|
881
883
|
packageName: sourceOptions.packageName,
|
|
882
884
|
base: options.base,
|
|
883
|
-
css: options.css
|
|
885
|
+
css: options.css,
|
|
886
|
+
cssEntries: options.cssEntries
|
|
884
887
|
});
|
|
885
888
|
}
|
|
886
889
|
async function resolveTailwindV4CssEntrySource(cssEntry, sourceOptions) {
|
|
@@ -971,7 +974,7 @@ function hydrateTailwindV4CssSource(cssSource) {
|
|
|
971
974
|
file,
|
|
972
975
|
base: cssSource.base ?? path.dirname(file),
|
|
973
976
|
css: readFileSync(file, "utf8"),
|
|
974
|
-
dependencies: [
|
|
977
|
+
dependencies: [.../* @__PURE__ */ new Set([...cssSource.dependencies ?? [], file])]
|
|
975
978
|
};
|
|
976
979
|
}
|
|
977
980
|
function normalizeTailwindV4CssSourceConfigs(sourceOptions) {
|
|
@@ -1087,7 +1090,8 @@ async function resolveTailwindV4SourceSideEntrySource(resolvedEntrySource, sourc
|
|
|
1087
1090
|
const css = createTailwindV4SourceReferenceSource(normalizeConfigDirective(prependConfigDirective(resolvedEntrySource.css, generatorOptions?.config), config), resolvedSourceOptions);
|
|
1088
1091
|
return withMatchedSourceSideMetadata(await resolveTailwindV4Source$1(createSingleTailwindV4SourceOptions(resolvedSourceOptions, {
|
|
1089
1092
|
base: resolvedEntrySource.base,
|
|
1090
|
-
css
|
|
1093
|
+
css,
|
|
1094
|
+
cssEntries: [resolvedEntrySource.file]
|
|
1091
1095
|
})), resolvedEntrySource);
|
|
1092
1096
|
}
|
|
1093
1097
|
async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions) {
|
|
@@ -1118,6 +1122,8 @@ async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, fi
|
|
|
1118
1122
|
}
|
|
1119
1123
|
const shouldPreferSourceSideEntry = shouldResolveSourceSideCssEntry(rawSource) || Boolean(cssEntrySource?.css.includes("weapp-tailwindcss generator-placeholder")) && (sourceOptions?.cssEntries?.length ?? 0) <= 1;
|
|
1120
1124
|
const sourceSideEntrySource = normalizedSourceOptions && (shouldPreferSourceSideEntry || normalizedSourceOptions.sourceFile !== void 0) && canResolveSourceSideCssEntry(file, cssHandlerOptions, normalizedSourceOptions) ? resolveSourceSideCssEntrySource(file, normalizedSourceOptions, { removeConfig: false }) : void 0;
|
|
1125
|
+
const sourceSideCssSource = sourceSideEntrySource?.file && normalizedSourceOptions.cssEntries?.some((cssEntry) => path.resolve(cssEntry.replace(/[?#].*$/, "")) === path.resolve(sourceSideEntrySource.file)) ? await resolveTailwindV4SourceSideEntrySource(sourceSideEntrySource, normalizedSourceOptions, generatorOptions, file) : void 0;
|
|
1126
|
+
if (sourceSideCssSource) return sourceSideCssSource;
|
|
1121
1127
|
const matchedCssEntrySource = normalizedSourceOptions ? await resolveMatchingTailwindV4CssEntry(rawSource, file, normalizedSourceOptions) : void 0;
|
|
1122
1128
|
const matchedCssSource = normalizedSourceOptions && !matchedCssEntrySource ? await resolveMatchingTailwindV4CssSource(rawSource, file, cssHandlerOptions, normalizedSourceOptions) : void 0;
|
|
1123
1129
|
const candidateMatchedCssSource = normalizedSourceOptions && !matchedCssEntrySource ? await resolveCandidateMatchedTailwindV4CssSource(rawSource, cssHandlerOptions, normalizedSourceOptions, selectionOptions) : void 0;
|
|
@@ -1141,7 +1147,6 @@ async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, fi
|
|
|
1141
1147
|
css: prependConfigDirective(source.css, generatorOptions.config)
|
|
1142
1148
|
} : source;
|
|
1143
1149
|
}
|
|
1144
|
-
if (sourceSideEntrySource && normalizedSourceOptions) return resolveTailwindV4SourceSideEntrySource(sourceSideEntrySource, normalizedSourceOptions, generatorOptions, file);
|
|
1145
1150
|
const config = resolveExistingConfigPath(resolvedEntrySource.config, resolvedEntrySource.configRequest, file, omitUndefined({
|
|
1146
1151
|
...resolvedSourceOptions ?? {},
|
|
1147
1152
|
sourceFile: resolvedEntrySource.file ?? resolvedSourceOptions?.sourceFile ?? resolvePostcssSourceFile(cssHandlerOptions)
|
|
@@ -1241,7 +1246,7 @@ async function resolveGeneratorSourceEntries(source, runtimeState) {
|
|
|
1241
1246
|
}
|
|
1242
1247
|
//#endregion
|
|
1243
1248
|
//#region src/bundlers/shared/generator-css/user-css.ts
|
|
1244
|
-
const TAILWIND_V4_GENERATOR_AT_RULES = new Set([
|
|
1249
|
+
const TAILWIND_V4_GENERATOR_AT_RULES = /* @__PURE__ */ new Set([
|
|
1245
1250
|
"config",
|
|
1246
1251
|
"custom-variant",
|
|
1247
1252
|
"plugin",
|
|
@@ -1996,133 +2001,6 @@ function inheritLegacyUnitConvertedDeclarations(css, legacyCss) {
|
|
|
1996
2001
|
}
|
|
1997
2002
|
}
|
|
1998
2003
|
//#endregion
|
|
1999
|
-
//#region src/bundlers/shared/generator-css/local-imports.ts
|
|
2000
|
-
const REMOTE_IMPORT_RE = /^(?:https?:)?\/\//i;
|
|
2001
|
-
const CSS_STYLE_EXTENSION_RE = /\.(?:css|wxss|acss|ttss|qss|jxss|tyss|scss|sass|less|styl|stylus|pcss|postcss)(?:$|[?#])/i;
|
|
2002
|
-
const SOURCE_STYLE_EXTENSION_RE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)(?:$|[?#])/i;
|
|
2003
|
-
function createCssSourceOrderAppend(base, extra) {
|
|
2004
|
-
if (!base) return extra;
|
|
2005
|
-
if (!extra) return base;
|
|
2006
|
-
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
2007
|
-
return `${base}\n${extra}`;
|
|
2008
|
-
}
|
|
2009
|
-
function isLocalImportRequest(request) {
|
|
2010
|
-
return request.length > 0 && !request.startsWith("#") && !request.startsWith("tailwindcss") && !request.startsWith("weapp-tailwindcss") && !request.startsWith("data:") && !REMOTE_IMPORT_RE.test(request);
|
|
2011
|
-
}
|
|
2012
|
-
function isPureLocalCssImportWrapper(css) {
|
|
2013
|
-
let hasImport = false;
|
|
2014
|
-
try {
|
|
2015
|
-
const root = postcss.parse(css);
|
|
2016
|
-
for (const node of root.nodes) {
|
|
2017
|
-
if (node.type === "comment") continue;
|
|
2018
|
-
if (node.type !== "atrule" || node.name !== "import") return false;
|
|
2019
|
-
const request = parseImportRequest(node.params);
|
|
2020
|
-
if (!request || !isLocalImportRequest(request)) return false;
|
|
2021
|
-
hasImport = true;
|
|
2022
|
-
}
|
|
2023
|
-
} catch {
|
|
2024
|
-
return false;
|
|
2025
|
-
}
|
|
2026
|
-
return hasImport;
|
|
2027
|
-
}
|
|
2028
|
-
function cleanLocalCssImportWrapperTailwindDirectives(css) {
|
|
2029
|
-
let hasLocalImport = false;
|
|
2030
|
-
let hasTailwindDirective = false;
|
|
2031
|
-
try {
|
|
2032
|
-
const root = postcss.parse(css);
|
|
2033
|
-
for (const node of root.nodes) {
|
|
2034
|
-
if (node.type === "comment") continue;
|
|
2035
|
-
if (node.type === "atrule" && node.name === "import") {
|
|
2036
|
-
const request = parseImportRequest(node.params);
|
|
2037
|
-
if (!request || !isLocalImportRequest(request)) return;
|
|
2038
|
-
hasLocalImport = true;
|
|
2039
|
-
continue;
|
|
2040
|
-
}
|
|
2041
|
-
if (node.type === "atrule" && node.name === "source") {
|
|
2042
|
-
hasTailwindDirective = true;
|
|
2043
|
-
continue;
|
|
2044
|
-
}
|
|
2045
|
-
return;
|
|
2046
|
-
}
|
|
2047
|
-
} catch {
|
|
2048
|
-
return;
|
|
2049
|
-
}
|
|
2050
|
-
return hasLocalImport && hasTailwindDirective ? prefixLocalCssImportsWithWebpackIgnore(removeTailwindSourceDirectives(css)) : void 0;
|
|
2051
|
-
}
|
|
2052
|
-
function prefixLocalCssImportsWithWebpackIgnore(css) {
|
|
2053
|
-
try {
|
|
2054
|
-
const root = postcss.parse(css);
|
|
2055
|
-
root.walkAtRules("import", (atRule) => {
|
|
2056
|
-
const request = parseImportRequest(atRule.params);
|
|
2057
|
-
if (request && isLocalImportRequest(request)) atRule.raws.before = `${atRule.raws.before ?? ""}/* webpackIgnore: true */\n`;
|
|
2058
|
-
});
|
|
2059
|
-
return root.toString();
|
|
2060
|
-
} catch {
|
|
2061
|
-
return css;
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
function splitLocalCssImports(source) {
|
|
2065
|
-
try {
|
|
2066
|
-
const root = postcss.parse(source);
|
|
2067
|
-
const importRoot = postcss.root();
|
|
2068
|
-
let changed = false;
|
|
2069
|
-
for (const node of [...root.nodes]) {
|
|
2070
|
-
if (node.type !== "atrule" || node.name !== "import") continue;
|
|
2071
|
-
const request = parseImportRequest(node.params);
|
|
2072
|
-
if (!request || !isLocalImportRequest(request)) continue;
|
|
2073
|
-
importRoot.append(node.clone());
|
|
2074
|
-
node.remove();
|
|
2075
|
-
changed = true;
|
|
2076
|
-
}
|
|
2077
|
-
const imports = importRoot.nodes.filter((node) => node.type === "atrule" && node.name === "import").map((node) => `@import ${node.params};`).join("\n");
|
|
2078
|
-
return changed ? {
|
|
2079
|
-
imports,
|
|
2080
|
-
source: root.toString()
|
|
2081
|
-
} : void 0;
|
|
2082
|
-
} catch {
|
|
2083
|
-
return;
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
function restoreLocalCssImports(css, imports) {
|
|
2087
|
-
if (!imports?.trim()) return css;
|
|
2088
|
-
return createCssSourceOrderAppend(imports, css);
|
|
2089
|
-
}
|
|
2090
|
-
function splitRequestSuffix(request) {
|
|
2091
|
-
const suffixIndexCandidates = [request.indexOf("?"), request.indexOf("#")].filter((index) => index >= 0);
|
|
2092
|
-
const suffixIndex = suffixIndexCandidates.length > 0 ? Math.min(...suffixIndexCandidates) : -1;
|
|
2093
|
-
if (suffixIndex < 0) return {
|
|
2094
|
-
clean: request,
|
|
2095
|
-
suffix: ""
|
|
2096
|
-
};
|
|
2097
|
-
return {
|
|
2098
|
-
clean: request.slice(0, suffixIndex),
|
|
2099
|
-
suffix: request.slice(suffixIndex)
|
|
2100
|
-
};
|
|
2101
|
-
}
|
|
2102
|
-
function normalizeOutputImportRequest(request, styleOutputExtension) {
|
|
2103
|
-
const normalizedStyleOutputExtension = styleOutputExtension?.startsWith(".") ? styleOutputExtension : styleOutputExtension ? `.${styleOutputExtension}` : void 0;
|
|
2104
|
-
const { clean, suffix } = splitRequestSuffix(request.replace(/\\/g, "/"));
|
|
2105
|
-
return `${clean.replace(/^(?:\.\/)?src\//, "./").replace(SOURCE_STYLE_EXTENSION_RE, normalizedStyleOutputExtension ?? ".css")}${suffix}`;
|
|
2106
|
-
}
|
|
2107
|
-
function rewriteLocalCssImportRequestsForOutput(css, options = {}) {
|
|
2108
|
-
if (!css.includes("@import")) return css;
|
|
2109
|
-
try {
|
|
2110
|
-
const root = postcss.parse(css);
|
|
2111
|
-
let changed = false;
|
|
2112
|
-
root.walkAtRules("import", (atRule) => {
|
|
2113
|
-
const request = parseImportRequest(atRule.params);
|
|
2114
|
-
if (!request || !isLocalImportRequest(request) || !CSS_STYLE_EXTENSION_RE.test(request)) return;
|
|
2115
|
-
const rewritten = normalizeOutputImportRequest(request, options.styleOutputExtension);
|
|
2116
|
-
if (rewritten === request) return;
|
|
2117
|
-
atRule.params = atRule.params.replace(request, rewritten);
|
|
2118
|
-
changed = true;
|
|
2119
|
-
});
|
|
2120
|
-
return changed ? root.toString() : css;
|
|
2121
|
-
} catch {
|
|
2122
|
-
return css;
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
//#endregion
|
|
2126
2004
|
//#region src/bundlers/shared/generator-css/user-layer-order.ts
|
|
2127
2005
|
const USER_LAYER_COMPONENTS_START = "/*! weapp-tailwindcss layer components start */";
|
|
2128
2006
|
const USER_LAYER_COMPONENTS_END = "/*! weapp-tailwindcss layer components end */";
|
|
@@ -2320,6 +2198,23 @@ function intersectCandidateSets(left, right) {
|
|
|
2320
2198
|
for (const candidate of small) if (large.has(candidate)) matched.add(candidate);
|
|
2321
2199
|
return matched;
|
|
2322
2200
|
}
|
|
2201
|
+
function parseCssSourceRoot(rawSource) {
|
|
2202
|
+
try {
|
|
2203
|
+
return postcss.parse(rawSource);
|
|
2204
|
+
} catch {
|
|
2205
|
+
return;
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
function cleanLocalCssImportWrapperFromParsedRoot(rawSource, root) {
|
|
2209
|
+
if (!root) return cleanLocalCssImportWrapperTailwindDirectives(rawSource);
|
|
2210
|
+
return cleanLocalCssImportWrapperTailwindDirectivesRoot(root) ? root.toString() : void 0;
|
|
2211
|
+
}
|
|
2212
|
+
function isPureLocalCssImportWrapperFromParsedRoot(rawSource, root) {
|
|
2213
|
+
return root ? isPureLocalCssImportWrapperRoot(root) : isPureLocalCssImportWrapper(rawSource);
|
|
2214
|
+
}
|
|
2215
|
+
function splitLocalCssImportsFromParsedRoot(rawSource, root) {
|
|
2216
|
+
return root ? splitLocalCssImportsRoot(root) : splitLocalCssImports(rawSource);
|
|
2217
|
+
}
|
|
2323
2218
|
function collectCssRuleIdentityMarkers(source) {
|
|
2324
2219
|
const markers = /* @__PURE__ */ new Set();
|
|
2325
2220
|
try {
|
|
@@ -2368,20 +2263,8 @@ async function generateCssByGenerator(options) {
|
|
|
2368
2263
|
const majorVersion = runtimeState.tailwindRuntime.majorVersion;
|
|
2369
2264
|
if (majorVersion !== 4) throw new Error("weapp-tailwindcss 生成管线仅支持 Tailwind CSS v4。");
|
|
2370
2265
|
const effectiveRawSource = stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(normalizeTailwindSourceDirectives(rawSource, { importFallback: generatorOptions.importFallback })));
|
|
2371
|
-
const
|
|
2372
|
-
const
|
|
2373
|
-
const finalizeGeneratorCss = (css, target, finalizeOptions = {}) => {
|
|
2374
|
-
return finalizeWebGeneratorCss(restoreLocalCssImports(finalizeMiniProgramGeneratorCss(css, target, majorVersion, opts.cssPreflight, finalizeOptions), localImports), target, generatorOptions.webCompat);
|
|
2375
|
-
};
|
|
2376
|
-
const generatorRawSource = localImportParts?.source ?? effectiveRawSource;
|
|
2377
|
-
const rawUserSource = userRawSource === void 0 ? generatorRawSource : userRawSourceProcessed ? userRawSource : stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(normalizeTailwindSourceDirectives(userRawSource, { importFallback: generatorOptions.importFallback })));
|
|
2378
|
-
const userSource = splitLocalCssImports(rawUserSource)?.source ?? rawUserSource;
|
|
2379
|
-
const userCssRawSource = removeTailwindV4GeneratorAtRules(userSource);
|
|
2380
|
-
const generatedUserCssOrderSource = hasTailwindGeneratedCss(userSource) ? splitTailwindV4GeneratedCssBySourceOrder(userSource, generatorRawSource) : void 0;
|
|
2381
|
-
const generatedUserCssRawSource = generatedUserCssOrderSource ? createCssAppend(generatedUserCssOrderSource.before, generatedUserCssOrderSource.after) : hasTailwindGeneratedCss(userSource) ? "" : userCssRawSource;
|
|
2382
|
-
const userCssOrderSource = GENERATOR_PLACEHOLDER_MARKER_RE.test(userSource) ? userSource : hasTailwindGeneratedCss(userSource) ? userSource : generatedUserCssRawSource;
|
|
2383
|
-
const hasDistinctUserRawSource = typeof userRawSource === "string" && normalizeCssSourceForCompare(generatedUserCssRawSource) !== normalizeCssSourceForCompare(generatorRawSource);
|
|
2384
|
-
const cleanedLocalImportWrapper = cleanLocalCssImportWrapperTailwindDirectives(effectiveRawSource);
|
|
2266
|
+
const effectiveRawSourceRoot = parseCssSourceRoot(effectiveRawSource);
|
|
2267
|
+
const cleanedLocalImportWrapper = cleanLocalCssImportWrapperFromParsedRoot(effectiveRawSource, effectiveRawSourceRoot);
|
|
2385
2268
|
if (cleanedLocalImportWrapper !== void 0) return {
|
|
2386
2269
|
css: shouldUseMiniProgramCssBranch(generatorBranch) ? removeUnsupportedMiniProgramAtRules(cleanedLocalImportWrapper) : cleanedLocalImportWrapper,
|
|
2387
2270
|
classSet: /* @__PURE__ */ new Set(),
|
|
@@ -2393,7 +2276,20 @@ async function generateCssByGenerator(options) {
|
|
|
2393
2276
|
majorVersion
|
|
2394
2277
|
}
|
|
2395
2278
|
};
|
|
2396
|
-
if (
|
|
2279
|
+
if (isPureLocalCssImportWrapperFromParsedRoot(effectiveRawSource, effectiveRawSourceRoot)) return;
|
|
2280
|
+
const localImportParts = splitLocalCssImportsFromParsedRoot(effectiveRawSource, effectiveRawSourceRoot);
|
|
2281
|
+
const localImports = options.restoreLocalCssImports === false ? void 0 : localImportParts?.imports;
|
|
2282
|
+
const finalizeGeneratorCss = (css, target, finalizeOptions = {}) => {
|
|
2283
|
+
return finalizeWebGeneratorCss(restoreLocalCssImports(finalizeMiniProgramGeneratorCss(css, target, majorVersion, opts.cssPreflight, finalizeOptions), localImports), target, generatorOptions.webCompat);
|
|
2284
|
+
};
|
|
2285
|
+
const generatorRawSource = localImportParts?.source ?? effectiveRawSource;
|
|
2286
|
+
const rawUserSource = userRawSource === void 0 ? generatorRawSource : userRawSourceProcessed ? userRawSource : stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(normalizeTailwindSourceDirectives(userRawSource, { importFallback: generatorOptions.importFallback })));
|
|
2287
|
+
const userSource = (rawUserSource === generatorRawSource ? void 0 : splitLocalCssImports(rawUserSource))?.source ?? rawUserSource;
|
|
2288
|
+
const userCssRawSource = removeTailwindV4GeneratorAtRules(userSource);
|
|
2289
|
+
const generatedUserCssOrderSource = hasTailwindGeneratedCss(userSource) ? splitTailwindV4GeneratedCssBySourceOrder(userSource, generatorRawSource) : void 0;
|
|
2290
|
+
const generatedUserCssRawSource = generatedUserCssOrderSource ? createCssAppend(generatedUserCssOrderSource.before, generatedUserCssOrderSource.after) : hasTailwindGeneratedCss(userSource) ? "" : userCssRawSource;
|
|
2291
|
+
const userCssOrderSource = GENERATOR_PLACEHOLDER_MARKER_RE.test(userSource) ? userSource : hasTailwindGeneratedCss(userSource) ? userSource : generatedUserCssRawSource;
|
|
2292
|
+
const hasDistinctUserRawSource = typeof userRawSource === "string" && normalizeCssSourceForCompare(generatedUserCssRawSource) !== normalizeCssSourceForCompare(generatorRawSource);
|
|
2397
2293
|
const hasGeneratedCss = hasTailwindGeneratedCss(generatorRawSource);
|
|
2398
2294
|
const hasSourceDirectives = hasTailwindSourceDirectives(generatorRawSource, { importFallback: generatorOptions.importFallback });
|
|
2399
2295
|
const hasGeneratedMarkers = hasTailwindGeneratedCssMarkers(generatorRawSource);
|
|
@@ -2742,7 +2638,7 @@ function createRuntimeEntries(snapshot) {
|
|
|
2742
2638
|
return snapshot.entries.filter(isRuntimeCandidateEntry);
|
|
2743
2639
|
}
|
|
2744
2640
|
function collectChangedRuntimeFiles(snapshot) {
|
|
2745
|
-
return new Set([...snapshot.runtimeAffectingChangedByType.html, ...snapshot.runtimeAffectingChangedByType.js]);
|
|
2641
|
+
return /* @__PURE__ */ new Set([...snapshot.runtimeAffectingChangedByType.html, ...snapshot.runtimeAffectingChangedByType.js]);
|
|
2746
2642
|
}
|
|
2747
2643
|
function resolveEntryExtension(entry) {
|
|
2748
2644
|
if (entry.type === "html") return "html";
|
|
@@ -2845,7 +2741,7 @@ function addCandidateSet$1(candidateCountByClass, candidates) {
|
|
|
2845
2741
|
}
|
|
2846
2742
|
}
|
|
2847
2743
|
function createRuntimeClassSet(baseClassSet, candidateCountByClass) {
|
|
2848
|
-
return new Set([...baseClassSet, ...candidateCountByClass.keys()]);
|
|
2744
|
+
return /* @__PURE__ */ new Set([...baseClassSet, ...candidateCountByClass.keys()]);
|
|
2849
2745
|
}
|
|
2850
2746
|
function createNonSourceBaseClassSet(baseClassSet, candidateCountByClass) {
|
|
2851
2747
|
const nextBaseClassSet = new Set(baseClassSet);
|
|
@@ -2976,7 +2872,7 @@ function createBundleRuntimeClassSetManager(options = {}) {
|
|
|
2976
2872
|
}
|
|
2977
2873
|
//#endregion
|
|
2978
2874
|
//#region src/tailwindcss/candidates.ts
|
|
2979
|
-
const SCRIPT_SOURCE_CANDIDATE_EXTENSIONS = new Set([
|
|
2875
|
+
const SCRIPT_SOURCE_CANDIDATE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
2980
2876
|
"js",
|
|
2981
2877
|
"jsx",
|
|
2982
2878
|
"mjs",
|
|
@@ -3268,7 +3164,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
3268
3164
|
}
|
|
3269
3165
|
function recompute(id) {
|
|
3270
3166
|
const normalizedId = cleanUrl(id);
|
|
3271
|
-
replaceFinal(normalizedId, new Set([
|
|
3167
|
+
replaceFinal(normalizedId, /* @__PURE__ */ new Set([
|
|
3272
3168
|
...scanCandidatesById.get(normalizedId) ?? [],
|
|
3273
3169
|
...transformCandidatesById.get(normalizedId) ?? [],
|
|
3274
3170
|
...cssCandidatesById.get(normalizedId) ?? []
|
|
@@ -3299,7 +3195,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
3299
3195
|
return mergeSourcesByPriority().entries();
|
|
3300
3196
|
}
|
|
3301
3197
|
function values() {
|
|
3302
|
-
const values = new Set([...candidateCount.keys(), ...inlineIncludedCandidates]);
|
|
3198
|
+
const values = /* @__PURE__ */ new Set([...candidateCount.keys(), ...inlineIncludedCandidates]);
|
|
3303
3199
|
for (const candidate of inlineExcludedCandidates) values.delete(candidate);
|
|
3304
3200
|
return values;
|
|
3305
3201
|
}
|
|
@@ -3403,7 +3299,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
3403
3299
|
for (const [id, source] of snapshot.scanSourceById ?? snapshot.sourceById ?? []) scanSourceById.set(id, source);
|
|
3404
3300
|
for (const [id, source] of snapshot.transformSourceById ?? []) transformSourceById.set(id, source);
|
|
3405
3301
|
for (const [id, source] of snapshot.cssSourceById ?? []) cssSourceById.set(id, source);
|
|
3406
|
-
const ids = new Set([
|
|
3302
|
+
const ids = /* @__PURE__ */ new Set([
|
|
3407
3303
|
...scanCandidatesById.keys(),
|
|
3408
3304
|
...transformCandidatesById.keys(),
|
|
3409
3305
|
...cssCandidatesById.keys()
|