weapp-tailwindcss 5.5.1 → 5.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundlers/shared/css-imports.d.ts +1 -0
- package/dist/bundlers/shared/framework-user-css.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +6 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -1
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -0
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/entry-style-graph.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +1 -0
- package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +3 -1
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +1 -0
- package/dist/compiler/runtime-snapshot.d.ts +4 -1
- package/dist/{compiler-D2ZJc3uA.cjs → compiler-BSMSbVVt.cjs} +6 -6
- package/dist/{compiler-B0YSc0DY.js → compiler-tHMcW3BT.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{css-imports-BFMU7Hpd.cjs → css-imports-DsCSPIj2.cjs} +29 -0
- package/dist/{css-loader-runtime-CSv0lKqV.cjs → css-loader-runtime-DGqsWVua.cjs} +2 -1
- package/dist/{defaults-B5ep0ojb.js → defaults-CKx-4LcW.js} +1 -1
- package/dist/{defaults-BI9j1znS.cjs → defaults-CiGsr8Xq.cjs} +1 -1
- package/dist/defaults.cjs +1 -1
- package/dist/defaults.js +1 -1
- package/dist/{generator-DsrQ9txU.cjs → generator-CCw17l0G.cjs} +72 -67
- package/dist/{generator-DyXTBPmE.js → generator-DxEsInLz.js} +61 -68
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-C9ENAx3f.cjs → gulp-C1r36Y_f.cjs} +5 -5
- package/dist/{gulp-DXeQfvVC.js → gulp-qGXKwQMZ.js} +4 -4
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-DNxQm-bN.js → hmr-timing-DixZjtTS.js} +245 -183
- package/dist/{hmr-timing-Cz4IesEM.cjs → hmr-timing-DuIbach8.cjs} +5 -5
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{pipeline-helpers-CSGnR5gh.cjs → pipeline-helpers-CUwwOFt3.cjs} +4 -4
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +2 -2
- package/dist/presets.js +2 -2
- package/dist/rspack.cjs +6 -3
- package/dist/rspack.js +6 -3
- package/dist/{scoped-generator-kRj_5Axx.js → scoped-generator-BJvL2CKZ.js} +3 -3
- package/dist/{scoped-generator-TVjEaOeP.cjs → scoped-generator-CO9xZ06m.cjs} +3 -3
- package/dist/{source-candidate-scan-signature-CsP4BQNa.js → source-candidate-scan-signature-CgJi--lh.js} +2 -2
- package/dist/{source-candidate-scan-signature-B7cUxqqX.cjs → source-candidate-scan-signature-_UPwg8oJ.cjs} +2 -2
- package/dist/tailwindcss/v4-engine/css-import.d.ts +14 -0
- package/dist/{tailwindcss-BK9S7zuq.js → tailwindcss-D2joPNdN.js} +1 -1
- package/dist/{tailwindcss-C-jBBQfw.cjs → tailwindcss-DhaLV5a2.cjs} +1 -1
- package/dist/{transform-CfOzh007.js → transform-BNtyKkZi.js} +14 -14
- package/dist/{transform-DUPOPZ54.cjs → transform-DAg85t9Z.cjs} +14 -14
- package/dist/uni-app-x/border-preflight.d.ts +18 -0
- package/dist/uni-app-x/style-asset/source-parser.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +2 -0
- package/dist/uni-app-x/vite/plugin-options.d.ts +2 -0
- package/dist/uni-app-x/vite/style-source.d.ts +14 -4
- package/dist/{v4-generation-core-CRNUU_Rr.cjs → v4-generation-core-bOm8k4AY.cjs} +243 -181
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-BXe-axax.js → vite-C_JJxZWl.js} +271 -66
- package/dist/{vite-D_mAIfTU.cjs → vite-bJZi1V-l.cjs} +287 -63
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-DLZDrWdH.cjs → watch-dependencies-GbC14Rlt.cjs} +14 -11
- package/dist/weapp-tw-css-generation-loader.cjs +3 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +11 -10
- package/dist/weapp-tw-runtime-classset-loader.cjs +16 -11
- package/dist/{web-B2Ea9K4B.cjs → web-B4wa3xrE.cjs} +9 -8
- package/dist/{web-Cv7ualrU.js → web-BiubXhxs.js} +7 -6
- package/dist/{webpack-7Um2GFtx.js → webpack-BDOQUv3J.js} +38 -23
- package/dist/{webpack-Ce04-btG.cjs → webpack-CsBe1G_1.cjs} +37 -23
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +6 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as hasTailwindRootDirectives, At as resolveTailwindV4CssSourceBase, B as removeUnsupportedMiniProgramAtRules, F as stripTailwindSourceMediaFragments, G as shouldFilterApplyOnlyGeneratedCss, H as removeTailwindV4GeneratedUserCssArtifacts, I as stripUnmatchedTailwindSourceMediaCloseFragments, J as splitUserCssLayerBlocks, K as extractGeneratedCssForUserLayerSelectors, L as finalizeMiniProgramCss$1,
|
|
1
|
+
import { $ as hasTailwindRootDirectives, At as resolveTailwindV4CssSourceBase, B as removeUnsupportedMiniProgramAtRules, F as stripTailwindSourceMediaFragments, G as shouldFilterApplyOnlyGeneratedCss, H as removeTailwindV4GeneratedUserCssArtifacts, I as stripUnmatchedTailwindSourceMediaCloseFragments, J as splitUserCssLayerBlocks, K as extractGeneratedCssForUserLayerSelectors, L as finalizeMiniProgramCss$1, M as isCommentOnlyCss, Nt as parseCssImportSpecifier, P as removeTailwindV4GeneratorAtRules, Pt as quoteCssImportSpecifier, T as omitUndefined, Tt as isFileMatchedByTailwindSourceEntries, U as filterApplyOnlyGeneratedCss, Vt as loadTailwindV4DesignSystem, W as normalizeEmptyTailwindCustomVariants, Y as preferScopedGeneratedCssRules, Z as hasTailwindApplyDirective, _t as stripTailwindBanners, a as resolveGeneratorRuntimeBranch, at as removeTailwindSourceDirectives, ct as VITE_MARKER_RE, d as resolveTailwindV4SourceFromRuntime, dt as hasTailwindGeneratedCssMarkers, et as hasTailwindSourceDirectives, ft as splitGeneratorPlaceholderCssBySourceOrder, gt as stripTailwindBanner, ht as stripGeneratorPlaceholderMarkers, i as normalizeWeappTailwindcssGeneratorOptions, it as parseImportRequest, j as transformGeneratorUserCss, jt as toPosixPath, kt as resolveSourceScanPath, lt as createCssAppend, mt as splitTailwindV4GeneratedCssBySourceOrder, nt as normalizeTailwindSourceDirectives, ot as resolveCssEntrySource, p as resolveTailwindV4SourceOptionsFromRuntime, pt as splitTailwindGeneratedCssByBanner, q as hasUserCssLayerBlocks, s as shouldUseMiniProgramCssBranch, st as GENERATOR_PLACEHOLDER_MARKER_RE, u as resolveTailwindV4Source$1, ut as hasTailwindGeneratedCss, vt as normalizeConfigDirective, wt as isFileExcludedByTailwindSourceEntries, xt as FULL_SOURCE_SCAN_EXTENSION_RE, yt as prependConfigDirective, zt as filterUnsupportedMiniProgramTailwindV4Candidates } from "./generator-DxEsInLz.js";
|
|
2
2
|
import { o as transformCssMacroCss, r as hasCssMacroTailwindV4InternalAtRules, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.js";
|
|
3
|
-
import { _ as includesTailwindV4PreflightDirective, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, r as isUniAppXEnabled, v as collectCssInlineSourceCandidates } from "./tailwindcss-
|
|
4
|
-
import { A as consumeCompilationScopeChanges, B as createGenerationArtifact, F as getCompilationSessionPool, G as replaceWxml, I as runCompilerOwnerActivity, J as traverse, K as createDebug, P as getTailwindGenerationSessionPool, R as mergeCompilationDependencyChanges, V as createAttributeMatcher, Y as md5Hash, k as composeGenerationArtifact, l as recordCompilerShadowReport, m as resolveStyleOptionsFromContext, o as completeCompilerShadowReportRun, q as babelParse, r as createStylePlatformAdapter, s as getCompilerShadowRunRevision, u as getFrameworkCompilerSession, z as createCssFragment } from "./compiler-
|
|
3
|
+
import { _ as includesTailwindV4PreflightDirective, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, r as isUniAppXEnabled, v as collectCssInlineSourceCandidates } from "./tailwindcss-D2joPNdN.js";
|
|
4
|
+
import { A as consumeCompilationScopeChanges, B as createGenerationArtifact, F as getCompilationSessionPool, G as replaceWxml, I as runCompilerOwnerActivity, J as traverse, K as createDebug, P as getTailwindGenerationSessionPool, R as mergeCompilationDependencyChanges, V as createAttributeMatcher, Y as md5Hash, k as composeGenerationArtifact, l as recordCompilerShadowReport, m as resolveStyleOptionsFromContext, o as completeCompilerShadowReportRun, q as babelParse, r as createStylePlatformAdapter, s as getCompilerShadowRunRevision, u as getFrameworkCompilerSession, z as createCssFragment } from "./compiler-tHMcW3BT.js";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
@@ -216,6 +216,7 @@ const TEMPLATE_SOURCE_CANDIDATE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
216
216
|
"ksml",
|
|
217
217
|
"ttml",
|
|
218
218
|
"qml",
|
|
219
|
+
"qxml",
|
|
219
220
|
"tyml",
|
|
220
221
|
"xhsml",
|
|
221
222
|
"swan",
|
|
@@ -461,11 +462,11 @@ function createSourceCandidateStore(options = {}) {
|
|
|
461
462
|
cssSourceById.set(normalizedId, source);
|
|
462
463
|
replaceCssLayer(normalizedId, await resolveCandidates(normalizedId, source, "css"));
|
|
463
464
|
}
|
|
464
|
-
async function syncModuleSource(id, source) {
|
|
465
|
+
async function syncModuleSource(id, source, sourceExtension) {
|
|
465
466
|
const normalizedId = cleanUrl(id);
|
|
466
467
|
if (moduleSourceById.get(normalizedId) !== source) revision++;
|
|
467
468
|
moduleSourceById.set(normalizedId, source);
|
|
468
|
-
const candidates = await resolveCandidates(normalizedId, source, resolveSourceCandidateExtension(normalizedId));
|
|
469
|
+
const candidates = await resolveCandidates(normalizedId, source, sourceExtension ?? resolveSourceCandidateExtension(normalizedId));
|
|
469
470
|
replaceModuleLayer(normalizedId, candidates);
|
|
470
471
|
return new Set(candidates);
|
|
471
472
|
}
|
|
@@ -1228,7 +1229,7 @@ function createRuntimeClassSetManager(options = {}) {
|
|
|
1228
1229
|
await reset();
|
|
1229
1230
|
}
|
|
1230
1231
|
runtimeSignature = nextSignature;
|
|
1231
|
-
const nextBaseClassSet = options.baseClassSet;
|
|
1232
|
+
const nextBaseClassSet = options.baseClassSet ? createNonSourceBaseClassSet(options.baseClassSet, candidateCountByClass) : void 0;
|
|
1232
1233
|
const canUseBaseWithoutInitialFullScan = Boolean(fullRebuild && !hadTrackedRuntimeFiles && options.skipInitialFullScanWithBase === true && nextBaseClassSet && nextBaseClassSet.size > 0);
|
|
1233
1234
|
for (const [file, previousCandidates] of candidatesByFile) {
|
|
1234
1235
|
if (!snapshot.removedFiles.has(file) && (currentRuntimeFiles.has(file) || snapshot.hasOmittedKnownFiles)) continue;
|
|
@@ -1906,6 +1907,209 @@ async function adaptGeneratedCssWithFrameworkRootPipeline(owner, generated, opti
|
|
|
1906
1907
|
});
|
|
1907
1908
|
}
|
|
1908
1909
|
//#endregion
|
|
1910
|
+
//#region src/bundlers/shared/generator-css/user-layer-order.ts
|
|
1911
|
+
const USER_LAYER_COMPONENTS_START = "/*! weapp-tailwindcss layer components start */";
|
|
1912
|
+
const USER_LAYER_COMPONENTS_END = "/*! weapp-tailwindcss layer components end */";
|
|
1913
|
+
function appendCss(base, extra) {
|
|
1914
|
+
if (!base) return extra;
|
|
1915
|
+
if (!extra) return base;
|
|
1916
|
+
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
1917
|
+
return `${base}\n${extra}`;
|
|
1918
|
+
}
|
|
1919
|
+
function removeFirstCssOccurrence(css, chunk) {
|
|
1920
|
+
const trimmed = chunk.trim();
|
|
1921
|
+
if (!trimmed) return css;
|
|
1922
|
+
const index = css.indexOf(trimmed);
|
|
1923
|
+
if (index === -1) return css;
|
|
1924
|
+
return appendCss(css.slice(0, index).trimEnd(), css.slice(index + trimmed.length).trimStart());
|
|
1925
|
+
}
|
|
1926
|
+
function collectSelectorsFromCss(css) {
|
|
1927
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
1928
|
+
try {
|
|
1929
|
+
postcss.parse(css).walkRules((rule) => {
|
|
1930
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
1931
|
+
const normalized = selector.trim();
|
|
1932
|
+
if (normalized) selectors.add(normalized);
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
} catch {}
|
|
1936
|
+
return selectors;
|
|
1937
|
+
}
|
|
1938
|
+
function normalizeRuleValue(value) {
|
|
1939
|
+
return value.replace(/\s+/g, " ").trim();
|
|
1940
|
+
}
|
|
1941
|
+
function createRuleKey(rule) {
|
|
1942
|
+
const parents = [];
|
|
1943
|
+
let parent = rule.parent;
|
|
1944
|
+
while (parent && parent.type !== "root") {
|
|
1945
|
+
if (parent.type === "atrule") parents.push(`${parent.name}:${normalizeRuleValue(parent.params)}`);
|
|
1946
|
+
parent = parent.parent;
|
|
1947
|
+
}
|
|
1948
|
+
const selectors = (rule.selectors ?? [rule.selector]).map((selector) => normalizeRuleValue(selector)).join(",");
|
|
1949
|
+
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl").map((node) => `${node.prop}:${normalizeRuleValue(node.value)}:${node.important ? "1" : "0"}`).join(";");
|
|
1950
|
+
return `${parents.reverse().join("|")}\n${selectors}\n${declarations}`;
|
|
1951
|
+
}
|
|
1952
|
+
function collectRuleKeysFromCss(css) {
|
|
1953
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1954
|
+
try {
|
|
1955
|
+
postcss.parse(css).walkRules((rule) => {
|
|
1956
|
+
keys.add(createRuleKey(rule));
|
|
1957
|
+
});
|
|
1958
|
+
} catch {}
|
|
1959
|
+
return keys;
|
|
1960
|
+
}
|
|
1961
|
+
function matchesLayerSelector(selector, layerSelector) {
|
|
1962
|
+
if (selector === layerSelector) return true;
|
|
1963
|
+
if (!selector.startsWith(layerSelector)) return false;
|
|
1964
|
+
const next = selector[layerSelector.length];
|
|
1965
|
+
return next === ":" || next === "[";
|
|
1966
|
+
}
|
|
1967
|
+
function removeCssRulesForSelectors(css, layerCss) {
|
|
1968
|
+
const selectors = [...collectSelectorsFromCss(layerCss)];
|
|
1969
|
+
if (selectors.length === 0) return css;
|
|
1970
|
+
try {
|
|
1971
|
+
const root = postcss.parse(css);
|
|
1972
|
+
root.walkRules((rule) => {
|
|
1973
|
+
if ((rule.selectors ?? [rule.selector]).some((selector) => selectors.some((layerSelector) => matchesLayerSelector(selector.trim(), layerSelector)))) rule.remove();
|
|
1974
|
+
});
|
|
1975
|
+
return root.toString();
|
|
1976
|
+
} catch {
|
|
1977
|
+
return removeFirstCssOccurrence(css, layerCss);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
function removeExactCssRules(css, duplicateCss) {
|
|
1981
|
+
const duplicateKeys = collectRuleKeysFromCss(duplicateCss);
|
|
1982
|
+
if (duplicateKeys.size === 0) return css;
|
|
1983
|
+
try {
|
|
1984
|
+
const root = postcss.parse(css);
|
|
1985
|
+
root.walkRules((rule) => {
|
|
1986
|
+
if (duplicateKeys.has(createRuleKey(rule))) rule.remove();
|
|
1987
|
+
});
|
|
1988
|
+
return root.toString();
|
|
1989
|
+
} catch {
|
|
1990
|
+
return css;
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
function wrapUserLayerComponentsCss(css) {
|
|
1994
|
+
return css.trim().length > 0 ? `${USER_LAYER_COMPONENTS_START}\n${css}\n${USER_LAYER_COMPONENTS_END}` : css;
|
|
1995
|
+
}
|
|
1996
|
+
function extractMarkedUserLayerComponentsCss(css) {
|
|
1997
|
+
const layers = [];
|
|
1998
|
+
let rest = "";
|
|
1999
|
+
let cursor = 0;
|
|
2000
|
+
while (cursor < css.length) {
|
|
2001
|
+
const startIndex = css.indexOf(USER_LAYER_COMPONENTS_START, cursor);
|
|
2002
|
+
if (startIndex === -1) {
|
|
2003
|
+
rest += css.slice(cursor);
|
|
2004
|
+
break;
|
|
2005
|
+
}
|
|
2006
|
+
rest += css.slice(cursor, startIndex);
|
|
2007
|
+
const contentStart = startIndex + 47;
|
|
2008
|
+
const endIndex = css.indexOf(USER_LAYER_COMPONENTS_END, contentStart);
|
|
2009
|
+
if (endIndex === -1) {
|
|
2010
|
+
rest += css.slice(startIndex);
|
|
2011
|
+
break;
|
|
2012
|
+
}
|
|
2013
|
+
const layerCss = css.slice(contentStart, endIndex).trim();
|
|
2014
|
+
if (layerCss) layers.push(layerCss);
|
|
2015
|
+
cursor = endIndex + 45;
|
|
2016
|
+
}
|
|
2017
|
+
return {
|
|
2018
|
+
layers,
|
|
2019
|
+
rest
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
function isGeneratedInfrastructureRule(rule) {
|
|
2023
|
+
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
2024
|
+
if (declarations.length === 0) return false;
|
|
2025
|
+
if (declarations.every((declaration) => declaration.prop.startsWith("--"))) return true;
|
|
2026
|
+
const selectors = (rule.selectors ?? [rule.selector]).map((selector) => selector.trim());
|
|
2027
|
+
if (!(selectors.length > 0 && selectors.every((selector) => selector === "view" || selector === "text" || selector === "::before" || selector === "::after"))) return false;
|
|
2028
|
+
const declarationMap = new Map(declarations.map((declaration) => [declaration.prop, declaration.value]));
|
|
2029
|
+
return declarationMap.get("box-sizing") === "border-box" && declarationMap.has("border");
|
|
2030
|
+
}
|
|
2031
|
+
function findLayerInsertionIndex(css) {
|
|
2032
|
+
try {
|
|
2033
|
+
const root = postcss.parse(css);
|
|
2034
|
+
let insertionIndex = -1;
|
|
2035
|
+
root.walkRules((rule) => {
|
|
2036
|
+
if (insertionIndex !== -1 || isGeneratedInfrastructureRule(rule)) return;
|
|
2037
|
+
let topLevelNode = rule;
|
|
2038
|
+
while (topLevelNode.parent && topLevelNode.parent.type !== "root") topLevelNode = topLevelNode.parent;
|
|
2039
|
+
const offset = topLevelNode.source?.start?.offset;
|
|
2040
|
+
if (typeof offset === "number") insertionIndex = css.lastIndexOf("\n", Math.max(0, offset - 1)) + 1;
|
|
2041
|
+
});
|
|
2042
|
+
return insertionIndex;
|
|
2043
|
+
} catch {
|
|
2044
|
+
return -1;
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
function reorderMarkedUserLayerComponentsCss(css) {
|
|
2048
|
+
if (!css.includes(USER_LAYER_COMPONENTS_START)) return css;
|
|
2049
|
+
const { layers, rest } = extractMarkedUserLayerComponentsCss(css);
|
|
2050
|
+
if (layers.length === 0) return rest;
|
|
2051
|
+
const layerCss = layers.join("\n");
|
|
2052
|
+
const restWithoutLayerDuplicates = removeExactCssRules(rest, layerCss);
|
|
2053
|
+
const insertionIndex = findLayerInsertionIndex(restWithoutLayerDuplicates);
|
|
2054
|
+
if (insertionIndex === -1) return appendCss(restWithoutLayerDuplicates, layerCss);
|
|
2055
|
+
return appendCss(appendCss(restWithoutLayerDuplicates.slice(0, insertionIndex), layerCss), restWithoutLayerDuplicates.slice(insertionIndex));
|
|
2056
|
+
}
|
|
2057
|
+
function mergeMarkedUserLayerComponentsCss(baseCss, markedCss) {
|
|
2058
|
+
if (!markedCss.includes(USER_LAYER_COMPONENTS_START)) return {
|
|
2059
|
+
css: baseCss,
|
|
2060
|
+
merged: false
|
|
2061
|
+
};
|
|
2062
|
+
const { layers } = extractMarkedUserLayerComponentsCss(markedCss);
|
|
2063
|
+
if (layers.length === 0) return {
|
|
2064
|
+
css: baseCss,
|
|
2065
|
+
merged: false
|
|
2066
|
+
};
|
|
2067
|
+
const layerCss = layers.join("\n");
|
|
2068
|
+
return {
|
|
2069
|
+
css: reorderMarkedUserLayerComponentsCss(appendCss(removeCssRulesForSelectors(baseCss, layerCss), wrapUserLayerComponentsCss(layerCss))),
|
|
2070
|
+
merged: true
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
//#endregion
|
|
2074
|
+
//#region src/bundlers/shared/framework-user-css.ts
|
|
2075
|
+
function normalizeUserSource(source) {
|
|
2076
|
+
try {
|
|
2077
|
+
const root = postcss.parse(source);
|
|
2078
|
+
root.walkAtRules("media", (rule) => {
|
|
2079
|
+
if (/^source\(/.test(rule.params)) rule.replaceWith(...rule.nodes ?? []);
|
|
2080
|
+
});
|
|
2081
|
+
return root.toString();
|
|
2082
|
+
} catch {
|
|
2083
|
+
return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(source));
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
async function restoreFrameworkProcessedUserCss(css, generated, source, options, generatorOptions) {
|
|
2087
|
+
const userCssOptions = {
|
|
2088
|
+
generatorTarget: generated.target,
|
|
2089
|
+
generatorStyleOptions: resolveGeneratorStyleOptions(options.opts, options.cssHandlerOptions, generatorOptions.styleOptions),
|
|
2090
|
+
cssUserHandlerOptions: options.cssUserHandlerOptions,
|
|
2091
|
+
styleHandler: options.styleHandler,
|
|
2092
|
+
importFallback: generatorOptions.importFallback
|
|
2093
|
+
};
|
|
2094
|
+
const transform = async (value) => {
|
|
2095
|
+
const parts = splitUserCssLayerBlocks(value);
|
|
2096
|
+
const layer = await transformGeneratorUserCss(parts.layer, userCssOptions);
|
|
2097
|
+
const rest = await transformGeneratorUserCss(parts.rest, userCssOptions);
|
|
2098
|
+
return removeTailwindV4GeneratedUserCssArtifacts(finalizeMiniProgramGeneratorCss(createCssSourceOrderAppend(wrapUserLayerComponentsCss(layer), rest), generated.target, options.runtimeState.tailwindRuntime.majorVersion, options.opts.cssPreflight, {
|
|
2099
|
+
injectPreflight: false,
|
|
2100
|
+
preservePreflight: generated.metadata?.preflightMode?.preserve,
|
|
2101
|
+
styleOptions: options.cssHandlerOptions
|
|
2102
|
+
}));
|
|
2103
|
+
};
|
|
2104
|
+
const userSource = normalizeUserSource(source);
|
|
2105
|
+
const ordered = splitRawSourceByGeneratedCssOrder(userSource, generated.metadata?.rawCss ?? "") ?? {
|
|
2106
|
+
before: "",
|
|
2107
|
+
after: userSource
|
|
2108
|
+
};
|
|
2109
|
+
const withBefore = createCssSourceOrderAppend(filterExistingCssRules(css, await transform(ordered.before)), css);
|
|
2110
|
+
return reorderMarkedUserLayerComponentsCss(createCssSourceOrderAppend(withBefore, filterExistingCssRules(withBefore, await transform(ordered.after))));
|
|
2111
|
+
}
|
|
2112
|
+
//#endregion
|
|
1909
2113
|
//#region src/bundlers/shared/generator-css/legacy-selectors.ts
|
|
1910
2114
|
const CLASS_SELECTOR_RE = /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i;
|
|
1911
2115
|
const MINI_PROGRAM_THEME_SCOPE_SELECTORS = /* @__PURE__ */ new Set([
|
|
@@ -3409,10 +3613,20 @@ function normalizeMiniProgramOutputImportRequest(request) {
|
|
|
3409
3613
|
if (request.startsWith(".") || request.startsWith("/") || /^(?:[a-z][a-z\d+.-]*:|#)/i.test(request)) return request;
|
|
3410
3614
|
return `./${request}`;
|
|
3411
3615
|
}
|
|
3412
|
-
function normalizeMiniProgramImportShell(css) {
|
|
3413
|
-
|
|
3616
|
+
function normalizeMiniProgramImportShell(css, output) {
|
|
3617
|
+
const normalized = output?.cssOnly ? css : css.replace(MINI_PROGRAM_OUTPUT_IMPORT_RE, (_match, prefix, quote, request, suffix) => {
|
|
3414
3618
|
return `${prefix}${quote}${normalizeMiniProgramOutputImportRequest(request)}${quote}${suffix}`;
|
|
3415
3619
|
});
|
|
3620
|
+
if (!output || !normalized.includes("@import")) return normalized;
|
|
3621
|
+
const files = new Set([...output.outputFiles].map(normalizeOutputPath));
|
|
3622
|
+
const root = postcss.parse(normalized);
|
|
3623
|
+
root.walkAtRules("import", (rule) => {
|
|
3624
|
+
const parsed = parseCssImportSpecifier(rule.params);
|
|
3625
|
+
if (!parsed || output.cssOnly && !/\.css(?:$|[?#])/i.test(parsed.specifier) || !files.has(resolveOutputImportRequest(output.outputFile, parsed.specifier))) return;
|
|
3626
|
+
const request = normalizeMiniProgramOutputImportRequest(parsed.specifier);
|
|
3627
|
+
if (request !== parsed.specifier) rule.params = rule.params.replace(parsed.raw, quoteCssImportSpecifier(request, parsed.quote));
|
|
3628
|
+
});
|
|
3629
|
+
return root.toString();
|
|
3416
3630
|
}
|
|
3417
3631
|
function normalizeOutputPath(file) {
|
|
3418
3632
|
const segments = [];
|
|
@@ -3445,9 +3659,9 @@ function isMiniProgramOutputImport(node) {
|
|
|
3445
3659
|
return request !== void 0 && MINI_PROGRAM_OUTPUT_STYLE_RE.test(request);
|
|
3446
3660
|
}
|
|
3447
3661
|
function isSelfMiniProgramOutputImport(outputFile, node) {
|
|
3448
|
-
if (
|
|
3449
|
-
const request =
|
|
3450
|
-
return request !== void 0 && resolveOutputImportRequest(outputFile, request) === normalizeOutputPath(outputFile);
|
|
3662
|
+
if (node.type !== "atrule" || node.name !== "import") return false;
|
|
3663
|
+
const request = parseCssImportSpecifier(node.params)?.specifier;
|
|
3664
|
+
return request !== void 0 && /\.(?:css|wxss|acss|ttss|qss|jxss|tyss)(?:$|[?#])/i.test(request) && resolveOutputImportRequest(outputFile, request) === normalizeOutputPath(outputFile);
|
|
3451
3665
|
}
|
|
3452
3666
|
function removeMiniProgramOutputImportsBy(css, predicate) {
|
|
3453
3667
|
if (!css.includes("@import")) return css;
|
|
@@ -3471,8 +3685,11 @@ function removeSelfMiniProgramOutputImports(css, outputFile) {
|
|
|
3471
3685
|
function removeMiniProgramOutputImports(css) {
|
|
3472
3686
|
return removeMiniProgramOutputImportsBy(css, isMiniProgramOutputImport);
|
|
3473
3687
|
}
|
|
3474
|
-
function normalizeMiniProgramGeneratorCssSource(css, outputFile) {
|
|
3475
|
-
const normalized = normalizeMiniProgramImportShell(css
|
|
3688
|
+
function normalizeMiniProgramGeneratorCssSource(css, outputFile, outputFiles) {
|
|
3689
|
+
const normalized = normalizeMiniProgramImportShell(css, outputFile && outputFiles ? {
|
|
3690
|
+
outputFile,
|
|
3691
|
+
outputFiles
|
|
3692
|
+
} : void 0);
|
|
3476
3693
|
if (outputFile) return removeSelfMiniProgramOutputImports(normalized, outputFile);
|
|
3477
3694
|
return isPureLocalCssImportWrapper(normalized) ? normalized : removeMiniProgramOutputImports(normalized);
|
|
3478
3695
|
}
|
|
@@ -3582,170 +3799,6 @@ function finalizeIncrementalGeneratorCss(previousCss, incrementalCss, target, ma
|
|
|
3582
3799
|
return createCssAppend(previousCss, finalizedIncrementalCss);
|
|
3583
3800
|
}
|
|
3584
3801
|
//#endregion
|
|
3585
|
-
//#region src/bundlers/shared/generator-css/user-layer-order.ts
|
|
3586
|
-
const USER_LAYER_COMPONENTS_START = "/*! weapp-tailwindcss layer components start */";
|
|
3587
|
-
const USER_LAYER_COMPONENTS_END = "/*! weapp-tailwindcss layer components end */";
|
|
3588
|
-
function appendCss(base, extra) {
|
|
3589
|
-
if (!base) return extra;
|
|
3590
|
-
if (!extra) return base;
|
|
3591
|
-
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
3592
|
-
return `${base}\n${extra}`;
|
|
3593
|
-
}
|
|
3594
|
-
function removeFirstCssOccurrence(css, chunk) {
|
|
3595
|
-
const trimmed = chunk.trim();
|
|
3596
|
-
if (!trimmed) return css;
|
|
3597
|
-
const index = css.indexOf(trimmed);
|
|
3598
|
-
if (index === -1) return css;
|
|
3599
|
-
return appendCss(css.slice(0, index).trimEnd(), css.slice(index + trimmed.length).trimStart());
|
|
3600
|
-
}
|
|
3601
|
-
function collectSelectorsFromCss(css) {
|
|
3602
|
-
const selectors = /* @__PURE__ */ new Set();
|
|
3603
|
-
try {
|
|
3604
|
-
postcss.parse(css).walkRules((rule) => {
|
|
3605
|
-
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
3606
|
-
const normalized = selector.trim();
|
|
3607
|
-
if (normalized) selectors.add(normalized);
|
|
3608
|
-
}
|
|
3609
|
-
});
|
|
3610
|
-
} catch {}
|
|
3611
|
-
return selectors;
|
|
3612
|
-
}
|
|
3613
|
-
function normalizeRuleValue(value) {
|
|
3614
|
-
return value.replace(/\s+/g, " ").trim();
|
|
3615
|
-
}
|
|
3616
|
-
function createRuleKey(rule) {
|
|
3617
|
-
const parents = [];
|
|
3618
|
-
let parent = rule.parent;
|
|
3619
|
-
while (parent && parent.type !== "root") {
|
|
3620
|
-
if (parent.type === "atrule") parents.push(`${parent.name}:${normalizeRuleValue(parent.params)}`);
|
|
3621
|
-
parent = parent.parent;
|
|
3622
|
-
}
|
|
3623
|
-
const selectors = (rule.selectors ?? [rule.selector]).map((selector) => normalizeRuleValue(selector)).join(",");
|
|
3624
|
-
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl").map((node) => `${node.prop}:${normalizeRuleValue(node.value)}:${node.important ? "1" : "0"}`).join(";");
|
|
3625
|
-
return `${parents.reverse().join("|")}\n${selectors}\n${declarations}`;
|
|
3626
|
-
}
|
|
3627
|
-
function collectRuleKeysFromCss(css) {
|
|
3628
|
-
const keys = /* @__PURE__ */ new Set();
|
|
3629
|
-
try {
|
|
3630
|
-
postcss.parse(css).walkRules((rule) => {
|
|
3631
|
-
keys.add(createRuleKey(rule));
|
|
3632
|
-
});
|
|
3633
|
-
} catch {}
|
|
3634
|
-
return keys;
|
|
3635
|
-
}
|
|
3636
|
-
function matchesLayerSelector(selector, layerSelector) {
|
|
3637
|
-
if (selector === layerSelector) return true;
|
|
3638
|
-
if (!selector.startsWith(layerSelector)) return false;
|
|
3639
|
-
const next = selector[layerSelector.length];
|
|
3640
|
-
return next === ":" || next === "[";
|
|
3641
|
-
}
|
|
3642
|
-
function removeCssRulesForSelectors(css, layerCss) {
|
|
3643
|
-
const selectors = [...collectSelectorsFromCss(layerCss)];
|
|
3644
|
-
if (selectors.length === 0) return css;
|
|
3645
|
-
try {
|
|
3646
|
-
const root = postcss.parse(css);
|
|
3647
|
-
root.walkRules((rule) => {
|
|
3648
|
-
if ((rule.selectors ?? [rule.selector]).some((selector) => selectors.some((layerSelector) => matchesLayerSelector(selector.trim(), layerSelector)))) rule.remove();
|
|
3649
|
-
});
|
|
3650
|
-
return root.toString();
|
|
3651
|
-
} catch {
|
|
3652
|
-
return removeFirstCssOccurrence(css, layerCss);
|
|
3653
|
-
}
|
|
3654
|
-
}
|
|
3655
|
-
function removeExactCssRules(css, duplicateCss) {
|
|
3656
|
-
const duplicateKeys = collectRuleKeysFromCss(duplicateCss);
|
|
3657
|
-
if (duplicateKeys.size === 0) return css;
|
|
3658
|
-
try {
|
|
3659
|
-
const root = postcss.parse(css);
|
|
3660
|
-
root.walkRules((rule) => {
|
|
3661
|
-
if (duplicateKeys.has(createRuleKey(rule))) rule.remove();
|
|
3662
|
-
});
|
|
3663
|
-
return root.toString();
|
|
3664
|
-
} catch {
|
|
3665
|
-
return css;
|
|
3666
|
-
}
|
|
3667
|
-
}
|
|
3668
|
-
function wrapUserLayerComponentsCss(css) {
|
|
3669
|
-
return css.trim().length > 0 ? `${USER_LAYER_COMPONENTS_START}\n${css}\n${USER_LAYER_COMPONENTS_END}` : css;
|
|
3670
|
-
}
|
|
3671
|
-
function extractMarkedUserLayerComponentsCss(css) {
|
|
3672
|
-
const layers = [];
|
|
3673
|
-
let rest = "";
|
|
3674
|
-
let cursor = 0;
|
|
3675
|
-
while (cursor < css.length) {
|
|
3676
|
-
const startIndex = css.indexOf(USER_LAYER_COMPONENTS_START, cursor);
|
|
3677
|
-
if (startIndex === -1) {
|
|
3678
|
-
rest += css.slice(cursor);
|
|
3679
|
-
break;
|
|
3680
|
-
}
|
|
3681
|
-
rest += css.slice(cursor, startIndex);
|
|
3682
|
-
const contentStart = startIndex + 47;
|
|
3683
|
-
const endIndex = css.indexOf(USER_LAYER_COMPONENTS_END, contentStart);
|
|
3684
|
-
if (endIndex === -1) {
|
|
3685
|
-
rest += css.slice(startIndex);
|
|
3686
|
-
break;
|
|
3687
|
-
}
|
|
3688
|
-
const layerCss = css.slice(contentStart, endIndex).trim();
|
|
3689
|
-
if (layerCss) layers.push(layerCss);
|
|
3690
|
-
cursor = endIndex + 45;
|
|
3691
|
-
}
|
|
3692
|
-
return {
|
|
3693
|
-
layers,
|
|
3694
|
-
rest
|
|
3695
|
-
};
|
|
3696
|
-
}
|
|
3697
|
-
function isGeneratedInfrastructureRule(rule) {
|
|
3698
|
-
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
3699
|
-
if (declarations.length === 0) return false;
|
|
3700
|
-
if (declarations.every((declaration) => declaration.prop.startsWith("--"))) return true;
|
|
3701
|
-
const selectors = (rule.selectors ?? [rule.selector]).map((selector) => selector.trim());
|
|
3702
|
-
if (!(selectors.length > 0 && selectors.every((selector) => selector === "view" || selector === "text" || selector === "::before" || selector === "::after"))) return false;
|
|
3703
|
-
const declarationMap = new Map(declarations.map((declaration) => [declaration.prop, declaration.value]));
|
|
3704
|
-
return declarationMap.get("box-sizing") === "border-box" && declarationMap.has("border");
|
|
3705
|
-
}
|
|
3706
|
-
function findLayerInsertionIndex(css) {
|
|
3707
|
-
try {
|
|
3708
|
-
const root = postcss.parse(css);
|
|
3709
|
-
let insertionIndex = -1;
|
|
3710
|
-
root.walkRules((rule) => {
|
|
3711
|
-
if (insertionIndex !== -1 || isGeneratedInfrastructureRule(rule)) return;
|
|
3712
|
-
let topLevelNode = rule;
|
|
3713
|
-
while (topLevelNode.parent && topLevelNode.parent.type !== "root") topLevelNode = topLevelNode.parent;
|
|
3714
|
-
const offset = topLevelNode.source?.start?.offset;
|
|
3715
|
-
if (typeof offset === "number") insertionIndex = css.lastIndexOf("\n", Math.max(0, offset - 1)) + 1;
|
|
3716
|
-
});
|
|
3717
|
-
return insertionIndex;
|
|
3718
|
-
} catch {
|
|
3719
|
-
return -1;
|
|
3720
|
-
}
|
|
3721
|
-
}
|
|
3722
|
-
function reorderMarkedUserLayerComponentsCss(css) {
|
|
3723
|
-
if (!css.includes(USER_LAYER_COMPONENTS_START)) return css;
|
|
3724
|
-
const { layers, rest } = extractMarkedUserLayerComponentsCss(css);
|
|
3725
|
-
if (layers.length === 0) return rest;
|
|
3726
|
-
const layerCss = layers.join("\n");
|
|
3727
|
-
const restWithoutLayerDuplicates = removeExactCssRules(rest, layerCss);
|
|
3728
|
-
const insertionIndex = findLayerInsertionIndex(restWithoutLayerDuplicates);
|
|
3729
|
-
if (insertionIndex === -1) return appendCss(restWithoutLayerDuplicates, layerCss);
|
|
3730
|
-
return appendCss(appendCss(restWithoutLayerDuplicates.slice(0, insertionIndex), layerCss), restWithoutLayerDuplicates.slice(insertionIndex));
|
|
3731
|
-
}
|
|
3732
|
-
function mergeMarkedUserLayerComponentsCss(baseCss, markedCss) {
|
|
3733
|
-
if (!markedCss.includes(USER_LAYER_COMPONENTS_START)) return {
|
|
3734
|
-
css: baseCss,
|
|
3735
|
-
merged: false
|
|
3736
|
-
};
|
|
3737
|
-
const { layers } = extractMarkedUserLayerComponentsCss(markedCss);
|
|
3738
|
-
if (layers.length === 0) return {
|
|
3739
|
-
css: baseCss,
|
|
3740
|
-
merged: false
|
|
3741
|
-
};
|
|
3742
|
-
const layerCss = layers.join("\n");
|
|
3743
|
-
return {
|
|
3744
|
-
css: reorderMarkedUserLayerComponentsCss(appendCss(removeCssRulesForSelectors(baseCss, layerCss), wrapUserLayerComponentsCss(layerCss))),
|
|
3745
|
-
merged: true
|
|
3746
|
-
};
|
|
3747
|
-
}
|
|
3748
|
-
//#endregion
|
|
3749
3802
|
//#region src/bundlers/shared/generator-css/pipeline/deferred-output.ts
|
|
3750
3803
|
async function finalizeDeferredGeneratorCss(context) {
|
|
3751
3804
|
const { cssUserHandlerOptions, file, filterGeneratedApplyOnlyCss, generated, generatedUserCssRawSource, generatorOptions, generatorRawSource, generatorStyleOptions, hasMatchedCssSourceFile, localImports, majorVersion, options, opts, preflightMode, runtimeWithCurrentCss, styleHandler, userCssOrderSource, userRawSourceProcessed } = context;
|
|
@@ -4533,12 +4586,16 @@ async function generateTailwindV4CssWithImplementation(options, implementation)
|
|
|
4533
4586
|
uniAppX: options.opts.uniAppX
|
|
4534
4587
|
});
|
|
4535
4588
|
const shouldReplayFrameworkPostcss = options.cssStage === "framework-processed" && hasFrameworkPostcssOptions(frameworkPostcssOwner) && normalizedGeneratorOptions.target === "weapp";
|
|
4589
|
+
const generationInput = !shouldReplayFrameworkPostcss && options.frameworkProcessedUserCss ? {
|
|
4590
|
+
...options,
|
|
4591
|
+
userRawSource: [options.userRawSource, options.frameworkProcessedUserCss].filter(Boolean).join("\n")
|
|
4592
|
+
} : options;
|
|
4536
4593
|
const scope = options.scope ?? {
|
|
4537
4594
|
id: options.outputFile ?? options.file,
|
|
4538
4595
|
kind: options.cssHandlerOptions.isMainChunk ? "global" : "component"
|
|
4539
4596
|
};
|
|
4540
4597
|
const generated = await generateCssByGenerator(shouldReplayFrameworkPostcss ? {
|
|
4541
|
-
...
|
|
4598
|
+
...generationInput,
|
|
4542
4599
|
compilation: implementation.frameworkAdapter === "graph" ? {
|
|
4543
4600
|
enabled: true,
|
|
4544
4601
|
preserveDeletedCss: normalizedGeneratorOptions.hmr?.preserveDeletedCss ?? true,
|
|
@@ -4547,7 +4604,7 @@ async function generateTailwindV4CssWithImplementation(options, implementation)
|
|
|
4547
4604
|
} : void 0,
|
|
4548
4605
|
deferCssAdaptation: true
|
|
4549
4606
|
} : {
|
|
4550
|
-
...
|
|
4607
|
+
...generationInput,
|
|
4551
4608
|
compilation: implementation.frameworkAdapter === "graph" ? {
|
|
4552
4609
|
enabled: true,
|
|
4553
4610
|
preserveDeletedCss: normalizedGeneratorOptions.hmr?.preserveDeletedCss ?? true,
|
|
@@ -4567,13 +4624,18 @@ async function generateTailwindV4CssWithImplementation(options, implementation)
|
|
|
4567
4624
|
snapshot: generated.snapshot
|
|
4568
4625
|
} : {}
|
|
4569
4626
|
}) : generated.css;
|
|
4570
|
-
const
|
|
4571
|
-
const
|
|
4627
|
+
const composedCss = shouldReplayFrameworkPostcss && options.frameworkProcessedUserCss ? await restoreFrameworkProcessedUserCss(adaptedCss, generated, options.frameworkProcessedUserCss, options, normalizedGeneratorOptions) : adaptedCss;
|
|
4628
|
+
const css = isVueScopedStyleRequest(resolvePostcssRequestOption(options.cssHandlerOptions)) ? preferScopedGeneratedCssRules(composedCss) : composedCss;
|
|
4629
|
+
const classSet = options.frameworkProcessedUserCss ? resolveGeneratedCssClassSet(generated.target, generated.classSet, options.runtime, css, options.opts.escapeMap, options.previousClassSet) : generated.classSet;
|
|
4630
|
+
const artifact = implementation.emitArtifact ? createCoreArtifact({
|
|
4631
|
+
...generated,
|
|
4632
|
+
classSet
|
|
4633
|
+
}, css, options) : void 0;
|
|
4572
4634
|
return {
|
|
4573
4635
|
...generated,
|
|
4574
4636
|
...artifact ? { artifact } : {},
|
|
4575
4637
|
css,
|
|
4576
|
-
classSet
|
|
4638
|
+
classSet,
|
|
4577
4639
|
dependencies: generated.dependencies,
|
|
4578
4640
|
metadata: {
|
|
4579
4641
|
file: options.file,
|
|
@@ -4691,4 +4753,4 @@ function createHmrTimingRecorder(bundler) {
|
|
|
4691
4753
|
};
|
|
4692
4754
|
}
|
|
4693
4755
|
//#endregion
|
|
4694
|
-
export { createCssSourceTraceCacheSignature as A, createSourceCandidateCollector as B, isSourceStyleRequest as C, parseBundlerGeneratedCssMarkerBlocks as D, hasBundlerGeneratedCssMarker as E, createEscapeFragments as F, resolveSourceCandidateScanFiles as G, isSourceCandidateRequest as H, isPureLocalCssImportWrapper as I, rewriteLocalCssImportRequestsForOutput as L, isCssSourceTraceEnabled as M, createRuntimeClassSetManager as N, stripBundlerGeneratedCssMarkers as O, collectStrictEscapedRuntimeCandidates as P, splitLocalCssImports as R, isSourcePreprocessorRequest as S, createBundlerGeneratedCssMarker as T, extractCandidatesFromSource as U, createSourceCandidateStore as V, createSourceCandidateEligibilityMatcher as W, captureResolvedFrameworkPostcssOptions as _,
|
|
4756
|
+
export { createCssSourceTraceCacheSignature as A, createSourceCandidateCollector as B, isSourceStyleRequest as C, parseBundlerGeneratedCssMarkerBlocks as D, hasBundlerGeneratedCssMarker as E, createEscapeFragments as F, resolveSourceCandidateScanFiles as G, isSourceCandidateRequest as H, isPureLocalCssImportWrapper as I, rewriteLocalCssImportRequestsForOutput as L, isCssSourceTraceEnabled as M, createRuntimeClassSetManager as N, stripBundlerGeneratedCssMarkers as O, collectStrictEscapedRuntimeCandidates as P, splitLocalCssImports as R, isSourcePreprocessorRequest as S, createBundlerGeneratedCssMarker as T, extractCandidatesFromSource as U, createSourceCandidateStore as V, createSourceCandidateEligibilityMatcher as W, captureResolvedFrameworkPostcssOptions as _, collectGeneratedRawSourceCandidatesFromCss as a, finalizeMiniProgramGeneratorCss as b, resolveTaskConcurrency as c, normalizeMiniProgramImportShell as d, scoreTailwindV4CssSourceFileMatch as f, captureFrameworkPostcssOptions as g, mergeMarkedUserLayerComponentsCss as h, validateCandidatesByGenerator as i, createCssTokenSourceMap as j, annotateCssSourceTrace as k, runWithConcurrency as l, extractMarkedUserLayerComponentsCss as m, emitHmrTiming as n, collectRawSourceClassSelectors as o, removeGeneratedSelectorCompatCss as p, generateTailwindV4Css as r, pushConcurrentTaskFactories as s, createHmrTimingRecorder as t, normalizeMiniProgramGeneratorCssSource as u, collectFrameworkPostcssOptionsFromLoaderEntries as v, stripRequestQuery as w, hasMiniProgramTailwindV4PreflightReset as x, createCssSourceOrderAppend as y, finalizeCompilerShadowRun as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
4
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
5
|
-
const require_compiler = require("./compiler-
|
|
2
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
3
|
+
const require_tailwindcss = require("./tailwindcss-DhaLV5a2.cjs");
|
|
4
|
+
const require_v4_generation_core = require("./v4-generation-core-bOm8k4AY.cjs");
|
|
5
|
+
const require_compiler = require("./compiler-BSMSbVVt.cjs");
|
|
6
6
|
let node_process = require("node:process");
|
|
7
7
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
8
8
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
@@ -177,7 +177,7 @@ function createRuntimeClassSetManager(options = {}) {
|
|
|
177
177
|
await reset();
|
|
178
178
|
}
|
|
179
179
|
runtimeSignature = nextSignature;
|
|
180
|
-
const nextBaseClassSet = options.baseClassSet;
|
|
180
|
+
const nextBaseClassSet = options.baseClassSet ? createNonSourceBaseClassSet(options.baseClassSet, candidateCountByClass) : void 0;
|
|
181
181
|
const canUseBaseWithoutInitialFullScan = Boolean(fullRebuild && !hadTrackedRuntimeFiles && options.skipInitialFullScanWithBase === true && nextBaseClassSet && nextBaseClassSet.size > 0);
|
|
182
182
|
for (const [file, previousCandidates] of candidatesByFile) {
|
|
183
183
|
if (!snapshot.removedFiles.has(file) && (currentRuntimeFiles.has(file) || snapshot.hasOmittedKnownFiles)) continue;
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
3
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
4
|
+
const require_gulp = require("./gulp-C1r36Y_f.cjs");
|
|
5
5
|
const require_postcss = require("./postcss.cjs");
|
|
6
|
-
const require_vite = require("./vite-
|
|
7
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-bJZi1V-l.cjs");
|
|
7
|
+
const require_webpack = require("./webpack-CsBe1G_1.cjs");
|
|
8
8
|
require("./webpack.cjs");
|
|
9
9
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
10
10
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform } from "./framework.js";
|
|
2
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import { t as createPlugins } from "./gulp-
|
|
2
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-DxEsInLz.js";
|
|
3
|
+
import { t as createPlugins } from "./gulp-qGXKwQMZ.js";
|
|
4
4
|
import weappTailwindcssPostcssPlugin from "./postcss.js";
|
|
5
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
6
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-C_JJxZWl.js";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-BDOQUv3J.js";
|
|
7
7
|
import "./webpack.js";
|
|
8
8
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
9
9
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
4
|
-
const require_compiler = require("./compiler-
|
|
5
|
-
const require_defaults = require("./defaults-
|
|
2
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
3
|
+
const require_v4_generation_core = require("./v4-generation-core-bOm8k4AY.cjs");
|
|
4
|
+
const require_compiler = require("./compiler-BSMSbVVt.cjs");
|
|
5
|
+
const require_defaults = require("./defaults-CiGsr8Xq.cjs");
|
|
6
6
|
const require_final_css_cleanup = require("./final-css-cleanup-DSjczga3.cjs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
package/dist/postcss.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_generator = require("./generator-
|
|
5
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
6
6
|
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
7
7
|
createGenerator: (source) => {
|
|
8
8
|
return require_generator.createWeappTailwindcssGenerator(source);
|
package/dist/postcss.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-
|
|
1
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-DxEsInLz.js";
|
|
2
2
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
3
3
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
4
4
|
createGenerator: (source) => {
|
package/dist/presets.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
3
3
|
const require_framework = require("./framework.cjs");
|
|
4
|
-
const require_generator = require("./generator-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
4
|
+
const require_generator = require("./generator-CCw17l0G.cjs");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-DhaLV5a2.cjs");
|
|
6
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
7
7
|
require("./logger-TlKT3xmR.cjs");
|
|
8
8
|
let node_path = require("node:path");
|
package/dist/presets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveTaroPlatform, resolveUniPlatformsFromEnv } from "./framework.js";
|
|
2
|
-
import { T as omitUndefined } from "./generator-
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
2
|
+
import { T as omitUndefined } from "./generator-DxEsInLz.js";
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-D2joPNdN.js";
|
|
4
4
|
import { n as defuOverrideArray } from "./utils-MVwpU07P.js";
|
|
5
5
|
import { t as logger } from "./logger-BNzxZbZj.js";
|
|
6
6
|
import path from "node:path";
|