weapp-tailwindcss 5.1.15 → 5.1.16
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/gulp/shared/create-native-framework-plugins/cache-state.d.ts +71 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +43 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +2 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +14 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +18 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +25 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +4 -72
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +3 -1
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +14 -0
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +25 -0
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +33 -0
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +16 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +3 -6
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +10 -0
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -33
- package/dist/bundlers/shared/generator-css.d.ts +1 -2
- package/dist/bundlers/shared/v4-generation-core.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer/options.d.ts +54 -0
- package/dist/bundlers/vite/css-finalizer/plugin.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -43
- package/dist/bundlers/vite/generate-bundle/finalize/bundle.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +69 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -70
- package/dist/bundlers/vite/generate-bundle-runtime.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +12 -0
- package/dist/bundlers/vite/processed-css-assets/collector.d.ts +4 -0
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +34 -0
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +42 -0
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +89 -0
- package/dist/bundlers/vite/processed-css-assets/style-files.d.ts +3 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +4 -71
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +1 -0
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +2 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +4 -4
- package/dist/bundlers/vite/source-candidates/collector.d.ts +8 -0
- package/dist/bundlers/vite/source-candidates/store.d.ts +2 -0
- package/dist/bundlers/vite/source-candidates/types-and-cache.d.ts +69 -0
- package/dist/bundlers/vite/source-candidates.d.ts +4 -68
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/finalize-assets.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-result.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-task.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/html-js-tasks.d.ts +5 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +8 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/memory-trace.d.ts +78 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +43 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/resources.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/runtime-candidates.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +21 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +9 -219
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +4 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +5 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +20 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin/watch-output.d.ts +13 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +3 -21
- package/dist/cli.js +14 -18
- package/dist/cli.mjs +14 -18
- package/dist/{context-VeFq_8vW.js → context-BtLIID4m.js} +3 -3
- package/dist/{context-BgGWVAmN.mjs → context-JzwzSX36.mjs} +3 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-CEnUsjed.js → generator-B91GhUJQ.js} +636 -505
- package/dist/{generator-CEo920So.mjs → generator-Bv7myuhY.mjs} +556 -431
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-DP71z1jG.mjs → gulp-CKSklPlH.mjs} +217 -186
- package/dist/{gulp-3m1dAiig.js → gulp-Q1wITegn.js} +217 -186
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-1aS6--U7.mjs → hmr-timing-BXg7nI8N.mjs} +3411 -3276
- package/dist/{hmr-timing-B8p4f0ca.js → hmr-timing-CMPaWn9P.js} +3425 -3278
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/shared/mpx-plugin-owner.d.ts +2 -0
- package/dist/{source-candidate-scan-signature-BAahhiwb.js → source-candidate-scan-signature-BKZZk_e6.js} +144 -4
- package/dist/{source-candidate-scan-signature-Cf7259PR.mjs → source-candidate-scan-signature-CtK-mB_C.mjs} +127 -4
- package/dist/tailwindcss/v4-engine/generator/cache-stats.d.ts +26 -0
- package/dist/tailwindcss/v4-engine/generator/engine.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +52 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -28
- package/dist/{tailwindcss-KBYPJ2DW.js → tailwindcss-B4phC0kB.js} +2 -2
- package/dist/{tailwindcss-xs704TRw.mjs → tailwindcss-BTcXX8Ka.mjs} +2 -2
- package/dist/{vite-nXZEiwG0.mjs → vite-BwQWl9ft.mjs} +806 -692
- package/dist/{vite-DUVjMduj.js → vite-DhVnXvAQ.js} +805 -691
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-generation-loader.js +1 -1
- package/dist/{weapp-tw-css-import-rewrite-loader-DNk0IxAt.js → weapp-tw-css-import-rewrite-loader-B0tVkJLH.js} +2410 -2084
- package/dist/weapp-tw-css-import-rewrite-loader.js +1 -1
- package/dist/weapp-tw-runtime-classset-loader.js +10 -4
- package/dist/{webpack-C_UUFRgj.mjs → webpack-Bo1QrFPf.mjs} +1387 -1114
- package/dist/{webpack-nppysF4B.js → webpack-kh78iMSS.js} +1386 -1113
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +9 -7
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
3
|
+
const require_generator = require("./generator-B91GhUJQ.js");
|
|
4
|
+
const require_gulp = require("./gulp-Q1wITegn.js");
|
|
5
5
|
const require_postcss = require("./postcss.js");
|
|
6
|
-
const require_vite = require("./vite-
|
|
7
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-DhVnXvAQ.js");
|
|
7
|
+
const require_webpack = require("./webpack-kh78iMSS.js");
|
|
8
8
|
require("./webpack.js");
|
|
9
9
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
10
10
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/index.mjs
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.mjs";
|
|
2
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import { t as createPlugins } from "./gulp-
|
|
2
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-Bv7myuhY.mjs";
|
|
3
|
+
import { t as createPlugins } from "./gulp-CKSklPlH.mjs";
|
|
4
4
|
import weappTailwindcssPostcssPlugin from "./postcss.mjs";
|
|
5
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
6
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-BwQWl9ft.mjs";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-Bo1QrFPf.mjs";
|
|
7
7
|
import "./webpack.mjs";
|
|
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 };
|
package/dist/postcss.js
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-B91GhUJQ.js");
|
|
6
6
|
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
7
7
|
createGenerator: (source) => {
|
|
8
8
|
return require_generator.createWeappTailwindcssGenerator(source);
|
package/dist/postcss.mjs
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-Bv7myuhY.mjs";
|
|
2
2
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
3
3
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
4
4
|
createGenerator: (source) => {
|
package/dist/presets.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
3
3
|
const require_framework = require("./framework.js");
|
|
4
4
|
const require_object = require("./object-COs_Mw6p.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-B4phC0kB.js");
|
|
6
6
|
require("./utils-CuKLf1Zv.js");
|
|
7
7
|
require("./logger-TlKT3xmR.js");
|
|
8
8
|
let node_path = require("node:path");
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveTaroPlatform, resolveUniPlatformsFromEnv } from "./framework.mjs";
|
|
2
2
|
import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-BTcXX8Ka.mjs";
|
|
4
4
|
import { n as defuOverrideArray } from "./utils-MVwpU07P.mjs";
|
|
5
5
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
6
6
|
import path from "node:path";
|
package/dist/rspack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
3
|
-
const require_webpack = require("./webpack-
|
|
3
|
+
const require_webpack = require("./webpack-kh78iMSS.js");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
6
6
|
//#region src/bundlers/rspack/index.ts
|
package/dist/rspack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-Bo1QrFPf.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region src/bundlers/rspack/index.ts
|
|
4
4
|
const CSS_IMPORT_REWRITE_LOADER_NAME = "weapp-tw-css-import-rewrite-loader";
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
+
const require_generator = require("./generator-B91GhUJQ.js");
|
|
3
4
|
require("./auto-DtU6f3X6.js");
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-B4phC0kB.js");
|
|
5
6
|
const require_wxml = require("./wxml-Ce10eREX.js");
|
|
6
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
7
|
+
const require_hmr_timing = require("./hmr-timing-CMPaWn9P.js");
|
|
7
8
|
let node_path = require("node:path");
|
|
8
9
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
9
10
|
let node_process = require("node:process");
|
|
10
11
|
node_process = require_rolldown_runtime.__toESM(node_process);
|
|
12
|
+
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
11
13
|
let node_module = require("node:module");
|
|
12
14
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
13
15
|
let node_buffer = require("node:buffer");
|
|
@@ -18,7 +20,6 @@ let weapp_style_injector_webpack = require("weapp-style-injector/webpack");
|
|
|
18
20
|
let weapp_style_injector_webpack_mpx = require("weapp-style-injector/webpack/mpx");
|
|
19
21
|
let weapp_style_injector_webpack_taro = require("weapp-style-injector/webpack/taro");
|
|
20
22
|
let weapp_style_injector_webpack_uni_app = require("weapp-style-injector/webpack/uni-app");
|
|
21
|
-
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
22
23
|
//#region src/bundlers/framework-selector.ts
|
|
23
24
|
function resolveBundlerAppType(options) {
|
|
24
25
|
if (options.appType) return options.appType;
|
|
@@ -229,6 +230,109 @@ function resolvePackageDir(name) {
|
|
|
229
230
|
return node_path.default.dirname(pkgPath);
|
|
230
231
|
}
|
|
231
232
|
//#endregion
|
|
233
|
+
//#region src/bundlers/shared/framework-postcss.ts
|
|
234
|
+
const FRAMEWORK_POSTCSS_REGISTRY = Symbol.for("weapp-tailwindcss.framework-postcss-options");
|
|
235
|
+
const registryHost = globalThis;
|
|
236
|
+
const frameworkPostcssOptions = registryHost[FRAMEWORK_POSTCSS_REGISTRY] ?? (registryHost[FRAMEWORK_POSTCSS_REGISTRY] = /* @__PURE__ */ new WeakMap());
|
|
237
|
+
function isObject(value) {
|
|
238
|
+
return typeof value === "object" && value !== null;
|
|
239
|
+
}
|
|
240
|
+
function normalizePlugins(plugins) {
|
|
241
|
+
const entries = Array.isArray(plugins) ? plugins : isObject(plugins) ? Object.values(plugins) : [];
|
|
242
|
+
const resolved = [...new Set(entries.filter(Boolean))];
|
|
243
|
+
(0, _weapp_tailwindcss_postcss.removeTailwindPostcssPlugins)(resolved);
|
|
244
|
+
return resolved;
|
|
245
|
+
}
|
|
246
|
+
function resolveFrameworkPostcssOptions(value) {
|
|
247
|
+
if (!isObject(value)) return;
|
|
248
|
+
const plugins = normalizePlugins(value["plugins"]);
|
|
249
|
+
const options = Object.fromEntries(Object.entries(value).filter(([key]) => key !== "plugins" && key !== "config"));
|
|
250
|
+
if (plugins.length === 0 && Object.keys(options).length === 0) return;
|
|
251
|
+
return {
|
|
252
|
+
plugins,
|
|
253
|
+
options
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function mergeFrameworkPostcssOptions(left, right) {
|
|
257
|
+
if (!left) return right;
|
|
258
|
+
if (!right) return left;
|
|
259
|
+
return {
|
|
260
|
+
plugins: [.../* @__PURE__ */ new Set([...normalizePlugins(left.plugins), ...normalizePlugins(right.plugins)])],
|
|
261
|
+
options: {
|
|
262
|
+
...left.options ?? {},
|
|
263
|
+
...right.options ?? {}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function collectFrameworkPostcssOptionsFromLoaderEntries(entries, loaderContext) {
|
|
268
|
+
let resolved;
|
|
269
|
+
const visit = (value) => {
|
|
270
|
+
if (Array.isArray(value)) {
|
|
271
|
+
value.forEach(visit);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
if (!isObject(value)) return;
|
|
275
|
+
const loader = value["loader"];
|
|
276
|
+
if (typeof loader === "string" && loader.includes("postcss-loader")) {
|
|
277
|
+
const loaderOptions = value["options"];
|
|
278
|
+
const rawOptions = isObject(loaderOptions) ? loaderOptions["postcssOptions"] : void 0;
|
|
279
|
+
const options = typeof rawOptions === "function" ? rawOptions(loaderContext) : rawOptions;
|
|
280
|
+
resolved = mergeFrameworkPostcssOptions(resolved, resolveFrameworkPostcssOptions(options));
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
visit(value["rules"]);
|
|
284
|
+
visit(value["oneOf"]);
|
|
285
|
+
visit(value["use"]);
|
|
286
|
+
};
|
|
287
|
+
entries.forEach(visit);
|
|
288
|
+
return resolved;
|
|
289
|
+
}
|
|
290
|
+
function captureFrameworkPostcssOptions(owner, options) {
|
|
291
|
+
const resolved = resolveFrameworkPostcssOptions(options);
|
|
292
|
+
if (!resolved) {
|
|
293
|
+
frameworkPostcssOptions.delete(owner);
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
frameworkPostcssOptions.set(owner, resolved);
|
|
297
|
+
return resolved;
|
|
298
|
+
}
|
|
299
|
+
function captureResolvedFrameworkPostcssOptions(owner, options) {
|
|
300
|
+
if (!options) {
|
|
301
|
+
frameworkPostcssOptions.delete(owner);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
frameworkPostcssOptions.set(owner, options);
|
|
305
|
+
return options;
|
|
306
|
+
}
|
|
307
|
+
function hasFrameworkPostcssOptions(owner) {
|
|
308
|
+
return frameworkPostcssOptions.has(owner);
|
|
309
|
+
}
|
|
310
|
+
function createGeneratedCssHandlerOptions(owner, options, from) {
|
|
311
|
+
const frameworkOptions = frameworkPostcssOptions.get(owner);
|
|
312
|
+
const merged = mergeFrameworkPostcssOptions(options.postcssOptions, frameworkOptions);
|
|
313
|
+
return {
|
|
314
|
+
...options,
|
|
315
|
+
postcssOptions: {
|
|
316
|
+
...merged ?? {},
|
|
317
|
+
options: {
|
|
318
|
+
...merged?.options ?? {},
|
|
319
|
+
from
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
async function adaptGeneratedCssWithFrameworkPipeline(owner, generated, options) {
|
|
325
|
+
const handled = await options.styleHandler(generated.css, createGeneratedCssHandlerOptions(owner, options.cssHandlerOptions, options.file));
|
|
326
|
+
const preflightMode = generated.metadata?.preflightMode;
|
|
327
|
+
const injectPreflight = preflightMode?.inject ?? options.cssHandlerOptions.isMainChunk;
|
|
328
|
+
const preservePreflight = preflightMode?.preserve ?? options.cssHandlerOptions.isMainChunk;
|
|
329
|
+
return require_hmr_timing.finalizeMiniProgramGeneratorCss(handled.css, generated.target, options.majorVersion, owner.cssPreflight, {
|
|
330
|
+
...injectPreflight === void 0 ? {} : { injectPreflight },
|
|
331
|
+
...preservePreflight === void 0 ? {} : { preservePreflight },
|
|
332
|
+
styleOptions: options.cssHandlerOptions
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
232
336
|
//#region src/bundlers/shared/module-graph.ts
|
|
233
337
|
const QUERY_HASH_RE = /[?#].*$/u;
|
|
234
338
|
const PROTOCOL_RE = /^[a-z][a-z+.-]*:/iu;
|
|
@@ -277,10 +381,28 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
277
381
|
async function generateTailwindV4Css(options) {
|
|
278
382
|
const majorVersion = options.runtimeState.tailwindRuntime.majorVersion;
|
|
279
383
|
if (majorVersion !== 4) throw new Error("weapp-tailwindcss 生成管线仅支持 Tailwind CSS v4。");
|
|
280
|
-
const
|
|
384
|
+
const frameworkPostcssOwner = options.frameworkPostcssOwner ?? options.opts;
|
|
385
|
+
const shouldReplayFrameworkPostcss = options.frameworkPostcssStage === "complete" && hasFrameworkPostcssOptions(frameworkPostcssOwner) && require_generator.normalizeWeappTailwindcssGeneratorOptions(options.opts.generator, {
|
|
386
|
+
appType: options.opts.appType,
|
|
387
|
+
platform: options.generatorPlatform ?? options.opts.cssOptions?.platform ?? options.opts.platform,
|
|
388
|
+
tailwindcssMajorVersion: majorVersion,
|
|
389
|
+
uniAppX: options.opts.uniAppX
|
|
390
|
+
}).target === "weapp";
|
|
391
|
+
const generated = await require_hmr_timing.generateCssByGenerator(shouldReplayFrameworkPostcss ? {
|
|
392
|
+
...options,
|
|
393
|
+
deferCssAdaptation: true
|
|
394
|
+
} : options);
|
|
281
395
|
if (!generated) return;
|
|
396
|
+
const adaptedCss = shouldReplayFrameworkPostcss ? await adaptGeneratedCssWithFrameworkPipeline(frameworkPostcssOwner, generated, {
|
|
397
|
+
cssHandlerOptions: options.cssHandlerOptions,
|
|
398
|
+
file: options.file,
|
|
399
|
+
majorVersion,
|
|
400
|
+
styleHandler: options.styleHandler
|
|
401
|
+
}) : generated.css;
|
|
402
|
+
const css = require_hmr_timing.isVueScopedStyleRequest(require_hmr_timing.resolvePostcssRequestOption(options.cssHandlerOptions)) ? require_generator.preferScopedGeneratedCssRules(adaptedCss) : adaptedCss;
|
|
282
403
|
return {
|
|
283
404
|
...generated,
|
|
405
|
+
css,
|
|
284
406
|
classSet: generated.classSet,
|
|
285
407
|
dependencies: generated.dependencies,
|
|
286
408
|
metadata: {
|
|
@@ -744,12 +866,30 @@ Object.defineProperty(exports, "buildBundleSnapshot", {
|
|
|
744
866
|
return buildBundleSnapshot;
|
|
745
867
|
}
|
|
746
868
|
});
|
|
869
|
+
Object.defineProperty(exports, "captureFrameworkPostcssOptions", {
|
|
870
|
+
enumerable: true,
|
|
871
|
+
get: function() {
|
|
872
|
+
return captureFrameworkPostcssOptions;
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
Object.defineProperty(exports, "captureResolvedFrameworkPostcssOptions", {
|
|
876
|
+
enumerable: true,
|
|
877
|
+
get: function() {
|
|
878
|
+
return captureResolvedFrameworkPostcssOptions;
|
|
879
|
+
}
|
|
880
|
+
});
|
|
747
881
|
Object.defineProperty(exports, "classifyBundleEntry", {
|
|
748
882
|
enumerable: true,
|
|
749
883
|
get: function() {
|
|
750
884
|
return classifyBundleEntry;
|
|
751
885
|
}
|
|
752
886
|
});
|
|
887
|
+
Object.defineProperty(exports, "collectFrameworkPostcssOptionsFromLoaderEntries", {
|
|
888
|
+
enumerable: true,
|
|
889
|
+
get: function() {
|
|
890
|
+
return collectFrameworkPostcssOptionsFromLoaderEntries;
|
|
891
|
+
}
|
|
892
|
+
});
|
|
753
893
|
Object.defineProperty(exports, "createBuiltinViteStyleInjectorPlugins", {
|
|
754
894
|
enumerable: true,
|
|
755
895
|
get: function() {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { detectAppType } from "./framework.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, q as preferScopedGeneratedCssRules } from "./generator-Bv7myuhY.mjs";
|
|
2
3
|
import { n as hasCssMacroTailwindV4CustomVariantConditionalComments } from "./auto-2dg_uhEJ.mjs";
|
|
3
|
-
import { g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions } from "./tailwindcss-
|
|
4
|
+
import { g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions } from "./tailwindcss-BTcXX8Ka.mjs";
|
|
4
5
|
import { _ as babelParse, n as Parser, v as traverse } from "./wxml-DdGdeqaH.mjs";
|
|
5
|
-
import {
|
|
6
|
+
import { _ as isVueScopedStyleRequest, b as resolvePostcssRequestOption, g as isSourceStyleRequest, i as generateCssByGenerator, m as finalizeMiniProgramGeneratorCss } from "./hmr-timing-BXg7nI8N.mjs";
|
|
6
7
|
import { createRequire } from "node:module";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import process from "node:process";
|
|
10
|
+
import { removeTailwindPostcssPlugins } from "@weapp-tailwindcss/postcss";
|
|
9
11
|
import { cleanUrl, ensurePosix } from "@weapp-tailwindcss/shared";
|
|
10
12
|
import { Buffer } from "node:buffer";
|
|
11
13
|
import { weappStyleInjector } from "weapp-style-injector/vite";
|
|
@@ -225,6 +227,109 @@ function resolvePackageDir(name) {
|
|
|
225
227
|
return path.dirname(pkgPath);
|
|
226
228
|
}
|
|
227
229
|
//#endregion
|
|
230
|
+
//#region src/bundlers/shared/framework-postcss.ts
|
|
231
|
+
const FRAMEWORK_POSTCSS_REGISTRY = Symbol.for("weapp-tailwindcss.framework-postcss-options");
|
|
232
|
+
const registryHost = globalThis;
|
|
233
|
+
const frameworkPostcssOptions = registryHost[FRAMEWORK_POSTCSS_REGISTRY] ?? (registryHost[FRAMEWORK_POSTCSS_REGISTRY] = /* @__PURE__ */ new WeakMap());
|
|
234
|
+
function isObject(value) {
|
|
235
|
+
return typeof value === "object" && value !== null;
|
|
236
|
+
}
|
|
237
|
+
function normalizePlugins(plugins) {
|
|
238
|
+
const entries = Array.isArray(plugins) ? plugins : isObject(plugins) ? Object.values(plugins) : [];
|
|
239
|
+
const resolved = [...new Set(entries.filter(Boolean))];
|
|
240
|
+
removeTailwindPostcssPlugins(resolved);
|
|
241
|
+
return resolved;
|
|
242
|
+
}
|
|
243
|
+
function resolveFrameworkPostcssOptions(value) {
|
|
244
|
+
if (!isObject(value)) return;
|
|
245
|
+
const plugins = normalizePlugins(value["plugins"]);
|
|
246
|
+
const options = Object.fromEntries(Object.entries(value).filter(([key]) => key !== "plugins" && key !== "config"));
|
|
247
|
+
if (plugins.length === 0 && Object.keys(options).length === 0) return;
|
|
248
|
+
return {
|
|
249
|
+
plugins,
|
|
250
|
+
options
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function mergeFrameworkPostcssOptions(left, right) {
|
|
254
|
+
if (!left) return right;
|
|
255
|
+
if (!right) return left;
|
|
256
|
+
return {
|
|
257
|
+
plugins: [.../* @__PURE__ */ new Set([...normalizePlugins(left.plugins), ...normalizePlugins(right.plugins)])],
|
|
258
|
+
options: {
|
|
259
|
+
...left.options ?? {},
|
|
260
|
+
...right.options ?? {}
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function collectFrameworkPostcssOptionsFromLoaderEntries(entries, loaderContext) {
|
|
265
|
+
let resolved;
|
|
266
|
+
const visit = (value) => {
|
|
267
|
+
if (Array.isArray(value)) {
|
|
268
|
+
value.forEach(visit);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (!isObject(value)) return;
|
|
272
|
+
const loader = value["loader"];
|
|
273
|
+
if (typeof loader === "string" && loader.includes("postcss-loader")) {
|
|
274
|
+
const loaderOptions = value["options"];
|
|
275
|
+
const rawOptions = isObject(loaderOptions) ? loaderOptions["postcssOptions"] : void 0;
|
|
276
|
+
const options = typeof rawOptions === "function" ? rawOptions(loaderContext) : rawOptions;
|
|
277
|
+
resolved = mergeFrameworkPostcssOptions(resolved, resolveFrameworkPostcssOptions(options));
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
visit(value["rules"]);
|
|
281
|
+
visit(value["oneOf"]);
|
|
282
|
+
visit(value["use"]);
|
|
283
|
+
};
|
|
284
|
+
entries.forEach(visit);
|
|
285
|
+
return resolved;
|
|
286
|
+
}
|
|
287
|
+
function captureFrameworkPostcssOptions(owner, options) {
|
|
288
|
+
const resolved = resolveFrameworkPostcssOptions(options);
|
|
289
|
+
if (!resolved) {
|
|
290
|
+
frameworkPostcssOptions.delete(owner);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
frameworkPostcssOptions.set(owner, resolved);
|
|
294
|
+
return resolved;
|
|
295
|
+
}
|
|
296
|
+
function captureResolvedFrameworkPostcssOptions(owner, options) {
|
|
297
|
+
if (!options) {
|
|
298
|
+
frameworkPostcssOptions.delete(owner);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
frameworkPostcssOptions.set(owner, options);
|
|
302
|
+
return options;
|
|
303
|
+
}
|
|
304
|
+
function hasFrameworkPostcssOptions(owner) {
|
|
305
|
+
return frameworkPostcssOptions.has(owner);
|
|
306
|
+
}
|
|
307
|
+
function createGeneratedCssHandlerOptions(owner, options, from) {
|
|
308
|
+
const frameworkOptions = frameworkPostcssOptions.get(owner);
|
|
309
|
+
const merged = mergeFrameworkPostcssOptions(options.postcssOptions, frameworkOptions);
|
|
310
|
+
return {
|
|
311
|
+
...options,
|
|
312
|
+
postcssOptions: {
|
|
313
|
+
...merged ?? {},
|
|
314
|
+
options: {
|
|
315
|
+
...merged?.options ?? {},
|
|
316
|
+
from
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
async function adaptGeneratedCssWithFrameworkPipeline(owner, generated, options) {
|
|
322
|
+
const handled = await options.styleHandler(generated.css, createGeneratedCssHandlerOptions(owner, options.cssHandlerOptions, options.file));
|
|
323
|
+
const preflightMode = generated.metadata?.preflightMode;
|
|
324
|
+
const injectPreflight = preflightMode?.inject ?? options.cssHandlerOptions.isMainChunk;
|
|
325
|
+
const preservePreflight = preflightMode?.preserve ?? options.cssHandlerOptions.isMainChunk;
|
|
326
|
+
return finalizeMiniProgramGeneratorCss(handled.css, generated.target, options.majorVersion, owner.cssPreflight, {
|
|
327
|
+
...injectPreflight === void 0 ? {} : { injectPreflight },
|
|
328
|
+
...preservePreflight === void 0 ? {} : { preservePreflight },
|
|
329
|
+
styleOptions: options.cssHandlerOptions
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
228
333
|
//#region src/bundlers/shared/module-graph.ts
|
|
229
334
|
const QUERY_HASH_RE = /[?#].*$/u;
|
|
230
335
|
const PROTOCOL_RE = /^[a-z][a-z+.-]*:/iu;
|
|
@@ -273,10 +378,28 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
273
378
|
async function generateTailwindV4Css(options) {
|
|
274
379
|
const majorVersion = options.runtimeState.tailwindRuntime.majorVersion;
|
|
275
380
|
if (majorVersion !== 4) throw new Error("weapp-tailwindcss 生成管线仅支持 Tailwind CSS v4。");
|
|
276
|
-
const
|
|
381
|
+
const frameworkPostcssOwner = options.frameworkPostcssOwner ?? options.opts;
|
|
382
|
+
const shouldReplayFrameworkPostcss = options.frameworkPostcssStage === "complete" && hasFrameworkPostcssOptions(frameworkPostcssOwner) && normalizeWeappTailwindcssGeneratorOptions(options.opts.generator, {
|
|
383
|
+
appType: options.opts.appType,
|
|
384
|
+
platform: options.generatorPlatform ?? options.opts.cssOptions?.platform ?? options.opts.platform,
|
|
385
|
+
tailwindcssMajorVersion: majorVersion,
|
|
386
|
+
uniAppX: options.opts.uniAppX
|
|
387
|
+
}).target === "weapp";
|
|
388
|
+
const generated = await generateCssByGenerator(shouldReplayFrameworkPostcss ? {
|
|
389
|
+
...options,
|
|
390
|
+
deferCssAdaptation: true
|
|
391
|
+
} : options);
|
|
277
392
|
if (!generated) return;
|
|
393
|
+
const adaptedCss = shouldReplayFrameworkPostcss ? await adaptGeneratedCssWithFrameworkPipeline(frameworkPostcssOwner, generated, {
|
|
394
|
+
cssHandlerOptions: options.cssHandlerOptions,
|
|
395
|
+
file: options.file,
|
|
396
|
+
majorVersion,
|
|
397
|
+
styleHandler: options.styleHandler
|
|
398
|
+
}) : generated.css;
|
|
399
|
+
const css = isVueScopedStyleRequest(resolvePostcssRequestOption(options.cssHandlerOptions)) ? preferScopedGeneratedCssRules(adaptedCss) : adaptedCss;
|
|
278
400
|
return {
|
|
279
401
|
...generated,
|
|
402
|
+
css,
|
|
280
403
|
classSet: generated.classSet,
|
|
281
404
|
dependencies: generated.dependencies,
|
|
282
405
|
metadata: {
|
|
@@ -728,4 +851,4 @@ function createSourceCandidateScanSignature(input) {
|
|
|
728
851
|
});
|
|
729
852
|
}
|
|
730
853
|
//#endregion
|
|
731
|
-
export {
|
|
854
|
+
export { collectFrameworkPostcssOptionsFromLoaderEntries as A, createBundleModuleGraphOptions as C, toAbsoluteOutputPath as D, resolveOutputSpecifier as E, viteStyleInjectorDelegates as F, webpackStyleInjectorDelegates as I, resolveViteFrameworkProfile as L, resolvePluginDisabledState as M, createBuiltinViteStyleInjectorPlugins as N, captureFrameworkPostcssOptions as O, createBuiltinWebpackStyleInjectorPlugin as P, resolveWebpackFrameworkProfile as R, applyLinkedResults as S, normalizeOutputPathKey as T, isCSSRequest as _, createCandidateSignature as a, slash as b, getSnapshotHash as c, buildBundleSnapshot as d, classifyBundleEntry as f, formatPostcssSourceMap as g, cleanUrl as h, createScopedGeneratorSourceTraceMap as i, resolvePackageDir as j, captureResolvedFrameworkPostcssOptions as k, hasRuntimeAffectingSourceChanges as l, updateBundleBuildState as m, createScopedGeneratorCandidateSignature as n, createJsHashSalt as o, createBundleBuildState as p, createScopedGeneratorRuntime as r, createLinkedImpactSignature as s, createSourceCandidateScanSignature as t, summarizeStringDiff as u, isHTMLRequest as v, generateTailwindV4Css as w, createRuntimeAffectingSourceSignature as x, normalizePath as y };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare function getTailwindV4IncrementalGenerateCacheStats(): {
|
|
2
|
+
max: number;
|
|
3
|
+
entryCandidatesMax: number;
|
|
4
|
+
entryCssBytesMax: number;
|
|
5
|
+
size: number;
|
|
6
|
+
taskMax: number;
|
|
7
|
+
taskSize: number;
|
|
8
|
+
entries: {
|
|
9
|
+
candidates: number;
|
|
10
|
+
classSet: number;
|
|
11
|
+
cssBytes: number;
|
|
12
|
+
rawCssBytes: number;
|
|
13
|
+
keyHash: string;
|
|
14
|
+
keyBytes: number;
|
|
15
|
+
}[];
|
|
16
|
+
keys: {
|
|
17
|
+
keyHash: string;
|
|
18
|
+
keyBytes: number;
|
|
19
|
+
}[];
|
|
20
|
+
taskKeys: {
|
|
21
|
+
keyHash: string;
|
|
22
|
+
keyBytes: number;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export declare const getTailwindV4IncrementalGenerateCacheStatsForTest: typeof getTailwindV4IncrementalGenerateCacheStats;
|
|
26
|
+
export declare function clearTailwindV4IncrementalGenerateCacheForTest(): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { TailwindV4DesignSystem, TailwindV4Engine, TailwindV4GenerateOptions, TailwindV4GenerateTarget, TailwindV4ResolvedSource, TailwindV4SourcePattern } from '../types';
|
|
3
|
+
import { LRUCache } from 'lru-cache';
|
|
4
|
+
export declare const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
5
|
+
export declare const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
6
|
+
export declare const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12000;
|
|
7
|
+
export declare const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX: number;
|
|
8
|
+
export declare const incrementalGenerateCache: LRUCache<string, TailwindV4IncrementalGenerateCacheEntry, unknown>;
|
|
9
|
+
export declare const incrementalGenerateTaskCache: LRUCache<string, Promise<import("..").TailwindV4GenerateResult>, unknown>;
|
|
10
|
+
interface TailwindV4IncrementalGenerateCacheEntry {
|
|
11
|
+
seenCandidates: Set<string>;
|
|
12
|
+
classSet: Set<string>;
|
|
13
|
+
css: string;
|
|
14
|
+
rawCss: string;
|
|
15
|
+
customPropertyValues: Map<string, string>;
|
|
16
|
+
designSystemPromise: Promise<TailwindV4DesignSystem>;
|
|
17
|
+
dependencies: string[];
|
|
18
|
+
sources: TailwindV4SourcePattern[];
|
|
19
|
+
root: null | 'none' | {
|
|
20
|
+
base: string;
|
|
21
|
+
pattern: string;
|
|
22
|
+
};
|
|
23
|
+
target: TailwindV4GenerateTarget;
|
|
24
|
+
}
|
|
25
|
+
interface TailwindV4IncrementalCacheSeedOptions {
|
|
26
|
+
compatibleSource: TailwindV4ResolvedSource;
|
|
27
|
+
generated: Awaited<ReturnType<TailwindV4Engine['generate']>>;
|
|
28
|
+
requestedCandidates: Set<string>;
|
|
29
|
+
styleOptions: Partial<IStyleHandlerOptions> | undefined;
|
|
30
|
+
target: TailwindV4GenerateTarget;
|
|
31
|
+
}
|
|
32
|
+
export declare function collectCandidates(candidates: Iterable<string> | undefined): Set<string>;
|
|
33
|
+
export declare function hasRemovedCandidates(previousCandidates: Set<string>, nextCandidates: Set<string>): boolean;
|
|
34
|
+
export declare function createIncrementalGenerateCacheKey(source: TailwindV4ResolvedSource, target: TailwindV4GenerateTarget, styleOptions: Partial<IStyleHandlerOptions> | undefined): string;
|
|
35
|
+
export declare function runIncrementalGenerateTask(cacheKey: string, requestedCandidates: Set<string>, scanSources: TailwindV4GenerateOptions['scanSources'], task: () => Promise<Awaited<ReturnType<TailwindV4Engine['generate']>>>): Promise<import("..").TailwindV4GenerateResult>;
|
|
36
|
+
export declare function resolveTargetCandidates(candidates: Iterable<string> | undefined, target: TailwindV4GenerateTarget): Set<string>;
|
|
37
|
+
export declare function shouldDelegateWebSourceScanToTailwind(target: TailwindV4GenerateTarget, scanSources: TailwindV4GenerateOptions['scanSources']): boolean;
|
|
38
|
+
export declare function createIncrementalStyleOptions(styleOptions: Partial<IStyleHandlerOptions> | undefined): Partial<IStyleHandlerOptions>;
|
|
39
|
+
export declare function resolveStyleOptions(source: TailwindV4ResolvedSource, options: Partial<IStyleHandlerOptions> | undefined): Partial<IStyleHandlerOptions> | undefined;
|
|
40
|
+
export declare function mergeCustomPropertyValues(target: Map<string, string>, css: string): void;
|
|
41
|
+
export declare function summarizeIncrementalCacheKey(key: string): {
|
|
42
|
+
keyHash: string;
|
|
43
|
+
keyBytes: number;
|
|
44
|
+
};
|
|
45
|
+
export declare function shouldRebuildIncrementalEntry(cached: TailwindV4IncrementalGenerateCacheEntry, requestedCandidates: Set<string>, missingCandidates: string[]): boolean;
|
|
46
|
+
export declare function seedIncrementalGenerateCache(options: TailwindV4IncrementalCacheSeedOptions): boolean;
|
|
47
|
+
export declare function normalizeTargetRpxLengthCandidates(candidates: Iterable<string>, target: TailwindV4GenerateTarget, styleOptions: Partial<IStyleHandlerOptions> | undefined): {
|
|
48
|
+
candidates: Set<string>;
|
|
49
|
+
restoreCandidates: Map<string, string>;
|
|
50
|
+
};
|
|
51
|
+
export declare function resolveGeneratedSourcePatterns(generatedSources: TailwindV4SourcePattern[], scanSources: TailwindV4GenerateOptions['scanSources']): import("@tailwindcss-mangle/engine").TailwindV4SourcePattern[];
|
|
52
|
+
export {};
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare function getTailwindV4IncrementalGenerateCacheStats(): {
|
|
4
|
-
max: number;
|
|
5
|
-
entryCandidatesMax: number;
|
|
6
|
-
entryCssBytesMax: number;
|
|
7
|
-
size: number;
|
|
8
|
-
taskMax: number;
|
|
9
|
-
taskSize: number;
|
|
10
|
-
entries: {
|
|
11
|
-
candidates: number;
|
|
12
|
-
classSet: number;
|
|
13
|
-
cssBytes: number;
|
|
14
|
-
rawCssBytes: number;
|
|
15
|
-
keyHash: string;
|
|
16
|
-
keyBytes: number;
|
|
17
|
-
}[];
|
|
18
|
-
keys: {
|
|
19
|
-
keyHash: string;
|
|
20
|
-
keyBytes: number;
|
|
21
|
-
}[];
|
|
22
|
-
taskKeys: {
|
|
23
|
-
keyHash: string;
|
|
24
|
-
keyBytes: number;
|
|
25
|
-
}[];
|
|
26
|
-
};
|
|
27
|
-
export declare const getTailwindV4IncrementalGenerateCacheStatsForTest: typeof getTailwindV4IncrementalGenerateCacheStats;
|
|
28
|
-
export declare function clearTailwindV4IncrementalGenerateCacheForTest(): void;
|
|
1
|
+
export { clearTailwindV4IncrementalGenerateCacheForTest, getTailwindV4IncrementalGenerateCacheStats, getTailwindV4IncrementalGenerateCacheStatsForTest } from './generator/cache-stats';
|
|
2
|
+
export { createTailwindV4Engine } from './generator/engine';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-B91GhUJQ.js");
|
|
3
3
|
const require_object = require("./object-COs_Mw6p.js");
|
|
4
4
|
require("./utils-CuKLf1Zv.js");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
@@ -896,7 +896,7 @@ function warnMissingCssEntries(ctx, tailwindRuntime) {
|
|
|
896
896
|
_weapp_tailwindcss_logger.logger.warn("[tailwindcss@4] 未检测到 cssEntries 配置。请传入包含 tailwindcss 引用的 CSS 绝对路径,例如 cssEntries: [\"/absolute/path/to/src/app.css\"],否则 tailwindcss 生成的类名不会参与转译。");
|
|
897
897
|
}
|
|
898
898
|
function applyV4CssCalcDefaults(cssCalc, tailwindRuntime) {
|
|
899
|
-
const cssCalcOptions = cssCalc ??
|
|
899
|
+
const cssCalcOptions = cssCalc ?? false;
|
|
900
900
|
if (tailwindRuntime && cssCalcOptions) return ensureDefaultsIncluded(cssCalcOptions);
|
|
901
901
|
return cssCalcOptions;
|
|
902
902
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as findWorkspaceRoot, D as normalizeStringListOption, E as resolveTailwindcssOptions, Et as resolveCssSourceEntries, Ft as loadTailwindV4DesignSystem, Mt as resolveCssMacroTailwindV4Source, Ot as resolveTailwindV4CssSourceBase, S as findWorkspacePackageDir, St as expandTailwindSourceEntries, T as normalizeTailwindcssRuntimeOptions, Tt as parseConfigParam, _ as groupCssEntriesByBase, b as normalizeCssEntries, bt as FULL_SOURCE_SCAN_PATTERN, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as guessBasedirFromEntries, w as normalizeExtendLengthUnits, wt as normalizeLegacyContentEntries, x as findNearestPackageRoot, xt as createTailwindSourceEntryMatcher, y as isTailwindV4CssEntry } from "./generator-Bv7myuhY.mjs";
|
|
2
2
|
import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
|
|
3
3
|
import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -892,7 +892,7 @@ function warnMissingCssEntries(ctx, tailwindRuntime) {
|
|
|
892
892
|
logger.warn("[tailwindcss@4] 未检测到 cssEntries 配置。请传入包含 tailwindcss 引用的 CSS 绝对路径,例如 cssEntries: [\"/absolute/path/to/src/app.css\"],否则 tailwindcss 生成的类名不会参与转译。");
|
|
893
893
|
}
|
|
894
894
|
function applyV4CssCalcDefaults(cssCalc, tailwindRuntime) {
|
|
895
|
-
const cssCalcOptions = cssCalc ??
|
|
895
|
+
const cssCalcOptions = cssCalc ?? false;
|
|
896
896
|
if (tailwindRuntime && cssCalcOptions) return ensureDefaultsIncluded(cssCalcOptions);
|
|
897
897
|
return cssCalcOptions;
|
|
898
898
|
}
|