weapp-tailwindcss 5.0.0-next.14 → 5.0.0-next.15
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/{bundle-state-CxtGmT4t.js → bundle-state-ClSg28Qk.js} +1 -1
- package/dist/{bundle-state-BOBbxYzQ.mjs → bundle-state-CrhkNTsw.mjs} +1 -1
- package/dist/bundlers/shared/generator-css/markers.d.ts +8 -0
- package/dist/bundlers/shared/generator-css.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-CRORPkpW.js → generator-CImaTibB.js} +1 -1
- package/dist/{generator-C9H44wEF.mjs → generator-DSMdL4vg.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-B4EXHHii.js → incremental-runtime-class-set-CH1L--wj.js} +73 -30
- package/dist/{incremental-runtime-class-set-DoKrMrEh.mjs → incremental-runtime-class-set-P-3ZoWW5.mjs} +73 -30
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-BFxu5_cs.mjs → postcss-CgFCqilE.mjs} +2 -2
- package/dist/{postcss-Vqn4IlO3.js → postcss-k0BshZZQ.js} +2 -2
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-DCresEiu.mjs → precheck-DMXLnfTN.mjs} +2 -2
- package/dist/{precheck-CZHcFX8k.js → precheck-GcUdX1BX.js} +2 -2
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/{source-candidates-BvbvkIPP.js → source-candidates-ES3ttZPe.js} +1 -1
- package/dist/{source-candidates-CK70jGo7.mjs → source-candidates-om5-wQJ0.mjs} +1 -1
- package/dist/{tailwindcss-CN0K7G-l.js → tailwindcss-CkTBauKa.js} +1 -1
- package/dist/{tailwindcss-7k0LFa12.mjs → tailwindcss-fe0rGj7T.mjs} +1 -1
- package/dist/{v3-engine-D61eilBl.mjs → v3-engine-qoWtwjIj.mjs} +15 -0
- package/dist/{v3-engine-DwV1E6rX.js → v3-engine-v__n8_Sd.js} +15 -0
- package/dist/{vite-DJ0P9Hrp.js → vite-Bob_Mrva.js} +7 -7
- package/dist/{vite-DCmKrTo0.mjs → vite-cBjGYHFH.mjs} +7 -7
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/{webpack-8y4NOMnT.js → webpack-BedfyGbF.js} +5 -5
- package/dist/{webpack-CbO4jjkH.mjs → webpack-Cq45BZzs.mjs} +5 -5
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_precheck = require("./precheck-GcUdX1BX.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -8,7 +8,15 @@ export declare const TAILWIND_BANNER_GLOBAL_RE: RegExp;
|
|
|
8
8
|
export declare const VITE_MARKER_RE: RegExp;
|
|
9
9
|
export declare function createCssAppend(base: string, extra: string): string;
|
|
10
10
|
export declare function splitTailwindV4GeneratedCss(rawSource: string, rawTailwindCss: string): string | undefined;
|
|
11
|
+
export declare function splitTailwindV4GeneratedCssBySourceOrder(rawSource: string, rawTailwindCss: string): {
|
|
12
|
+
before: string;
|
|
13
|
+
after: string;
|
|
14
|
+
} | undefined;
|
|
11
15
|
export declare function removeTailwindGeneratedCssByBanner(rawSource: string): string | undefined;
|
|
16
|
+
export declare function splitTailwindGeneratedCssByBanner(rawSource: string, start?: number): {
|
|
17
|
+
before: string;
|
|
18
|
+
after: string;
|
|
19
|
+
} | undefined;
|
|
12
20
|
export declare function stripTailwindBanner(css: string): string;
|
|
13
21
|
export declare function stripTailwindBanners(css: string): string;
|
|
14
22
|
export declare function stripGeneratorPlaceholderMarkers(css: string): string;
|
|
@@ -4,7 +4,7 @@ import type { InternalUserDefinedOptions } from '../../types';
|
|
|
4
4
|
export { hasTailwindSourceDirectives, normalizeTailwindSourceForGenerator, removeTailwindSourceDirectives, resolveCssEntrySource, } from './generator-css/directives';
|
|
5
5
|
export { removeTailwindApplyRules, } from './generator-css/legacy-compat';
|
|
6
6
|
export { inheritLegacyUnitConvertedDeclarations, } from './generator-css/legacy-units';
|
|
7
|
-
export { createCssAppend, hasTailwindGeneratedCss, hasTailwindGeneratedCssMarkers, removeTailwindGeneratedCssByBanner, splitTailwindV4GeneratedCss, stripGeneratorPlaceholderMarkers, stripTailwindBanner, stripTailwindBanners, } from './generator-css/markers';
|
|
7
|
+
export { createCssAppend, hasTailwindGeneratedCss, hasTailwindGeneratedCssMarkers, removeTailwindGeneratedCssByBanner, splitTailwindGeneratedCssByBanner, splitTailwindV4GeneratedCss, splitTailwindV4GeneratedCssBySourceOrder, stripGeneratorPlaceholderMarkers, stripTailwindBanner, stripTailwindBanners, } from './generator-css/markers';
|
|
8
8
|
export { resolveGeneratorSource, } from './generator-css/source-resolver';
|
|
9
9
|
export interface GenerateCssByGeneratorOptions {
|
|
10
10
|
opts: InternalUserDefinedOptions;
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_precheck = require("./precheck-
|
|
3
|
+
const require_precheck = require("./precheck-GcUdX1BX.js");
|
|
4
4
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
5
5
|
//#region src/core.ts
|
|
6
6
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-
|
|
1
|
+
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-DMXLnfTN.mjs";
|
|
2
2
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
3
3
|
//#region src/core.ts
|
|
4
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
2
|
//#region src/generator/options.ts
|
|
3
3
|
function normalizeWeappTailwindcssGeneratorOptions(options) {
|
|
4
4
|
if (options == null) return {
|
package/dist/generator.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_generator = require("./generator-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
4
|
+
const require_generator = require("./generator-CImaTibB.js");
|
|
5
5
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
6
6
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
7
7
|
exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
|
package/dist/generator.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-DSMdL4vg.mjs";
|
|
3
3
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
package/dist/gulp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
-
const require_source_candidates = require("./source-candidates-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-CH1L--wj.js");
|
|
5
|
+
const require_precheck = require("./precheck-GcUdX1BX.js");
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-CkTBauKa.js");
|
|
7
|
+
const require_source_candidates = require("./source-candidates-ES3ttZPe.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
10
|
let node_path = require("node:path");
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-
|
|
2
|
-
import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-
|
|
3
|
-
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-
|
|
4
|
-
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
5
|
-
import { t as createSourceCandidateCollector } from "./source-candidates-
|
|
1
|
+
import { F as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
|
+
import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-P-3ZoWW5.mjs";
|
|
3
|
+
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-DMXLnfTN.mjs";
|
|
4
|
+
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-fe0rGj7T.mjs";
|
|
5
|
+
import { t as createSourceCandidateCollector } from "./source-candidates-om5-wQJ0.mjs";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
package/dist/{incremental-runtime-class-set-B4EXHHii.js → incremental-runtime-class-set-CH1L--wj.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_precheck = require("./precheck-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
|
+
const require_generator = require("./generator-CImaTibB.js");
|
|
4
|
+
const require_precheck = require("./precheck-GcUdX1BX.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-CkTBauKa.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let postcss = require("postcss");
|
|
8
8
|
postcss = require_chunk.__toESM(postcss);
|
|
@@ -17,6 +17,7 @@ const TAILWIND_GENERATED_CSS_MARKER_RE = /\/\*!\s*tailwindcss v|@property\s+--tw
|
|
|
17
17
|
const GENERATOR_PLACEHOLDER_MARKER_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\//i;
|
|
18
18
|
const GENERATOR_PLACEHOLDER_MARKER_GLOBAL_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\/\s*/gi;
|
|
19
19
|
const TAILWIND_BANNER_PREFIX_RE = /^\/\*!\s*tailwindcss v[^*]*\*\/\s*/i;
|
|
20
|
+
const TAILWIND_BANNER_RE = /\/\*!\s*tailwindcss v[^*]*\*\//i;
|
|
20
21
|
const TAILWIND_BANNER_GLOBAL_RE = /\/\*!\s*tailwindcss v[^*]*\*\/\s*/gi;
|
|
21
22
|
const VITE_MARKER_RE = /\/\*\$vite\$:[^*]*\*\//g;
|
|
22
23
|
function createCssAppend(base, extra) {
|
|
@@ -24,14 +25,31 @@ function createCssAppend(base, extra) {
|
|
|
24
25
|
if (!extra) return base;
|
|
25
26
|
return `${base}\n${extra}`;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function splitTailwindV4GeneratedCssBySourceOrder(rawSource, rawTailwindCss) {
|
|
28
29
|
const trimmedRaw = rawSource.trim();
|
|
29
30
|
const trimmedTailwind = rawTailwindCss.trim();
|
|
30
|
-
if (trimmedRaw === trimmedTailwind) return
|
|
31
|
-
|
|
31
|
+
if (trimmedRaw === trimmedTailwind) return {
|
|
32
|
+
before: "",
|
|
33
|
+
after: ""
|
|
34
|
+
};
|
|
35
|
+
if (trimmedTailwind.startsWith(trimmedRaw)) return {
|
|
36
|
+
before: "",
|
|
37
|
+
after: ""
|
|
38
|
+
};
|
|
32
39
|
const start = rawSource.indexOf(rawTailwindCss);
|
|
33
40
|
if (start === -1) return;
|
|
34
|
-
return
|
|
41
|
+
return {
|
|
42
|
+
before: rawSource.slice(0, start),
|
|
43
|
+
after: rawSource.slice(start + rawTailwindCss.length)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function splitTailwindGeneratedCssByBanner(rawSource, start) {
|
|
47
|
+
const match = start === void 0 ? TAILWIND_BANNER_RE.exec(rawSource) : { index: start };
|
|
48
|
+
if (!match || match.index === void 0) return;
|
|
49
|
+
return {
|
|
50
|
+
before: rawSource.slice(0, match.index),
|
|
51
|
+
after: [...rawSource.slice(match.index).matchAll(VITE_MARKER_RE)].map((item) => item[0]).join("\n")
|
|
52
|
+
};
|
|
35
53
|
}
|
|
36
54
|
function stripTailwindBanner(css) {
|
|
37
55
|
return css.replace(TAILWIND_BANNER_PREFIX_RE, "");
|
|
@@ -1635,6 +1653,39 @@ function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOpt
|
|
|
1635
1653
|
function isLocalImportRequest(request) {
|
|
1636
1654
|
return request.length > 0 && !request.startsWith("tailwindcss") && !request.startsWith("weapp-tailwindcss") && !request.startsWith("data:") && !REMOTE_IMPORT_RE.test(request);
|
|
1637
1655
|
}
|
|
1656
|
+
function isCommentOnlyCss(source) {
|
|
1657
|
+
try {
|
|
1658
|
+
const root = postcss.default.parse(source);
|
|
1659
|
+
return root.nodes.length > 0 && root.nodes.every((node) => node.type === "comment");
|
|
1660
|
+
} catch {
|
|
1661
|
+
return false;
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
function createCssSourceOrderAppend(base, extra) {
|
|
1665
|
+
if (!base) return extra;
|
|
1666
|
+
if (!extra) return base;
|
|
1667
|
+
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
1668
|
+
return `${base}\n${extra}`;
|
|
1669
|
+
}
|
|
1670
|
+
function splitRawSourceByGeneratedCssOrder(rawSource, rawTailwindCss) {
|
|
1671
|
+
const exactParts = splitTailwindV4GeneratedCssBySourceOrder(rawSource, rawTailwindCss);
|
|
1672
|
+
if (exactParts) return exactParts;
|
|
1673
|
+
return splitTailwindGeneratedCssByBanner(rawSource);
|
|
1674
|
+
}
|
|
1675
|
+
async function transformGeneratorUserCss(source, options) {
|
|
1676
|
+
if (source.trim().length === 0) return "";
|
|
1677
|
+
const cleanedSource = removeTailwindSourceDirectives(source, { importFallback: options.importFallback });
|
|
1678
|
+
if (cleanedSource.trim().length === 0) return "";
|
|
1679
|
+
const extraSource = options.generatorTarget === "weapp" ? removeUnsupportedMiniProgramAtRules(cleanedSource) : cleanedSource;
|
|
1680
|
+
if (extraSource.trim().length === 0) return "";
|
|
1681
|
+
if (isCommentOnlyCss(extraSource)) return extraSource;
|
|
1682
|
+
if (options.generatorTarget !== "weapp") return extraSource;
|
|
1683
|
+
const { css } = await options.styleHandler(extraSource, {
|
|
1684
|
+
...options.generatorStyleOptions,
|
|
1685
|
+
...options.cssUserHandlerOptions
|
|
1686
|
+
});
|
|
1687
|
+
return removeUnsupportedMiniProgramAtRules(css);
|
|
1688
|
+
}
|
|
1638
1689
|
function isPureLocalCssImportWrapper(css) {
|
|
1639
1690
|
let hasImport = false;
|
|
1640
1691
|
try {
|
|
@@ -1756,29 +1807,21 @@ async function generateCssByGenerator(options) {
|
|
|
1756
1807
|
incremental: true
|
|
1757
1808
|
};
|
|
1758
1809
|
}
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1810
|
+
const hasMatchedCssSourceFile = sources.some((source) => source.__weappTailwindcssMeta?.matchedCssSourceFile);
|
|
1811
|
+
const orderedExtraCss = hasMatchedCssSourceFile ? splitTailwindV4GeneratedCssBySourceOrder(effectiveRawSource, generated.rawCss) : splitRawSourceByGeneratedCssOrder(effectiveRawSource, generated.rawCss);
|
|
1812
|
+
if (orderedExtraCss) {
|
|
1761
1813
|
let css = stripTailwindBanner(generated.css);
|
|
1762
1814
|
if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
if (generated.target === "weapp") {
|
|
1774
|
-
const { css: userCss } = await styleHandler(extraSource, {
|
|
1775
|
-
...generatorStyleOptions,
|
|
1776
|
-
...cssUserHandlerOptions
|
|
1777
|
-
});
|
|
1778
|
-
css = createCssAppend(css, removeUnsupportedMiniProgramAtRules(userCss));
|
|
1779
|
-
} else css = createCssAppend(css, extraSource);
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1815
|
+
const userCssOptions = {
|
|
1816
|
+
generatorTarget: generated.target,
|
|
1817
|
+
generatorStyleOptions,
|
|
1818
|
+
cssUserHandlerOptions,
|
|
1819
|
+
styleHandler,
|
|
1820
|
+
importFallback: generatorOptions.importFallback
|
|
1821
|
+
};
|
|
1822
|
+
const beforeUserCss = await transformGeneratorUserCss(orderedExtraCss.before, userCssOptions);
|
|
1823
|
+
const afterUserCss = await transformGeneratorUserCss(orderedExtraCss.after, userCssOptions);
|
|
1824
|
+
css = createCssSourceOrderAppend(createCssSourceOrderAppend(beforeUserCss, css), afterUserCss);
|
|
1782
1825
|
if (generated.target === "weapp") {
|
|
1783
1826
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1784
1827
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
@@ -1793,7 +1836,7 @@ async function generateCssByGenerator(options) {
|
|
|
1793
1836
|
debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
|
|
1794
1837
|
let css = stripTailwindBanner(generated.css);
|
|
1795
1838
|
if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1796
|
-
if (
|
|
1839
|
+
if (hasMatchedCssSourceFile) return {
|
|
1797
1840
|
css: finalizeMiniProgramGeneratorCss(css, generated.target, majorVersion, opts.cssPreflight),
|
|
1798
1841
|
target: generated.target,
|
|
1799
1842
|
source: "generator",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as omitUndefined, E as removeUnsupportedCascadeLayers, F as createDebug, O as loadTailwindV4DesignSystem, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import { l as replaceWxml } from "./precheck-
|
|
4
|
-
import { i as resolveUniAppXOptions } from "./tailwindcss-
|
|
1
|
+
import { B as omitUndefined, E as removeUnsupportedCascadeLayers, F as createDebug, O as loadTailwindV4DesignSystem, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-DSMdL4vg.mjs";
|
|
3
|
+
import { l as replaceWxml } from "./precheck-DMXLnfTN.mjs";
|
|
4
|
+
import { i as resolveUniAppXOptions } from "./tailwindcss-fe0rGj7T.mjs";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
import postcss from "postcss";
|
|
7
7
|
import path from "node:path";
|
|
@@ -13,6 +13,7 @@ const TAILWIND_GENERATED_CSS_MARKER_RE = /\/\*!\s*tailwindcss v|@property\s+--tw
|
|
|
13
13
|
const GENERATOR_PLACEHOLDER_MARKER_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\//i;
|
|
14
14
|
const GENERATOR_PLACEHOLDER_MARKER_GLOBAL_RE = /\/\*!\s*weapp-tailwindcss generator-placeholder\s*\*\/\s*/gi;
|
|
15
15
|
const TAILWIND_BANNER_PREFIX_RE = /^\/\*!\s*tailwindcss v[^*]*\*\/\s*/i;
|
|
16
|
+
const TAILWIND_BANNER_RE = /\/\*!\s*tailwindcss v[^*]*\*\//i;
|
|
16
17
|
const TAILWIND_BANNER_GLOBAL_RE = /\/\*!\s*tailwindcss v[^*]*\*\/\s*/gi;
|
|
17
18
|
const VITE_MARKER_RE = /\/\*\$vite\$:[^*]*\*\//g;
|
|
18
19
|
function createCssAppend(base, extra) {
|
|
@@ -20,14 +21,31 @@ function createCssAppend(base, extra) {
|
|
|
20
21
|
if (!extra) return base;
|
|
21
22
|
return `${base}\n${extra}`;
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function splitTailwindV4GeneratedCssBySourceOrder(rawSource, rawTailwindCss) {
|
|
24
25
|
const trimmedRaw = rawSource.trim();
|
|
25
26
|
const trimmedTailwind = rawTailwindCss.trim();
|
|
26
|
-
if (trimmedRaw === trimmedTailwind) return
|
|
27
|
-
|
|
27
|
+
if (trimmedRaw === trimmedTailwind) return {
|
|
28
|
+
before: "",
|
|
29
|
+
after: ""
|
|
30
|
+
};
|
|
31
|
+
if (trimmedTailwind.startsWith(trimmedRaw)) return {
|
|
32
|
+
before: "",
|
|
33
|
+
after: ""
|
|
34
|
+
};
|
|
28
35
|
const start = rawSource.indexOf(rawTailwindCss);
|
|
29
36
|
if (start === -1) return;
|
|
30
|
-
return
|
|
37
|
+
return {
|
|
38
|
+
before: rawSource.slice(0, start),
|
|
39
|
+
after: rawSource.slice(start + rawTailwindCss.length)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function splitTailwindGeneratedCssByBanner(rawSource, start) {
|
|
43
|
+
const match = start === void 0 ? TAILWIND_BANNER_RE.exec(rawSource) : { index: start };
|
|
44
|
+
if (!match || match.index === void 0) return;
|
|
45
|
+
return {
|
|
46
|
+
before: rawSource.slice(0, match.index),
|
|
47
|
+
after: [...rawSource.slice(match.index).matchAll(VITE_MARKER_RE)].map((item) => item[0]).join("\n")
|
|
48
|
+
};
|
|
31
49
|
}
|
|
32
50
|
function stripTailwindBanner(css) {
|
|
33
51
|
return css.replace(TAILWIND_BANNER_PREFIX_RE, "");
|
|
@@ -1631,6 +1649,39 @@ function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOpt
|
|
|
1631
1649
|
function isLocalImportRequest(request) {
|
|
1632
1650
|
return request.length > 0 && !request.startsWith("tailwindcss") && !request.startsWith("weapp-tailwindcss") && !request.startsWith("data:") && !REMOTE_IMPORT_RE.test(request);
|
|
1633
1651
|
}
|
|
1652
|
+
function isCommentOnlyCss(source) {
|
|
1653
|
+
try {
|
|
1654
|
+
const root = postcss.parse(source);
|
|
1655
|
+
return root.nodes.length > 0 && root.nodes.every((node) => node.type === "comment");
|
|
1656
|
+
} catch {
|
|
1657
|
+
return false;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
function createCssSourceOrderAppend(base, extra) {
|
|
1661
|
+
if (!base) return extra;
|
|
1662
|
+
if (!extra) return base;
|
|
1663
|
+
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
1664
|
+
return `${base}\n${extra}`;
|
|
1665
|
+
}
|
|
1666
|
+
function splitRawSourceByGeneratedCssOrder(rawSource, rawTailwindCss) {
|
|
1667
|
+
const exactParts = splitTailwindV4GeneratedCssBySourceOrder(rawSource, rawTailwindCss);
|
|
1668
|
+
if (exactParts) return exactParts;
|
|
1669
|
+
return splitTailwindGeneratedCssByBanner(rawSource);
|
|
1670
|
+
}
|
|
1671
|
+
async function transformGeneratorUserCss(source, options) {
|
|
1672
|
+
if (source.trim().length === 0) return "";
|
|
1673
|
+
const cleanedSource = removeTailwindSourceDirectives(source, { importFallback: options.importFallback });
|
|
1674
|
+
if (cleanedSource.trim().length === 0) return "";
|
|
1675
|
+
const extraSource = options.generatorTarget === "weapp" ? removeUnsupportedMiniProgramAtRules(cleanedSource) : cleanedSource;
|
|
1676
|
+
if (extraSource.trim().length === 0) return "";
|
|
1677
|
+
if (isCommentOnlyCss(extraSource)) return extraSource;
|
|
1678
|
+
if (options.generatorTarget !== "weapp") return extraSource;
|
|
1679
|
+
const { css } = await options.styleHandler(extraSource, {
|
|
1680
|
+
...options.generatorStyleOptions,
|
|
1681
|
+
...options.cssUserHandlerOptions
|
|
1682
|
+
});
|
|
1683
|
+
return removeUnsupportedMiniProgramAtRules(css);
|
|
1684
|
+
}
|
|
1634
1685
|
function isPureLocalCssImportWrapper(css) {
|
|
1635
1686
|
let hasImport = false;
|
|
1636
1687
|
try {
|
|
@@ -1752,29 +1803,21 @@ async function generateCssByGenerator(options) {
|
|
|
1752
1803
|
incremental: true
|
|
1753
1804
|
};
|
|
1754
1805
|
}
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1806
|
+
const hasMatchedCssSourceFile = sources.some((source) => source.__weappTailwindcssMeta?.matchedCssSourceFile);
|
|
1807
|
+
const orderedExtraCss = hasMatchedCssSourceFile ? splitTailwindV4GeneratedCssBySourceOrder(effectiveRawSource, generated.rawCss) : splitRawSourceByGeneratedCssOrder(effectiveRawSource, generated.rawCss);
|
|
1808
|
+
if (orderedExtraCss) {
|
|
1757
1809
|
let css = stripTailwindBanner(generated.css);
|
|
1758
1810
|
if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
if (generated.target === "weapp") {
|
|
1770
|
-
const { css: userCss } = await styleHandler(extraSource, {
|
|
1771
|
-
...generatorStyleOptions,
|
|
1772
|
-
...cssUserHandlerOptions
|
|
1773
|
-
});
|
|
1774
|
-
css = createCssAppend(css, removeUnsupportedMiniProgramAtRules(userCss));
|
|
1775
|
-
} else css = createCssAppend(css, extraSource);
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1811
|
+
const userCssOptions = {
|
|
1812
|
+
generatorTarget: generated.target,
|
|
1813
|
+
generatorStyleOptions,
|
|
1814
|
+
cssUserHandlerOptions,
|
|
1815
|
+
styleHandler,
|
|
1816
|
+
importFallback: generatorOptions.importFallback
|
|
1817
|
+
};
|
|
1818
|
+
const beforeUserCss = await transformGeneratorUserCss(orderedExtraCss.before, userCssOptions);
|
|
1819
|
+
const afterUserCss = await transformGeneratorUserCss(orderedExtraCss.after, userCssOptions);
|
|
1820
|
+
css = createCssSourceOrderAppend(createCssSourceOrderAppend(beforeUserCss, css), afterUserCss);
|
|
1778
1821
|
if (generated.target === "weapp") {
|
|
1779
1822
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1780
1823
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
@@ -1789,7 +1832,7 @@ async function generateCssByGenerator(options) {
|
|
|
1789
1832
|
debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
|
|
1790
1833
|
let css = stripTailwindBanner(generated.css);
|
|
1791
1834
|
if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1792
|
-
if (
|
|
1835
|
+
if (hasMatchedCssSourceFile) return {
|
|
1793
1836
|
css: finalizeMiniProgramGeneratorCss(css, generated.target, majorVersion, opts.cssPreflight),
|
|
1794
1837
|
target: generated.target,
|
|
1795
1838
|
source: "generator",
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-CImaTibB.js");
|
|
3
3
|
const require_gulp = require("./gulp.js");
|
|
4
|
-
const require_postcss = require("./postcss-
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
4
|
+
const require_postcss = require("./postcss-k0BshZZQ.js");
|
|
5
|
+
const require_vite = require("./vite-Bob_Mrva.js");
|
|
6
|
+
const require_webpack = require("./webpack-BedfyGbF.js");
|
|
7
7
|
exports.UnifiedWebpackPluginV5 = require_webpack.UnifiedWebpackPluginV5;
|
|
8
8
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
9
9
|
exports.createPlugins = require_gulp.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-DSMdL4vg.mjs";
|
|
2
2
|
import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
|
|
3
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-
|
|
3
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-CgFCqilE.mjs";
|
|
4
|
+
import { t as WeappTailwindcss } from "./vite-cBjGYHFH.mjs";
|
|
5
|
+
import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-Cq45BZzs.mjs";
|
|
6
6
|
export { UnifiedWebpackPluginV5, WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as createSourceScanPattern, L as readInstalledPackageMajorVersion, M as normalizeLegacyContentEntries, N as parseConfigParam, P as resolveCssSourceEntries, j as expandTailwindSourceEntries, k as collectCssInlineSourceCandidates, t as resolveTailwindV3Source, y as resolveTailwindV4Source$1 } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { A as createSourceScanPattern, L as readInstalledPackageMajorVersion, M as normalizeLegacyContentEntries, N as parseConfigParam, P as resolveCssSourceEntries, j as expandTailwindSourceEntries, k as collectCssInlineSourceCandidates, t as resolveTailwindV3Source, y as resolveTailwindV4Source$1 } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-DSMdL4vg.mjs";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
|
+
const require_generator = require("./generator-CImaTibB.js");
|
|
4
4
|
let postcss = require("postcss");
|
|
5
5
|
postcss = require_chunk.__toESM(postcss);
|
|
6
6
|
let node_path = require("node:path");
|
package/dist/postcss.js
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_postcss = require("./postcss-
|
|
5
|
+
const require_postcss = require("./postcss-k0BshZZQ.js");
|
|
6
6
|
exports.default = require_postcss.weappTailwindcssPostcssPlugin;
|
|
7
7
|
exports.weappTailwindcssPostcssPlugin = require_postcss.weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
1
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-CgFCqilE.mjs";
|
|
2
2
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as omitUndefined, C as createTailwindV4Engine, F as createDebug, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { B as omitUndefined, C as createTailwindV4Engine, F as createDebug, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
2
|
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-B1igPF_e.mjs";
|
|
3
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-CGBVVNm6.mjs";
|
|
4
|
-
import { a as applyV4CssCalcDefaults, i as resolveUniAppXOptions, o as warnMissingCssEntries, r as isUniAppXEnabled, t as createTailwindcssPatcherFromContext } from "./tailwindcss-
|
|
4
|
+
import { a as applyV4CssCalcDefaults, i as resolveUniAppXOptions, o as warnMissingCssEntries, r as isUniAppXEnabled, t as createTailwindcssPatcherFromContext } from "./tailwindcss-fe0rGj7T.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
3
|
const require_defaults = require("./defaults-IHhYxNeU.js");
|
|
4
4
|
require("./utils-4ODFyoqD.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-CkTBauKa.js");
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
node_path = require_chunk.__toESM(node_path);
|
|
8
8
|
let node_process = require("node:process");
|
package/dist/presets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
4
4
|
const require_utils = require("./utils-4ODFyoqD.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-CkTBauKa.js");
|
|
6
6
|
require("./logger-EVNB9z7i.js");
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_chunk.__toESM(node_process);
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as omitUndefined } from "./v3-engine-
|
|
1
|
+
import { B as omitUndefined } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
2
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-CGBVVNm6.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-fe0rGj7T.mjs";
|
|
4
4
|
import { t as logger } from "./logger-CZUxvJJD.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { getPackageInfoSync } from "local-pkg";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_chunk.__toESM(node_path);
|
|
5
5
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as expandTailwindSourceEntries } from "./v3-engine-
|
|
1
|
+
import { j as expandTailwindSourceEntries } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { extractSourceCandidates } from "tailwindcss-patch";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
3
|
require("./utils-4ODFyoqD.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_module = require("node:module");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as omitUndefined, H as findWorkspacePackageDir, I as createTailwindcssPatcher, L as readInstalledPackageMajorVersion, U as findWorkspaceRoot, V as findNearestPackageRoot, f as runtimeSignaturePatchersSymbol } from "./v3-engine-
|
|
1
|
+
import { B as omitUndefined, H as findWorkspacePackageDir, I as createTailwindcssPatcher, L as readInstalledPackageMajorVersion, U as findWorkspaceRoot, V as findNearestPackageRoot, f as runtimeSignaturePatchersSymbol } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
2
|
import { n as defuOverrideArray } from "./utils-CGBVVNm6.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -656,6 +656,13 @@ function removeUnsupportedCascadeLayers(root) {
|
|
|
656
656
|
const DEFAULT_WEAPP_VARIABLE_SCOPE = "page,.tw-root,wx-root-portal-content,:host";
|
|
657
657
|
const CLASS_SELECTOR_RE = /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i;
|
|
658
658
|
const PSEUDO_CONTENT_SELECTOR_RE = /^(?:::before|::after|:before|:after)(?:,(?:::before|::after|:before|:after))*$/;
|
|
659
|
+
const MINI_PROGRAM_THEME_SCOPE_SELECTORS = new Set([
|
|
660
|
+
":root",
|
|
661
|
+
":host",
|
|
662
|
+
"page",
|
|
663
|
+
".tw-root",
|
|
664
|
+
"wx-root-portal-content"
|
|
665
|
+
]);
|
|
659
666
|
const MINI_PROGRAM_PREFLIGHT_SELECTORS = new Set([
|
|
660
667
|
"*",
|
|
661
668
|
"view",
|
|
@@ -730,6 +737,10 @@ function isMiniProgramPreflightRule(rule) {
|
|
|
730
737
|
});
|
|
731
738
|
return hasTailwindVariable || hasResetProp;
|
|
732
739
|
}
|
|
740
|
+
function isMiniProgramThemeScopeRule(rule) {
|
|
741
|
+
const selectors = getRuleSelectors(rule);
|
|
742
|
+
return selectors.length > 0 && selectors.every((selector) => MINI_PROGRAM_THEME_SCOPE_SELECTORS.has(selector));
|
|
743
|
+
}
|
|
733
744
|
function isKeyframesRule(rule) {
|
|
734
745
|
let parent = rule.parent;
|
|
735
746
|
while (parent) {
|
|
@@ -756,6 +767,10 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
|
|
|
756
767
|
});
|
|
757
768
|
root.walkRules((rule) => {
|
|
758
769
|
if (isKeyframesRule(rule)) return;
|
|
770
|
+
if (isCustomPropertyRule(rule) && isMiniProgramThemeScopeRule(rule)) {
|
|
771
|
+
rule.selector = DEFAULT_WEAPP_VARIABLE_SCOPE;
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
759
774
|
if (hasClassSelector(rule.selector)) return;
|
|
760
775
|
if (!shouldPreserveContentInit) removeEmptyContentInitDeclarations(rule);
|
|
761
776
|
if (isPseudoContentInitRule(rule)) {
|
|
@@ -664,6 +664,13 @@ function removeUnsupportedCascadeLayers(root) {
|
|
|
664
664
|
const DEFAULT_WEAPP_VARIABLE_SCOPE = "page,.tw-root,wx-root-portal-content,:host";
|
|
665
665
|
const CLASS_SELECTOR_RE = /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i;
|
|
666
666
|
const PSEUDO_CONTENT_SELECTOR_RE = /^(?:::before|::after|:before|:after)(?:,(?:::before|::after|:before|:after))*$/;
|
|
667
|
+
const MINI_PROGRAM_THEME_SCOPE_SELECTORS = new Set([
|
|
668
|
+
":root",
|
|
669
|
+
":host",
|
|
670
|
+
"page",
|
|
671
|
+
".tw-root",
|
|
672
|
+
"wx-root-portal-content"
|
|
673
|
+
]);
|
|
667
674
|
const MINI_PROGRAM_PREFLIGHT_SELECTORS = new Set([
|
|
668
675
|
"*",
|
|
669
676
|
"view",
|
|
@@ -738,6 +745,10 @@ function isMiniProgramPreflightRule(rule) {
|
|
|
738
745
|
});
|
|
739
746
|
return hasTailwindVariable || hasResetProp;
|
|
740
747
|
}
|
|
748
|
+
function isMiniProgramThemeScopeRule(rule) {
|
|
749
|
+
const selectors = getRuleSelectors(rule);
|
|
750
|
+
return selectors.length > 0 && selectors.every((selector) => MINI_PROGRAM_THEME_SCOPE_SELECTORS.has(selector));
|
|
751
|
+
}
|
|
741
752
|
function isKeyframesRule(rule) {
|
|
742
753
|
let parent = rule.parent;
|
|
743
754
|
while (parent) {
|
|
@@ -764,6 +775,10 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
|
|
|
764
775
|
});
|
|
765
776
|
root.walkRules((rule) => {
|
|
766
777
|
if (isKeyframesRule(rule)) return;
|
|
778
|
+
if (isCustomPropertyRule(rule) && isMiniProgramThemeScopeRule(rule)) {
|
|
779
|
+
rule.selector = DEFAULT_WEAPP_VARIABLE_SCOPE;
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
767
782
|
if (hasClassSelector(rule.selector)) return;
|
|
768
783
|
if (!shouldPreserveContentInit) removeEmptyContentInitDeclarations(rule);
|
|
769
784
|
if (isPseudoContentInitRule(rule)) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
|
+
const require_generator = require("./generator-CImaTibB.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-CH1L--wj.js");
|
|
5
|
+
const require_precheck = require("./precheck-GcUdX1BX.js");
|
|
6
6
|
const require_utils = require("./utils-4ODFyoqD.js");
|
|
7
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
8
|
-
const require_source_candidates = require("./source-candidates-
|
|
9
|
-
const require_bundle_state = require("./bundle-state-
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-CkTBauKa.js");
|
|
8
|
+
const require_source_candidates = require("./source-candidates-ES3ttZPe.js");
|
|
9
|
+
const require_bundle_state = require("./bundle-state-ClSg28Qk.js");
|
|
10
10
|
require("./logger-EVNB9z7i.js");
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { B as omitUndefined, D as filterUnsupportedMiniProgramTailwindV4Candidates, F as createDebug, R as findTailwindConfig, V as findNearestPackageRoot, _ as resolveViteSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as createViteSourceScanMatcher, v as resolveViteTailwindV4CssDependencies, z as resolveTailwindcssOptions } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-
|
|
3
|
-
import { a as validateCandidatesByGenerator, c as hasTailwindSourceDirectives, i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, n as createHmrTimingRecorder, o as processCachedTask, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager, u as hasTailwindGeneratedCssMarkers } from "./incremental-runtime-class-set-
|
|
4
|
-
import { a as analyzeSource, c as isClassContextLiteralPath, g as createTailwindRuntimeReadyPromise, h as collectRuntimeClassSet, i as createAttributeMatcher, l as replaceWxml, m as toCustomAttributesEntities, n as getCompilerContext, o as JsTokenUpdater, p as vitePluginName, r as generateCode, s as _defineProperty, t as shouldSkipJsTransform, u as babelParse, v as refreshTailwindRuntimeState } from "./precheck-
|
|
1
|
+
import { B as omitUndefined, D as filterUnsupportedMiniProgramTailwindV4Candidates, F as createDebug, R as findTailwindConfig, V as findNearestPackageRoot, _ as resolveViteSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as createViteSourceScanMatcher, v as resolveViteTailwindV4CssDependencies, z as resolveTailwindcssOptions } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-DSMdL4vg.mjs";
|
|
3
|
+
import { a as validateCandidatesByGenerator, c as hasTailwindSourceDirectives, i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, n as createHmrTimingRecorder, o as processCachedTask, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager, u as hasTailwindGeneratedCssMarkers } from "./incremental-runtime-class-set-P-3ZoWW5.mjs";
|
|
4
|
+
import { a as analyzeSource, c as isClassContextLiteralPath, g as createTailwindRuntimeReadyPromise, h as collectRuntimeClassSet, i as createAttributeMatcher, l as replaceWxml, m as toCustomAttributesEntities, n as getCompilerContext, o as JsTokenUpdater, p as vitePluginName, r as generateCode, s as _defineProperty, t as shouldSkipJsTransform, u as babelParse, v as refreshTailwindRuntimeState } from "./precheck-DMXLnfTN.mjs";
|
|
5
5
|
import { o as resolveUniUtsPlatform } from "./utils-CGBVVNm6.mjs";
|
|
6
|
-
import { c as upsertTailwindV4CssSource, i as resolveUniAppXOptions, r as isUniAppXEnabled, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
7
|
-
import { n as isSourceCandidateRequest, t as createSourceCandidateCollector } from "./source-candidates-
|
|
8
|
-
import { a as createBundleModuleGraphOptions, c as resolvePluginDisabledState, d as normalizeOutputPathKey, i as applyLinkedResults, l as isSourceStyleRequest, n as createBundleBuildState, o as pushConcurrentTaskFactories, p as toAbsoluteOutputPath, r as updateBundleBuildState, s as resolvePackageDir, t as buildBundleSnapshot } from "./bundle-state-
|
|
6
|
+
import { c as upsertTailwindV4CssSource, i as resolveUniAppXOptions, r as isUniAppXEnabled, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-fe0rGj7T.mjs";
|
|
7
|
+
import { n as isSourceCandidateRequest, t as createSourceCandidateCollector } from "./source-candidates-om5-wQJ0.mjs";
|
|
8
|
+
import { a as createBundleModuleGraphOptions, c as resolvePluginDisabledState, d as normalizeOutputPathKey, i as applyLinkedResults, l as isSourceStyleRequest, n as createBundleBuildState, o as pushConcurrentTaskFactories, p as toAbsoluteOutputPath, r as updateBundleBuildState, s as resolvePackageDir, t as buildBundleSnapshot } from "./bundle-state-CrhkNTsw.mjs";
|
|
9
9
|
import { t as logger$1 } from "./logger-CZUxvJJD.mjs";
|
|
10
10
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vite = require("./vite-
|
|
2
|
+
const require_vite = require("./vite-Bob_Mrva.js");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-cBjGYHFH.mjs";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
4
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-v__n8_Sd.js");
|
|
3
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-CH1L--wj.js");
|
|
4
|
+
const require_precheck = require("./precheck-GcUdX1BX.js");
|
|
5
5
|
const require_utils = require("./utils-4ODFyoqD.js");
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
-
const require_bundle_state = require("./bundle-state-
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-CkTBauKa.js");
|
|
7
|
+
const require_bundle_state = require("./bundle-state-ClSg28Qk.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
10
|
let node_module = require("node:module");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { F as createDebug, l as getRuntimeClassSetSignature, z as resolveTailwindcssOptions } from "./v3-engine-
|
|
2
|
-
import { i as generateCssByGenerator, o as processCachedTask, r as emitHmrTiming, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-
|
|
3
|
-
import { _ as ensureRuntimeClassSet, f as pluginName, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, s as _defineProperty, t as shouldSkipJsTransform, v as refreshTailwindRuntimeState } from "./precheck-
|
|
1
|
+
import { F as createDebug, l as getRuntimeClassSetSignature, z as resolveTailwindcssOptions } from "./v3-engine-qoWtwjIj.mjs";
|
|
2
|
+
import { i as generateCssByGenerator, o as processCachedTask, r as emitHmrTiming, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-P-3ZoWW5.mjs";
|
|
3
|
+
import { _ as ensureRuntimeClassSet, f as pluginName, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, s as _defineProperty, t as shouldSkipJsTransform, v as refreshTailwindRuntimeState } from "./precheck-DMXLnfTN.mjs";
|
|
4
4
|
import { r as getGroupedEntries } from "./utils-CGBVVNm6.mjs";
|
|
5
|
-
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
6
|
-
import { c as resolvePluginDisabledState, f as resolveOutputSpecifier, l as isSourceStyleRequest, n as createBundleBuildState, o as pushConcurrentTaskFactories, p as toAbsoluteOutputPath, r as updateBundleBuildState, s as resolvePackageDir, t as buildBundleSnapshot, u as stripRequestQuery } from "./bundle-state-
|
|
5
|
+
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-fe0rGj7T.mjs";
|
|
6
|
+
import { c as resolvePluginDisabledState, f as resolveOutputSpecifier, l as isSourceStyleRequest, n as createBundleBuildState, o as pushConcurrentTaskFactories, p as toAbsoluteOutputPath, r as updateBundleBuildState, s as resolvePackageDir, t as buildBundleSnapshot, u as stripRequestQuery } from "./bundle-state-CrhkNTsw.mjs";
|
|
7
7
|
import Module, { createRequire } from "node:module";
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
import path from "node:path";
|
package/dist/webpack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_webpack = require("./webpack-
|
|
2
|
+
const require_webpack = require("./webpack-BedfyGbF.js");
|
|
3
3
|
exports.UnifiedWebpackPluginV5 = require_webpack.UnifiedWebpackPluginV5;
|
|
4
4
|
exports.WeappTailwindcss = require_webpack.UnifiedWebpackPluginV5;
|
|
5
5
|
exports.weappTailwindcss = require_webpack.UnifiedWebpackPluginV5;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-Cq45BZzs.mjs";
|
|
2
2
|
export { UnifiedWebpackPluginV5, UnifiedWebpackPluginV5 as WeappTailwindcss, UnifiedWebpackPluginV5 as weappTailwindcss, weappTailwindcssPackageDir };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.15",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"fast-glob": "^3.3.3",
|
|
182
182
|
"htmlparser2": "10.1.0",
|
|
183
183
|
"loader-utils": "2.0.4",
|
|
184
|
-
"local-pkg": "^1.1
|
|
184
|
+
"local-pkg": "^1.2.1",
|
|
185
185
|
"lru-cache": "10.4.3",
|
|
186
186
|
"magic-string": "0.30.21",
|
|
187
187
|
"micromatch": "^4.0.8",
|
|
@@ -189,11 +189,11 @@
|
|
|
189
189
|
"semver": "~7.8.0",
|
|
190
190
|
"tailwindcss-patch": "9.3.5",
|
|
191
191
|
"yaml": "^2.9.0",
|
|
192
|
-
"@weapp-tailwindcss/logger": "1.1.0",
|
|
193
192
|
"@weapp-tailwindcss/postcss": "2.2.1-next.2",
|
|
193
|
+
"tailwindcss-config": "1.1.6-next.1",
|
|
194
194
|
"@weapp-tailwindcss/reset": "0.1.1-next.0",
|
|
195
195
|
"@weapp-tailwindcss/shared": "1.1.3",
|
|
196
|
-
"tailwindcss
|
|
196
|
+
"@weapp-tailwindcss/logger": "1.1.0"
|
|
197
197
|
},
|
|
198
198
|
"scripts": {
|
|
199
199
|
"dev": "tsdown --watch --sourcemap",
|