weapp-tailwindcss 5.0.0-next.9 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/auto-DEHRmEAx.mjs +200 -0
- package/dist/auto-dPpsm6FB.js +238 -0
- package/dist/bundle-state-CnaJxkFY.mjs +413 -0
- package/dist/bundle-state-DgGEhk_z.js +529 -0
- package/dist/bundlers/shared/cache.d.ts +9 -7
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -2
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -3
- package/dist/bundlers/shared/css-imports.d.ts +3 -3
- package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +11 -3
- package/dist/bundlers/shared/generator-css/markers.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +9 -6
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +16 -2
- package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +10 -0
- package/dist/bundlers/shared/generator-css.d.ts +6 -2
- package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
- package/dist/bundlers/shared/style-requests.d.ts +2 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -1
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +13 -1
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +10 -2
- package/dist/bundlers/vite/index.d.ts +5 -2
- package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -5
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -1
- package/dist/bundlers/vite/serve-css-generation.d.ts +11 -0
- package/dist/bundlers/vite/source-candidates.d.ts +24 -2
- package/dist/bundlers/vite/source-scan.d.ts +26 -0
- package/dist/bundlers/vite/static-config-content.d.ts +5 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +5 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +5 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +8 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -8
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
- package/dist/cache/index.d.ts +6 -6
- package/dist/{chunk-8l464Juk.js → chunk-C5U5_Hdc.js} +14 -0
- package/dist/cli/context.d.ts +1 -11
- package/dist/cli/doctor/types.d.ts +11 -11
- package/dist/cli/vscode-entry.d.ts +3 -3
- package/dist/cli.js +684 -41
- package/dist/cli.mjs +682 -40
- package/dist/context/runtime-package-replacements.d.ts +2 -0
- package/dist/context/style-options.d.ts +3 -0
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/core.js +1 -2
- package/dist/core.mjs +1 -1
- package/dist/css-macro/auto.d.ts +11 -0
- package/dist/css-macro/constants.d.ts +5 -2
- package/dist/css-macro/postcss.d.ts +1 -0
- package/dist/css-macro/postcss.js +7 -46
- package/dist/css-macro/postcss.mjs +2 -46
- package/dist/css-macro.js +16 -7
- package/dist/css-macro.mjs +15 -6
- package/dist/defaults-8xrgzxFY.mjs +151 -0
- package/dist/defaults-zKUH2mDe.js +193 -0
- package/dist/defaults.js +6 -150
- package/dist/defaults.mjs +1 -143
- package/dist/escape.js +10 -2
- package/dist/escape.mjs +10 -2
- package/dist/generator/options.d.ts +11 -6
- package/dist/generator/types.d.ts +3 -3
- package/dist/generator--0-ekuVO.js +92 -0
- package/dist/generator-B76ovqsv.mjs +67 -0
- package/dist/generator.js +12 -12
- package/dist/generator.mjs +2 -1
- package/dist/gulp.js +163 -40
- package/dist/gulp.mjs +155 -32
- package/dist/incremental-runtime-class-set-CN6K_97P.js +2366 -0
- package/dist/incremental-runtime-class-set-x10M9bn_.mjs +2291 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +17 -5
- package/dist/index.mjs +6 -5
- package/dist/js/babel/cache-options.d.ts +3 -0
- package/dist/js/babel/parse.d.ts +7 -4
- package/dist/js/precheck.d.ts +2 -2
- package/dist/js/replacement-cache.d.ts +5 -0
- package/dist/postcss-C7BMYpEF.mjs +169 -0
- package/dist/{postcss-w48mGIhe.mjs → postcss-CR9UCaIK.mjs} +54 -114
- package/dist/postcss-CiYLsqZn.js +192 -0
- package/dist/{postcss-QIXwT40c.js → postcss-hYimKoN_.js} +60 -121
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/precheck-BrNwLG2e.mjs +4716 -0
- package/dist/precheck-DPtJjZmV.js +4842 -0
- package/dist/presets/index.d.ts +1 -0
- package/dist/presets/uni-app-x.d.ts +1 -0
- package/dist/presets.js +27 -13
- package/dist/presets.mjs +25 -13
- package/dist/reset.js +1 -1
- package/dist/runtime-registry-DpcR3IHI.js +5496 -0
- package/dist/shared/mpx.d.ts +1 -0
- package/dist/source-candidates-DN1mihlU.mjs +322 -0
- package/dist/source-candidates-DSxme_O2.js +335 -0
- package/dist/tailwindcss/miniprogram.d.ts +1 -5
- package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -2
- package/dist/tailwindcss/runtime/cache.d.ts +4 -3
- package/dist/tailwindcss/runtime.d.ts +9 -9
- package/dist/tailwindcss/source-scan.d.ts +35 -0
- package/dist/tailwindcss/v3-engine/types.d.ts +19 -14
- package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
- package/dist/tailwindcss/v4/patcher.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +18 -5
- package/dist/{tailwindcss-C5IgPlQ0.mjs → tailwindcss-DWtPieNE.mjs} +72 -60
- package/dist/{tailwindcss-Bu-RWIHx.js → tailwindcss-glCm_d3H.js} +81 -69
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +51 -41
- package/dist/types/shared.d.ts +3 -0
- package/dist/types/typedoc-tailwindcss-patch.d.ts +67 -0
- package/dist/types/user-defined-options/general.d.ts +25 -22
- package/dist/types/user-defined-options/important.d.ts +32 -27
- package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
- package/dist/types/user-defined-options/matcher.d.ts +6 -6
- package/dist/unocss/index.d.ts +2 -0
- package/dist/utils/object.d.ts +9 -0
- package/dist/utils/options.d.ts +2 -0
- package/dist/utils/regex.d.ts +1 -0
- package/dist/{utils-BiShvil9.js → utils-D7Ygohep.js} +2 -2
- package/dist/{utils-Btw1iOVV.mjs → utils-DsaS975I.mjs} +1 -1
- package/dist/v3-engine-D3BMLVAN.js +3712 -0
- package/dist/v3-engine-DCxNPBVs.mjs +3417 -0
- package/dist/vite-DOprpdH-.mjs +24493 -0
- package/dist/vite-Ec0uX6kF.js +24507 -0
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5444 -22
- package/dist/weapp-tw-runtime-classset-loader.js +32 -9
- package/dist/{webpack-BzN2ly34.js → webpack-Ccohlg3A.js} +341 -96
- package/dist/{webpack-DJazm5sT.mjs → webpack-DFlZcqAU.mjs} +323 -79
- package/dist/webpack.d.ts +1 -3
- package/dist/webpack.js +3 -4
- package/dist/webpack.mjs +2 -2
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -4
- package/package.json +22 -20
- package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +0 -3
- package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +0 -4
- package/dist/bundlers/shared/css-cleanup/selectors.d.ts +0 -8
- package/dist/cache-BVAiJV3J.js +0 -502
- package/dist/cache-CHs4DXui.mjs +0 -434
- package/dist/constants-BoB_6lFw.js +0 -73
- package/dist/constants-E_loJC49.mjs +0 -44
- package/dist/generator-DKkhJbOg.js +0 -1531
- package/dist/generator-UBmfduYg.mjs +0 -1432
- package/dist/generator-css-Bwp3nbrl.js +0 -1381
- package/dist/generator-css-DeLLmp2N.mjs +0 -1342
- package/dist/lightningcss/index.d.ts +0 -8
- package/dist/lightningcss/style-handler/options.d.ts +0 -3
- package/dist/lightningcss/style-handler/selector-transform.d.ts +0 -10
- package/dist/lightningcss/style-handler/selector-utils.d.ts +0 -10
- package/dist/lightningcss/style-handler.d.ts +0 -17
- package/dist/precheck-B32p-gLI.js +0 -2736
- package/dist/precheck-B4RH6ZNN.mjs +0 -2622
- package/dist/run-tasks-B50A3pxt.js +0 -128
- package/dist/run-tasks-DdNi-hkk.mjs +0 -91
- package/dist/runtime-patch-CwN5ya72.mjs +0 -71
- package/dist/runtime-patch-D6mBo_KB.js +0 -85
- package/dist/vite-By5KQi9s.js +0 -2419
- package/dist/vite-Cyp42bBf.mjs +0 -2406
- /package/dist/{logger-Bub1jggA.mjs → logger-BNzxZbZj.mjs} +0 -0
- /package/dist/{logger-BRy6XPQ2.js → logger-TlKT3xmR.js} +0 -0
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
2
|
-
const
|
|
3
|
-
const require_generator = require("./generator-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-D3BMLVAN.js");
|
|
3
|
+
const require_generator = require("./generator--0-ekuVO.js");
|
|
4
4
|
let postcss = require("postcss");
|
|
5
5
|
postcss = require_chunk.__toESM(postcss);
|
|
6
|
-
let
|
|
7
|
-
node_path = require_chunk.__toESM(node_path);
|
|
6
|
+
let tailwindcss_patch = require("tailwindcss-patch");
|
|
8
7
|
let node_process = require("node:process");
|
|
9
8
|
node_process = require_chunk.__toESM(node_process);
|
|
10
|
-
let
|
|
11
|
-
|
|
9
|
+
let node_path = require("node:path");
|
|
10
|
+
node_path = require_chunk.__toESM(node_path);
|
|
12
11
|
let node_fs_promises = require("node:fs/promises");
|
|
13
|
-
let
|
|
14
|
-
fast_glob = require_chunk.__toESM(fast_glob);
|
|
12
|
+
let tailwindcss_config = require("tailwindcss-config");
|
|
15
13
|
//#region src/postcss/config-directive.ts
|
|
16
14
|
function quoteCssString(value) {
|
|
17
15
|
return value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
@@ -66,152 +64,93 @@ function addSourceDependencyMessages(result, files) {
|
|
|
66
64
|
}
|
|
67
65
|
//#endregion
|
|
68
66
|
//#region src/postcss/source-files.ts
|
|
69
|
-
const POSTCSS_SOURCE_PATTERN =
|
|
70
|
-
"html",
|
|
71
|
-
"wxml",
|
|
72
|
-
"axml",
|
|
73
|
-
"jxml",
|
|
74
|
-
"ksml",
|
|
75
|
-
"ttml",
|
|
76
|
-
"qml",
|
|
77
|
-
"tyml",
|
|
78
|
-
"xhsml",
|
|
79
|
-
"swan",
|
|
80
|
-
"vue",
|
|
81
|
-
"mpx",
|
|
82
|
-
"js",
|
|
83
|
-
"jsx",
|
|
84
|
-
"ts",
|
|
85
|
-
"tsx"
|
|
86
|
-
].join(",")}}`;
|
|
87
|
-
function parseLocalSourceParam(params) {
|
|
88
|
-
const value = params.trim();
|
|
89
|
-
if (!value || value === "none" || value.startsWith("not ") || value.startsWith("inline(")) return;
|
|
90
|
-
return /^(['"])(.+)\1$/.exec(value)?.[2];
|
|
91
|
-
}
|
|
92
|
-
function parseConfigParam(params) {
|
|
93
|
-
const value = params.trim();
|
|
94
|
-
return /^(['"])(.+)\1$/.exec(value)?.[2];
|
|
95
|
-
}
|
|
96
|
-
function parseSourceFileParam(params) {
|
|
97
|
-
const value = params.trim();
|
|
98
|
-
if (!value || value === "none" || value.startsWith("inline(")) return;
|
|
99
|
-
const negated = value.startsWith("not ");
|
|
100
|
-
const sourceValue = negated ? value.slice(4).trim() : value;
|
|
101
|
-
const match = /^(['"])(.+)\1$/.exec(sourceValue);
|
|
102
|
-
return match?.[2] ? {
|
|
103
|
-
negated,
|
|
104
|
-
sourcePath: match[2]
|
|
105
|
-
} : void 0;
|
|
106
|
-
}
|
|
67
|
+
const POSTCSS_SOURCE_PATTERN = require_v3_engine.createSourceScanPattern(require_v3_engine.DEFAULT_SOURCE_SCAN_EXTENSIONS);
|
|
107
68
|
function getSourceExtension(file) {
|
|
108
69
|
return node_path.default.extname(file).slice(1) || void 0;
|
|
109
70
|
}
|
|
110
|
-
async function pathExistsAsDirectory(file) {
|
|
111
|
-
try {
|
|
112
|
-
return (await (0, node_fs_promises.stat)(file)).isDirectory();
|
|
113
|
-
} catch {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async function expandLocalSourceFiles(sourcePath, base) {
|
|
118
|
-
const absoluteSource = node_path.default.isAbsolute(sourcePath) ? sourcePath : node_path.default.resolve(base, sourcePath);
|
|
119
|
-
if (await pathExistsAsDirectory(absoluteSource)) return (0, fast_glob.default)(POSTCSS_SOURCE_PATTERN, {
|
|
120
|
-
absolute: true,
|
|
121
|
-
cwd: absoluteSource,
|
|
122
|
-
onlyFiles: true
|
|
123
|
-
});
|
|
124
|
-
return (0, fast_glob.default)(sourcePath, {
|
|
125
|
-
absolute: true,
|
|
126
|
-
cwd: base,
|
|
127
|
-
onlyFiles: true
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
async function resolveTailwindSourceEntry(sourcePath, base, negated) {
|
|
131
|
-
const absoluteSource = node_path.default.isAbsolute(sourcePath) ? node_path.default.resolve(sourcePath) : node_path.default.resolve(base, sourcePath);
|
|
132
|
-
if (await pathExistsAsDirectory(absoluteSource)) return {
|
|
133
|
-
base: absoluteSource,
|
|
134
|
-
negated,
|
|
135
|
-
pattern: POSTCSS_SOURCE_PATTERN
|
|
136
|
-
};
|
|
137
|
-
if (node_path.default.isAbsolute(sourcePath)) return {
|
|
138
|
-
base: node_path.default.dirname(absoluteSource),
|
|
139
|
-
negated,
|
|
140
|
-
pattern: node_path.default.basename(absoluteSource)
|
|
141
|
-
};
|
|
142
|
-
return {
|
|
143
|
-
base,
|
|
144
|
-
negated,
|
|
145
|
-
pattern: sourcePath
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
71
|
function collectConfigPaths(root, base) {
|
|
149
72
|
const configPaths = [];
|
|
150
73
|
root.walkAtRules("config", (rule) => {
|
|
151
|
-
const configPath = parseConfigParam(rule.params);
|
|
74
|
+
const configPath = require_v3_engine.parseConfigParam(rule.params);
|
|
152
75
|
if (configPath) configPaths.push(node_path.default.isAbsolute(configPath) ? configPath : node_path.default.resolve(base, configPath));
|
|
153
76
|
});
|
|
154
77
|
return [...new Set(configPaths)];
|
|
155
78
|
}
|
|
156
|
-
function
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
if (typeof content === "object" && content !== null && "files" in content) return normalizeContentFiles(content.files);
|
|
160
|
-
return [];
|
|
79
|
+
function resolveOptionConfigPath(config, base) {
|
|
80
|
+
if (!config) return;
|
|
81
|
+
return node_path.default.isAbsolute(config) ? config : node_path.default.resolve(base, config);
|
|
161
82
|
}
|
|
162
|
-
async function collectConfigContentFiles(root, base) {
|
|
163
|
-
const configPaths = collectConfigPaths(root, base);
|
|
83
|
+
async function collectConfigContentFiles(root, base, options) {
|
|
84
|
+
const configPaths = [...new Set([...resolveOptionConfigPath(options.config, base) ? [resolveOptionConfigPath(options.config, base)] : [], ...collectConfigPaths(root, base)])];
|
|
164
85
|
const files = [];
|
|
165
86
|
for (const configPath of configPaths) {
|
|
166
|
-
const
|
|
87
|
+
const contentEntries = require_v3_engine.normalizeLegacyContentEntries((await (0, tailwindcss_config.loadConfig)({
|
|
167
88
|
config: configPath,
|
|
168
89
|
cwd: node_path.default.dirname(configPath)
|
|
169
|
-
}))?.config.content);
|
|
170
|
-
|
|
90
|
+
}))?.config.content, node_path.default.dirname(configPath));
|
|
91
|
+
files.push(...await require_v3_engine.expandTailwindSourceEntries(contentEntries));
|
|
171
92
|
}
|
|
172
93
|
return {
|
|
173
94
|
configPaths,
|
|
174
95
|
files: [...new Set(files)]
|
|
175
96
|
};
|
|
176
97
|
}
|
|
98
|
+
async function collectConfiguredContentEntries(root, base, options) {
|
|
99
|
+
const configPath = resolveOptionConfigPath(options.generator?.config ?? options.config, base) ?? collectConfigPaths(root, base)[0];
|
|
100
|
+
if (!configPath) return [];
|
|
101
|
+
const resolvedConfigPath = node_path.default.isAbsolute(configPath) ? configPath : node_path.default.resolve(base, configPath);
|
|
102
|
+
return require_v3_engine.normalizeLegacyContentEntries((await (0, tailwindcss_config.loadConfig)({
|
|
103
|
+
config: resolvedConfigPath,
|
|
104
|
+
cwd: node_path.default.dirname(resolvedConfigPath)
|
|
105
|
+
}))?.config.content, node_path.default.dirname(resolvedConfigPath));
|
|
106
|
+
}
|
|
107
|
+
async function collectRawCandidatesFromSourceEntries(sourceEntries) {
|
|
108
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
109
|
+
const files = await require_v3_engine.expandTailwindSourceEntries(sourceEntries);
|
|
110
|
+
await Promise.all(files.map(async (file) => {
|
|
111
|
+
const matches = await (0, tailwindcss_patch.extractRawCandidatesWithPositions)(await (0, node_fs_promises.readFile)(file, "utf8"), getSourceExtension(file));
|
|
112
|
+
for (const match of matches) {
|
|
113
|
+
const candidate = match?.rawCandidate;
|
|
114
|
+
if (typeof candidate === "string" && candidate.length > 0) candidates.add(candidate);
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
return candidates;
|
|
118
|
+
}
|
|
177
119
|
async function collectAutoTailwindCandidates(root, result, options) {
|
|
178
120
|
if (options.scanSources === false) return /* @__PURE__ */ new Set();
|
|
179
121
|
const base = resolvePostcssBase(result, options);
|
|
180
122
|
const projectRoot = resolvePostcssProjectRoot(result, options);
|
|
181
|
-
const
|
|
182
|
-
|
|
123
|
+
const sourceEntries = [];
|
|
124
|
+
const hasSourceNone = root.toString().includes("source(none)");
|
|
125
|
+
const inlineCandidates = require_v3_engine.collectCssInlineSourceCandidates(root);
|
|
126
|
+
const configuredContentEntries = options.version === 3 ? await collectConfiguredContentEntries(root, base, options) : [];
|
|
127
|
+
if (configuredContentEntries.length > 0) sourceEntries.push(...configuredContentEntries);
|
|
128
|
+
else if (!hasSourceNone) sourceEntries.push({
|
|
183
129
|
base,
|
|
184
130
|
negated: false,
|
|
185
131
|
pattern: POSTCSS_SOURCE_PATTERN
|
|
186
|
-
}));
|
|
187
|
-
root.walkAtRules("source", (rule) => {
|
|
188
|
-
const parsed = parseSourceFileParam(rule.params);
|
|
189
|
-
if (!parsed) return;
|
|
190
|
-
sourceEntryTasks.push(resolveTailwindSourceEntry(parsed.sourcePath, base, parsed.negated));
|
|
191
132
|
});
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const candidates = await (0, tailwindcss_patch.extractValidCandidates)({
|
|
133
|
+
sourceEntries.push(...await require_v3_engine.resolveCssSourceEntries(root, base, POSTCSS_SOURCE_PATTERN));
|
|
134
|
+
const candidates = sourceEntries.length === 0 ? [] : options.version === 3 ? await collectRawCandidatesFromSourceEntries(sourceEntries) : await (0, tailwindcss_patch.extractValidCandidates)({
|
|
195
135
|
base,
|
|
196
136
|
css: root.toString(),
|
|
197
137
|
cwd: projectRoot,
|
|
198
138
|
sources: sourceEntries
|
|
199
139
|
});
|
|
200
|
-
return new Set(candidates);
|
|
140
|
+
return new Set([...[...candidates].filter((candidate) => !inlineCandidates.excluded.has(candidate)), ...inlineCandidates.included]);
|
|
201
141
|
}
|
|
202
142
|
async function collectPostcssLocalSources(root, result, options) {
|
|
203
143
|
const base = resolvePostcssBase(result, options);
|
|
204
|
-
const
|
|
205
|
-
root
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
})));
|
|
144
|
+
const sourceEntries = await require_v3_engine.resolveCssSourceEntries(root, base, POSTCSS_SOURCE_PATTERN);
|
|
145
|
+
const configContentFiles = await collectConfigContentFiles(root, base, options);
|
|
146
|
+
const files = [...new Set([...await require_v3_engine.expandTailwindSourceEntries(sourceEntries), ...configContentFiles.files])];
|
|
147
|
+
const sources = await Promise.all(files.map(async (file) => {
|
|
148
|
+
const extension = getSourceExtension(file);
|
|
149
|
+
return {
|
|
150
|
+
content: await (0, node_fs_promises.readFile)(file, "utf8"),
|
|
151
|
+
...extension === void 0 ? {} : { extension }
|
|
152
|
+
};
|
|
153
|
+
}));
|
|
215
154
|
return {
|
|
216
155
|
files: [...files, ...configContentFiles.configPaths],
|
|
217
156
|
sources
|
|
@@ -229,7 +168,7 @@ function hasTailwindV4CssSyntax(root) {
|
|
|
229
168
|
}
|
|
230
169
|
function resolvePostcssTailwindVersion(root, result, options) {
|
|
231
170
|
const packageName = options.packageName ?? "tailwindcss";
|
|
232
|
-
const installedVersion =
|
|
171
|
+
const installedVersion = require_v3_engine.readInstalledPackageMajorVersion(packageName, resolvePostcssProjectRoot(result, options));
|
|
233
172
|
if (installedVersion) return installedVersion;
|
|
234
173
|
if (options.version) return options.version;
|
|
235
174
|
if (packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4")) return 4;
|
|
@@ -249,7 +188,7 @@ const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
|
249
188
|
const tailwindVersion = resolvePostcssTailwindVersion(root, result, options);
|
|
250
189
|
const [collectedSources, autoCandidates] = await Promise.all([collectPostcssLocalSources(root, result, options), collectAutoTailwindCandidates(root, result, options)]);
|
|
251
190
|
const generatorConfig = generatorOptions.config ?? options.config;
|
|
252
|
-
const generator = require_generator.createWeappTailwindcssGenerator(tailwindVersion === 3 ? await
|
|
191
|
+
const generator = require_generator.createWeappTailwindcssGenerator(tailwindVersion === 3 ? await require_v3_engine.resolveTailwindV3Source({
|
|
253
192
|
config: generatorConfig,
|
|
254
193
|
css: sourceOptions.css ?? root.toString(),
|
|
255
194
|
base: resolvePostcssBase(result, options),
|
|
@@ -257,7 +196,7 @@ const weappTailwindcssPostcssPlugin = (options = {}) => {
|
|
|
257
196
|
projectRoot: resolvePostcssProjectRoot(result, options),
|
|
258
197
|
packageName: options.packageName,
|
|
259
198
|
postcssPlugin: options.postcssPlugin
|
|
260
|
-
}) : await
|
|
199
|
+
}) : await require_v3_engine.resolveTailwindV4Source({
|
|
261
200
|
...sourceOptions,
|
|
262
201
|
css: prependConfigDirective(sourceOptions.css ?? root.toString(), generatorConfig),
|
|
263
202
|
base: resolvePostcssBase(result, options),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_chunk = require("./chunk-
|
|
1
|
+
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
2
|
let _weapp_tailwindcss_postcss_html_transform = require("@weapp-tailwindcss/postcss/html-transform");
|
|
3
3
|
_weapp_tailwindcss_postcss_html_transform = require_chunk.__toESM(_weapp_tailwindcss_postcss_html_transform);
|
|
4
4
|
//#region src/postcss-html-transform.ts
|
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-hYimKoN_.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-CR9UCaIK.mjs";
|
|
2
2
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|