weapp-tailwindcss 5.1.14 → 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/auto-2dg_uhEJ.mjs +13 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +2 -0
- package/dist/bundlers/gulp/index.d.ts +2 -0
- 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 +4 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +14 -0
- package/dist/bundlers/shared/generated-css-marker.d.ts +2 -2
- 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/local-imports.d.ts +1 -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/postcss-source.d.ts +2 -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/types.d.ts +5 -0
- 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/style-requests.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +3 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -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/bundle-markup-candidates.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- 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/remembered-css-replay.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +5 -0
- 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 +4 -2
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +2 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +5 -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/vite/watch-css-post.d.ts +10 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +1 -0
- 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 -217
- 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 +6 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +4 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +3 -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-BL8Gy71H.mjs → context-JzwzSX36.mjs} +3 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{generator-CEnUsjed.js → generator-B91GhUJQ.js} +636 -505
- package/dist/{generator-B59OA64h.mjs → generator-Bv7myuhY.mjs} +557 -432
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-DUYWxmZC.mjs → gulp-CKSklPlH.mjs} +218 -153
- package/dist/{gulp-C1Q3LRzg.js → gulp-Q1wITegn.js} +218 -153
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-C3ed5vCx.mjs → hmr-timing-BXg7nI8N.mjs} +3406 -3145
- package/dist/{hmr-timing-BZ5sWIqO.js → hmr-timing-CMPaWn9P.js} +3474 -3147
- 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/shared/mpx.d.ts +4 -1
- package/dist/{source-candidate-scan-signature-R3dzamcm.js → source-candidate-scan-signature-BKZZk_e6.js} +144 -96
- package/dist/{source-candidate-scan-signature-D7RWjWsY.mjs → source-candidate-scan-signature-CtK-mB_C.mjs} +127 -60
- 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-DPcKMLxL.mjs → tailwindcss-BTcXX8Ka.mjs} +2 -2
- package/dist/{transform-D5JUgMpE.mjs → transform-B_KM9sLX.mjs} +47 -5
- package/dist/{transform-COFRlmDF.js → transform-CcYptivi.js} +47 -5
- package/dist/uni-app-x/component-local-style.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +1 -1
- package/dist/{vite-CBU5NXTX.mjs → vite-BwQWl9ft.mjs} +1269 -878
- package/dist/{vite-BNlPdsGM.js → vite-DhVnXvAQ.js} +1314 -923
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-generation-loader.js +12 -0
- package/dist/weapp-tw-css-import-rewrite-loader-B0tVkJLH.js +10524 -0
- package/dist/weapp-tw-css-import-rewrite-loader.js +6 -10255
- package/dist/weapp-tw-runtime-classset-loader.js +10 -4
- package/dist/{webpack-CZ38fMGC.mjs → webpack-Bo1QrFPf.mjs} +1518 -1079
- package/dist/{webpack-Jpe048pQ.js → webpack-kh78iMSS.js} +1519 -1080
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +17 -7
- package/dist/auto-CrJJc5rK.mjs +0 -13
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";
|
package/dist/shared/mpx.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { AppType } from '../types';
|
|
2
|
+
import path from 'node:path';
|
|
2
3
|
export declare function isMpx(appType?: AppType): appType is "mpx";
|
|
3
4
|
export declare function getTailwindcssCssEntry(pkgDir: string): string;
|
|
4
|
-
export declare function
|
|
5
|
+
export declare function rewriteMpxWebpackPluginRequests(request: string, mpxWebpackPluginDir: string, pathImpl?: Pick<typeof path, 'join'>): string;
|
|
6
|
+
export declare function patchMpxWebpackPluginRequests(compiler: any, mpxWebpackPluginDir: string | undefined): boolean;
|
|
7
|
+
export declare function patchMpxWebpackPluginNormalizeLib(_compiler: any, mpxWebpackPluginDir: string | undefined): boolean;
|
|
5
8
|
export declare function ensureMpxTailwindcssAliases(compiler: any, pkgDir: string): string;
|
|
6
9
|
export declare function patchMpxLoaderResolve(loaderContext: any, pkgDir: string, enabled: boolean): void;
|
|
7
10
|
export declare function setupMpxTailwindcssRedirect(pkgDir: string, enabled: boolean): void;
|
|
@@ -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,37 +230,107 @@ function resolvePackageDir(name) {
|
|
|
229
230
|
return node_path.default.dirname(pkgPath);
|
|
230
231
|
}
|
|
231
232
|
//#endregion
|
|
232
|
-
//#region src/bundlers/shared/
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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;
|
|
261
303
|
}
|
|
262
|
-
|
|
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
|
+
});
|
|
263
334
|
}
|
|
264
335
|
//#endregion
|
|
265
336
|
//#region src/bundlers/shared/module-graph.ts
|
|
@@ -306,38 +377,32 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
|
|
|
306
377
|
return matchWithExtensions(candidate, hasOutput);
|
|
307
378
|
}
|
|
308
379
|
//#endregion
|
|
309
|
-
//#region src/bundlers/shared/style-requests.ts
|
|
310
|
-
const SOURCE_STYLE_EXT_RE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)$/i;
|
|
311
|
-
const STYLE_QUERY_RE = /(?:^|&)type=styles?(?:&|$)/;
|
|
312
|
-
const STYLE_LANG_QUERY_RE = /(?:^|&)lang(?:[.=](?:css|scss|sass|less|styl|stylus|pcss|postcss))?(?:&|$)/;
|
|
313
|
-
function stripHash(request) {
|
|
314
|
-
const hashIndex = request.indexOf("#");
|
|
315
|
-
return hashIndex === -1 ? request : request.slice(0, hashIndex);
|
|
316
|
-
}
|
|
317
|
-
function stripRequestQuery(request) {
|
|
318
|
-
const normalized = stripHash(request);
|
|
319
|
-
const queryIndex = normalized.indexOf("?");
|
|
320
|
-
return queryIndex === -1 ? normalized : normalized.slice(0, queryIndex);
|
|
321
|
-
}
|
|
322
|
-
function isSourceStyleRequest(request) {
|
|
323
|
-
if (typeof request !== "string" || request.length === 0) return false;
|
|
324
|
-
const normalized = stripHash(request);
|
|
325
|
-
const queryIndex = normalized.indexOf("?");
|
|
326
|
-
const pathname = queryIndex === -1 ? normalized : normalized.slice(0, queryIndex);
|
|
327
|
-
if (SOURCE_STYLE_EXT_RE.test(pathname)) return true;
|
|
328
|
-
if (queryIndex === -1) return false;
|
|
329
|
-
const query = normalized.slice(queryIndex + 1);
|
|
330
|
-
return STYLE_QUERY_RE.test(query) || STYLE_LANG_QUERY_RE.test(query);
|
|
331
|
-
}
|
|
332
|
-
//#endregion
|
|
333
380
|
//#region src/bundlers/shared/v4-generation-core.ts
|
|
334
381
|
async function generateTailwindV4Css(options) {
|
|
335
382
|
const majorVersion = options.runtimeState.tailwindRuntime.majorVersion;
|
|
336
383
|
if (majorVersion !== 4) throw new Error("weapp-tailwindcss 生成管线仅支持 Tailwind CSS v4。");
|
|
337
|
-
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);
|
|
338
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;
|
|
339
403
|
return {
|
|
340
404
|
...generated,
|
|
405
|
+
css,
|
|
341
406
|
classSet: generated.classSet,
|
|
342
407
|
dependencies: generated.dependencies,
|
|
343
408
|
metadata: {
|
|
@@ -476,7 +541,7 @@ const isWindows = node_process.default.platform === "win32";
|
|
|
476
541
|
const cssLangRE = new RegExp(`\\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\\?)`);
|
|
477
542
|
const htmlLangRE = /\.html?(?:$|\?)/;
|
|
478
543
|
function isCSSRequest(request) {
|
|
479
|
-
return cssLangRE.test(request) || isSourceStyleRequest(request);
|
|
544
|
+
return cssLangRE.test(request) || require_hmr_timing.isSourceStyleRequest(request);
|
|
480
545
|
}
|
|
481
546
|
function isHTMLRequest(request) {
|
|
482
547
|
return htmlLangRE.test(request);
|
|
@@ -510,6 +575,7 @@ function createBundleBuildState() {
|
|
|
510
575
|
runtimeAffectingHashByFile: /* @__PURE__ */ new Map(),
|
|
511
576
|
linkedByEntry: /* @__PURE__ */ new Map(),
|
|
512
577
|
dependentsByLinkedFile: /* @__PURE__ */ new Map(),
|
|
578
|
+
bundleMarkupCandidatesByFile: /* @__PURE__ */ new Map(),
|
|
513
579
|
generatorCandidateSignature: void 0
|
|
514
580
|
};
|
|
515
581
|
}
|
|
@@ -530,7 +596,7 @@ function createProcessFiles() {
|
|
|
530
596
|
}
|
|
531
597
|
function readEntrySource(output) {
|
|
532
598
|
if (output.type === "chunk") return output.code;
|
|
533
|
-
return output.source.toString();
|
|
599
|
+
return typeof output.source === "string" ? output.source : node_buffer.Buffer.from(output.source).toString();
|
|
534
600
|
}
|
|
535
601
|
function classifyBundleEntry(file, opts) {
|
|
536
602
|
if (opts.htmlMatcher(file) || isHTMLRequest(file)) return "html";
|
|
@@ -800,12 +866,30 @@ Object.defineProperty(exports, "buildBundleSnapshot", {
|
|
|
800
866
|
return buildBundleSnapshot;
|
|
801
867
|
}
|
|
802
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
|
+
});
|
|
803
881
|
Object.defineProperty(exports, "classifyBundleEntry", {
|
|
804
882
|
enumerable: true,
|
|
805
883
|
get: function() {
|
|
806
884
|
return classifyBundleEntry;
|
|
807
885
|
}
|
|
808
886
|
});
|
|
887
|
+
Object.defineProperty(exports, "collectFrameworkPostcssOptionsFromLoaderEntries", {
|
|
888
|
+
enumerable: true,
|
|
889
|
+
get: function() {
|
|
890
|
+
return collectFrameworkPostcssOptionsFromLoaderEntries;
|
|
891
|
+
}
|
|
892
|
+
});
|
|
809
893
|
Object.defineProperty(exports, "createBuiltinViteStyleInjectorPlugins", {
|
|
810
894
|
enumerable: true,
|
|
811
895
|
get: function() {
|
|
@@ -830,12 +914,6 @@ Object.defineProperty(exports, "createBundleModuleGraphOptions", {
|
|
|
830
914
|
return createBundleModuleGraphOptions;
|
|
831
915
|
}
|
|
832
916
|
});
|
|
833
|
-
Object.defineProperty(exports, "createBundlerGeneratedCssMarker", {
|
|
834
|
-
enumerable: true,
|
|
835
|
-
get: function() {
|
|
836
|
-
return createBundlerGeneratedCssMarker;
|
|
837
|
-
}
|
|
838
|
-
});
|
|
839
917
|
Object.defineProperty(exports, "createCandidateSignature", {
|
|
840
918
|
enumerable: true,
|
|
841
919
|
get: function() {
|
|
@@ -902,12 +980,6 @@ Object.defineProperty(exports, "getSnapshotHash", {
|
|
|
902
980
|
return getSnapshotHash;
|
|
903
981
|
}
|
|
904
982
|
});
|
|
905
|
-
Object.defineProperty(exports, "hasBundlerGeneratedCssMarker", {
|
|
906
|
-
enumerable: true,
|
|
907
|
-
get: function() {
|
|
908
|
-
return hasBundlerGeneratedCssMarker;
|
|
909
|
-
}
|
|
910
|
-
});
|
|
911
983
|
Object.defineProperty(exports, "hasRuntimeAffectingSourceChanges", {
|
|
912
984
|
enumerable: true,
|
|
913
985
|
get: function() {
|
|
@@ -926,12 +998,6 @@ Object.defineProperty(exports, "isHTMLRequest", {
|
|
|
926
998
|
return isHTMLRequest;
|
|
927
999
|
}
|
|
928
1000
|
});
|
|
929
|
-
Object.defineProperty(exports, "isSourceStyleRequest", {
|
|
930
|
-
enumerable: true,
|
|
931
|
-
get: function() {
|
|
932
|
-
return isSourceStyleRequest;
|
|
933
|
-
}
|
|
934
|
-
});
|
|
935
1001
|
Object.defineProperty(exports, "normalizeOutputPathKey", {
|
|
936
1002
|
enumerable: true,
|
|
937
1003
|
get: function() {
|
|
@@ -944,12 +1010,6 @@ Object.defineProperty(exports, "normalizePath", {
|
|
|
944
1010
|
return normalizePath;
|
|
945
1011
|
}
|
|
946
1012
|
});
|
|
947
|
-
Object.defineProperty(exports, "parseBundlerGeneratedCssMarkerBlocks", {
|
|
948
|
-
enumerable: true,
|
|
949
|
-
get: function() {
|
|
950
|
-
return parseBundlerGeneratedCssMarkerBlocks;
|
|
951
|
-
}
|
|
952
|
-
});
|
|
953
1013
|
Object.defineProperty(exports, "resolveOutputSpecifier", {
|
|
954
1014
|
enumerable: true,
|
|
955
1015
|
get: function() {
|
|
@@ -986,18 +1046,6 @@ Object.defineProperty(exports, "slash", {
|
|
|
986
1046
|
return slash;
|
|
987
1047
|
}
|
|
988
1048
|
});
|
|
989
|
-
Object.defineProperty(exports, "stripBundlerGeneratedCssMarkers", {
|
|
990
|
-
enumerable: true,
|
|
991
|
-
get: function() {
|
|
992
|
-
return stripBundlerGeneratedCssMarkers;
|
|
993
|
-
}
|
|
994
|
-
});
|
|
995
|
-
Object.defineProperty(exports, "stripRequestQuery", {
|
|
996
|
-
enumerable: true,
|
|
997
|
-
get: function() {
|
|
998
|
-
return stripRequestQuery;
|
|
999
|
-
}
|
|
1000
|
-
});
|
|
1001
1049
|
Object.defineProperty(exports, "summarizeStringDiff", {
|
|
1002
1050
|
enumerable: true,
|
|
1003
1051
|
get: function() {
|