weapp-tailwindcss 5.3.4 → 5.3.6
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/vite/shared/framework-source-candidates-plugin.d.ts +1 -1
- package/dist/bundlers/vite/shared/generic-web-production-fast-path.d.ts +13 -3
- package/dist/{context-Ulhcd5lF.cjs → context-DTLRADfE.cjs} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/{gulp-CDIXMhIO.cjs → gulp-CUysZjW3.cjs} +4 -4
- package/dist/gulp.cjs +1 -1
- package/dist/{hmr-timing-DcFB_kwB.cjs → hmr-timing-Cvh5UgnM.cjs} +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/dist/{pipeline-helpers-kB7Mn2Jy.cjs → pipeline-helpers-CyVXL3h6.cjs} +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +1 -1
- package/dist/{source-candidate-scan-signature-C1r5mHSi.cjs → source-candidate-scan-signature-BNt7NrrI.cjs} +1 -1
- package/dist/{transform-Cp4KybBy.js → transform-Bfi1_VgN.js} +7 -6
- package/dist/{transform-BQjg2T2T.cjs → transform-CL-UZW1U.cjs} +8 -7
- package/dist/{v4-generation-core-OVshPBGo.cjs → v4-generation-core-Dhsu9Deu.cjs} +1 -1
- package/dist/{vite-D1a6OfVn.js → vite-DJkhb8n1.js} +28 -5
- package/dist/{vite-cXJPnKXp.cjs → vite-DMX5zoID.cjs} +32 -9
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +2 -2
- package/dist/{webpack-DOhCcN_2.cjs → webpack-Cpy_yggg.cjs} +6 -6
- package/dist/{webpack-DQAbh1Z7.js → webpack-CzhrD9p3.js} +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/dist/{wxml-CQmBCjOR.cjs → wxml-PrK-8ARX.cjs} +66 -27
- package/package.json +6 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
export declare function createFrameworkSourceCandidatesPlugin(options: any): Plugin;
|
|
2
|
+
export declare function createFrameworkSourceCandidatesPlugin(options: any, apply?: Plugin['apply']): Plugin;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type { ResolvedConfig } from 'vite';
|
|
2
|
-
interface
|
|
1
|
+
import type { ConfigEnv, ResolvedConfig, UserConfig } from 'vite';
|
|
2
|
+
interface GenericWebProductionBuildOptions {
|
|
3
3
|
command: ResolvedConfig['command'] | undefined;
|
|
4
4
|
frameworkName: string;
|
|
5
|
-
hasProcessedCss: boolean;
|
|
6
5
|
isWebGeneratorTarget: boolean;
|
|
6
|
+
requiresSourceCandidateState?: boolean;
|
|
7
7
|
watch: ResolvedConfig['build']['watch'] | undefined;
|
|
8
8
|
}
|
|
9
|
+
interface GenericWebProductionFastPathOptions extends GenericWebProductionBuildOptions {
|
|
10
|
+
hasProcessedCss: boolean;
|
|
11
|
+
}
|
|
9
12
|
export interface GenericWebFinalizerFastPathOptions extends GenericWebProductionFastPathOptions {
|
|
10
13
|
hasFrameworkRootImportShells: boolean;
|
|
11
14
|
isHarmonyAppStyleTarget: boolean;
|
|
@@ -19,6 +22,13 @@ interface GenericWebProductionBundleHooksOptions {
|
|
|
19
22
|
onEnd: () => void;
|
|
20
23
|
onStart: () => void;
|
|
21
24
|
}
|
|
25
|
+
interface GenericWebProductionSourceCandidatesApplyOptions {
|
|
26
|
+
frameworkName: string;
|
|
27
|
+
getIsWebGeneratorTarget: () => boolean;
|
|
28
|
+
requiresSourceCandidateState: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function shouldSkipGenericWebProductionSourceCandidates(options: GenericWebProductionBuildOptions): boolean;
|
|
31
|
+
export declare function createGenericWebProductionSourceCandidatesApply(options: GenericWebProductionSourceCandidatesApplyOptions): (config: UserConfig, env: ConfigEnv) => boolean;
|
|
22
32
|
export declare function shouldUseGenericWebProductionFastPath(options: GenericWebProductionFastPathOptions): boolean;
|
|
23
33
|
export declare function shouldUseGenericWebFinalizerFastPath(options: GenericWebFinalizerFastPathOptions): boolean;
|
|
24
34
|
export declare function createGenericWebProductionBundleHooks(options: GenericWebProductionBundleHooksOptions): {
|
|
@@ -4,7 +4,7 @@ const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
|
4
4
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
5
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
6
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
7
|
-
const require_wxml = require("./wxml-
|
|
7
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
8
8
|
const require_defaults = require("./defaults.cjs");
|
|
9
9
|
const require_tailwindcss = require("./tailwindcss-CexDJBhx.cjs");
|
|
10
10
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
@@ -619,7 +619,7 @@ function toCustomAttributesEntities(customAttributes) {
|
|
|
619
619
|
return Object.entries(customAttributes);
|
|
620
620
|
}
|
|
621
621
|
//#endregion
|
|
622
|
-
//#region ../../node_modules/.pnpm/oxc-walker@1.1.1_@oxc-project+types@0.
|
|
622
|
+
//#region ../../node_modules/.pnpm/oxc-walker@1.1.1_@oxc-project+types@0.146.0_oxc-parser@0.146.0_rolldown@1.2.3/node_modules/oxc-walker/dist/index.mjs
|
|
623
623
|
function isNode(v) {
|
|
624
624
|
return v !== null && typeof v === "object" && typeof v.type === "string";
|
|
625
625
|
}
|
package/dist/core.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_context = require("./context-
|
|
2
|
+
const require_context = require("./context-DTLRADfE.cjs");
|
|
3
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
4
4
|
//#region src/core.ts
|
|
5
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
3
3
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
4
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
5
|
-
const require_wxml = require("./wxml-
|
|
6
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
7
|
-
const require_context = require("./context-
|
|
4
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
5
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
6
|
+
const require_hmr_timing = require("./hmr-timing-Cvh5UgnM.cjs");
|
|
7
|
+
const require_context = require("./context-DTLRADfE.cjs");
|
|
8
8
|
const require_tailwindcss = require("./tailwindcss-CexDJBhx.cjs");
|
|
9
9
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
10
10
|
let node_fs = require("node:fs");
|
package/dist/gulp.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_gulp = require("./gulp-CUysZjW3.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_gulp.createPlugins;
|
|
4
4
|
exports.createPlugins = require_gulp.createPlugins;
|
|
5
5
|
exports.weappTailwindcss = require_gulp.createPlugins;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
3
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
4
|
-
const require_wxml = require("./wxml-
|
|
3
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
4
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
5
5
|
const require_tailwindcss = require("./tailwindcss-CexDJBhx.cjs");
|
|
6
6
|
let node_process = require("node:process");
|
|
7
7
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
3
|
const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
4
|
+
const require_gulp = require("./gulp-CUysZjW3.cjs");
|
|
5
5
|
const require_postcss = require("./postcss.cjs");
|
|
6
|
-
const require_vite = require("./vite-
|
|
7
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-DMX5zoID.cjs");
|
|
7
|
+
const require_webpack = require("./webpack-Cpy_yggg.cjs");
|
|
8
8
|
require("./webpack.cjs");
|
|
9
9
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
10
10
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMp
|
|
|
2
2
|
import { t as createWeappTailwindcssGenerator } from "./generator-EnTXLBlK.js";
|
|
3
3
|
import { t as createPlugins } from "./gulp-DwtrU4V1.js";
|
|
4
4
|
import weappTailwindcssPostcssPlugin from "./postcss.js";
|
|
5
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
6
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-DJkhb8n1.js";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-CzhrD9p3.js";
|
|
7
7
|
import "./webpack.js";
|
|
8
8
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
9
9
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
3
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
3
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
4
4
|
const require_defaults = require("./defaults.cjs");
|
|
5
5
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
6
6
|
let node_path = require("node:path");
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
3
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
4
|
-
const require_webpack = require("./webpack-
|
|
3
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
4
|
+
const require_webpack = require("./webpack-Cpy_yggg.cjs");
|
|
5
5
|
let node_path = require("node:path");
|
|
6
6
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
7
7
|
//#region src/bundlers/rspack/rule-match.ts
|
package/dist/rspack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as isSourceStyleRequest } from "./hmr-timing-utmOgn6p.js";
|
|
2
|
-
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-
|
|
2
|
+
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-CzhrD9p3.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
//#region src/bundlers/rspack/rule-match.ts
|
|
5
5
|
const STYLE_RULE_PROBES = [
|
|
@@ -3,7 +3,7 @@ const require_framework = require("./framework.cjs");
|
|
|
3
3
|
const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
4
4
|
require("./auto-DtU6f3X6.cjs");
|
|
5
5
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
6
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
6
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -120,10 +120,11 @@ function extractLiteralValue(path) {
|
|
|
120
120
|
function createAlias(fileId, utility, index) {
|
|
121
121
|
return `wtu-${createStableHash(`${fileId}:${utility}`)}-${index.toString(36)}`;
|
|
122
122
|
}
|
|
123
|
-
function serializeApplyUtility(utility) {
|
|
124
|
-
|
|
123
|
+
function serializeApplyUtility(utility, options = {}) {
|
|
124
|
+
const importantSuffix = options.web ? "!" : "#{'!'}";
|
|
125
|
+
if (utility.startsWith("!") && !utility.startsWith("\\!")) return `${utility.slice(1)}${importantSuffix}`;
|
|
125
126
|
if (!utility.endsWith("!") || utility.endsWith("\\!")) return utility;
|
|
126
|
-
return `${utility.slice(0, -1)}
|
|
127
|
+
return `${utility.slice(0, -1)}${importantSuffix}`;
|
|
127
128
|
}
|
|
128
129
|
function isRuntimeCandidate(candidate, runtimeSet) {
|
|
129
130
|
if (!runtimeSet || runtimeSet.size === 0) return false;
|
|
@@ -292,7 +293,7 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
292
293
|
const localSelector = options.web ? `:global(.${alias})` : `.${alias}`;
|
|
293
294
|
const selector = this.deepUtilities.has(utility) ? `${localSelector}, :deep(.${alias})` : localSelector;
|
|
294
295
|
lines.push(`${selector} {`);
|
|
295
|
-
lines.push(` @apply ${serializeApplyUtility(utility)};`);
|
|
296
|
+
lines.push(` @apply ${serializeApplyUtility(utility, options)};`);
|
|
296
297
|
lines.push("}");
|
|
297
298
|
}
|
|
298
299
|
return `${lines.join("\n")}\n`;
|
|
@@ -462,12 +463,12 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
462
463
|
}
|
|
463
464
|
});
|
|
464
465
|
}
|
|
465
|
-
if (descriptor.script) {
|
|
466
|
+
if (descriptor.script && descriptor.script.start < descriptor.script.end) {
|
|
466
467
|
localStyleCollector?.collectRuntimeClasses(descriptor.script.content);
|
|
467
468
|
const { code } = jsHandler(descriptor.script.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
468
469
|
ms.update(descriptor.script.start, descriptor.script.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
469
470
|
}
|
|
470
|
-
if (descriptor.scriptSetup) {
|
|
471
|
+
if (descriptor.scriptSetup && descriptor.scriptSetup.start < descriptor.scriptSetup.end) {
|
|
471
472
|
localStyleCollector?.collectRuntimeClasses(descriptor.scriptSetup.content);
|
|
472
473
|
const { code } = jsHandler(descriptor.scriptSetup.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
473
474
|
ms.update(descriptor.scriptSetup.start, descriptor.scriptSetup.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
2
|
-
const require_wxml = require("./wxml-
|
|
2
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
3
3
|
const require_local_style_matcher = require("./local-style-matcher-DRpFEu1s.cjs");
|
|
4
4
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
5
5
|
let _vue_compiler_dom = require("@vue/compiler-dom");
|
|
@@ -119,10 +119,11 @@ function extractLiteralValue(path) {
|
|
|
119
119
|
function createAlias(fileId, utility, index) {
|
|
120
120
|
return `wtu-${createStableHash(`${fileId}:${utility}`)}-${index.toString(36)}`;
|
|
121
121
|
}
|
|
122
|
-
function serializeApplyUtility(utility) {
|
|
123
|
-
|
|
122
|
+
function serializeApplyUtility(utility, options = {}) {
|
|
123
|
+
const importantSuffix = options.web ? "!" : "#{'!'}";
|
|
124
|
+
if (utility.startsWith("!") && !utility.startsWith("\\!")) return `${utility.slice(1)}${importantSuffix}`;
|
|
124
125
|
if (!utility.endsWith("!") || utility.endsWith("\\!")) return utility;
|
|
125
|
-
return `${utility.slice(0, -1)}
|
|
126
|
+
return `${utility.slice(0, -1)}${importantSuffix}`;
|
|
126
127
|
}
|
|
127
128
|
function isRuntimeCandidate(candidate, runtimeSet) {
|
|
128
129
|
if (!runtimeSet || runtimeSet.size === 0) return false;
|
|
@@ -291,7 +292,7 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
291
292
|
const localSelector = options.web ? `:global(.${alias})` : `.${alias}`;
|
|
292
293
|
const selector = this.deepUtilities.has(utility) ? `${localSelector}, :deep(.${alias})` : localSelector;
|
|
293
294
|
lines.push(`${selector} {`);
|
|
294
|
-
lines.push(` @apply ${serializeApplyUtility(utility)};`);
|
|
295
|
+
lines.push(` @apply ${serializeApplyUtility(utility, options)};`);
|
|
295
296
|
lines.push("}");
|
|
296
297
|
}
|
|
297
298
|
return `${lines.join("\n")}\n`;
|
|
@@ -461,12 +462,12 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
461
462
|
}
|
|
462
463
|
});
|
|
463
464
|
}
|
|
464
|
-
if (descriptor.script) {
|
|
465
|
+
if (descriptor.script && descriptor.script.start < descriptor.script.end) {
|
|
465
466
|
localStyleCollector?.collectRuntimeClasses(descriptor.script.content);
|
|
466
467
|
const { code } = jsHandler(descriptor.script.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
467
468
|
ms.update(descriptor.script.start, descriptor.script.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
468
469
|
}
|
|
469
|
-
if (descriptor.scriptSetup) {
|
|
470
|
+
if (descriptor.scriptSetup && descriptor.scriptSetup.start < descriptor.scriptSetup.end) {
|
|
470
471
|
localStyleCollector?.collectRuntimeClasses(descriptor.scriptSetup.content);
|
|
471
472
|
const { code } = jsHandler(descriptor.scriptSetup.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
472
473
|
ms.update(descriptor.scriptSetup.start, descriptor.scriptSetup.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
@@ -3,7 +3,7 @@ const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
|
3
3
|
require("./auto-DtU6f3X6.cjs");
|
|
4
4
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
5
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
6
|
-
const require_wxml = require("./wxml-
|
|
6
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
7
7
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -3,7 +3,7 @@ import { $ as hasTailwindSourceDirectives, B as stripMiniProgramCssSpecificityPl
|
|
|
3
3
|
import { t as omitUndefined } from "./object-B-8IHefx.js";
|
|
4
4
|
import { a as findTailwindConfig, f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions, l as getRuntimeClassSetSignature, m as resolveTailwindV4CssDependencies, p as discoverTailwindV4CssEntries, r as isUniAppXEnabled } from "./tailwindcss-ChnpCv25.js";
|
|
5
5
|
import "./utils-MVwpU07P.js";
|
|
6
|
-
import { $ as AssetEmissionPlan, A as hasEmptyAtRuleBlockCandidate, C as isSourceStyleRequest, D as parseBundlerGeneratedCssMarkerBlocks, E as hasBundlerGeneratedCssMarker, F as processCachedTask, G as createRuntimeCompilationBuildState, H as finalizeCompilerShadowRun, I as createRuntimeClassSetManager, J as updateRuntimeCompilationBuildState, M as createCssSourceTraceCacheSignature, N as createCssTokenSourceMap, O as stripBundlerGeneratedCssMarkers, S as isSourcePreprocessorRequest, T as createBundlerGeneratedCssMarker, U as buildRuntimeCompilationSnapshot, X as disposeCompilerOwner, Y as createRuntimeAffectingSourceSignature, Z as beginCompilerShadowRun, a as extractMarkedUserLayerComponentsCss, ct as createSourceCandidateEligibilityMatcher, d as runWithConcurrency, f as normalizeMiniProgramGeneratorCssSource, g as captureFrameworkPostcssOptions, i as validateCandidatesByGenerator, it as createSourceCandidateCollector, j as annotateCssSourceTrace, k as finalizeMiniProgramCssStructure, m as scoreTailwindV4CssSourceFileMatch, nt as recordCompilationDependencyChanges, o as mergeMarkedUserLayerComponentsCss, ot as isSourceCandidateRequest, p as normalizeMiniProgramImportShell, r as generateTailwindV4Css, rt as createCompilationDependencyChanges, s as collectGeneratedRawSourceCandidatesFromCss, st as extractCandidatesFromSource, t as createHmrTimingRecorder, w as stripRequestQuery, z as isPureLocalCssImportWrapper } from "./hmr-timing-utmOgn6p.js";
|
|
6
|
+
import { $ as AssetEmissionPlan, A as hasEmptyAtRuleBlockCandidate, C as isSourceStyleRequest, D as parseBundlerGeneratedCssMarkerBlocks, E as hasBundlerGeneratedCssMarker, F as processCachedTask, G as createRuntimeCompilationBuildState, H as finalizeCompilerShadowRun, I as createRuntimeClassSetManager, J as updateRuntimeCompilationBuildState, M as createCssSourceTraceCacheSignature, N as createCssTokenSourceMap, O as stripBundlerGeneratedCssMarkers, P as isCssSourceTraceEnabled, S as isSourcePreprocessorRequest, T as createBundlerGeneratedCssMarker, U as buildRuntimeCompilationSnapshot, X as disposeCompilerOwner, Y as createRuntimeAffectingSourceSignature, Z as beginCompilerShadowRun, a as extractMarkedUserLayerComponentsCss, ct as createSourceCandidateEligibilityMatcher, d as runWithConcurrency, f as normalizeMiniProgramGeneratorCssSource, g as captureFrameworkPostcssOptions, i as validateCandidatesByGenerator, it as createSourceCandidateCollector, j as annotateCssSourceTrace, k as finalizeMiniProgramCssStructure, m as scoreTailwindV4CssSourceFileMatch, nt as recordCompilationDependencyChanges, o as mergeMarkedUserLayerComponentsCss, ot as isSourceCandidateRequest, p as normalizeMiniProgramImportShell, r as generateTailwindV4Css, rt as createCompilationDependencyChanges, s as collectGeneratedRawSourceCandidatesFromCss, st as extractCandidatesFromSource, t as createHmrTimingRecorder, w as stripRequestQuery, z as isPureLocalCssImportWrapper } from "./hmr-timing-utmOgn6p.js";
|
|
7
7
|
import { m as createDebug, p as replaceWxml } from "./wxml-B7OAVpXJ.js";
|
|
8
8
|
import { a as vitePluginName, c as collectRuntimeClassSet, d as refreshTailwindRuntimeState, f as normalizeFrameworkStylePlatform, l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, s as toCustomAttributesEntities, t as getCompilerContext } from "./context-4ittVpgt.js";
|
|
9
9
|
import { _ as createBuiltinViteStyleInjectorPlugins, a as createCandidateSignature, c as getSnapshotHash, d as classifyRuntimeEntry, f as resolvePackageDir, g as toAbsoluteOutputPath, h as resolveOutputSpecifier, i as createScopedGeneratorSourceTraceMap, l as hasRuntimeAffectingSourceChanges, m as normalizeOutputPathKey, n as createScopedGeneratorCandidateSignature, o as createJsHashSalt, p as resolvePluginDisabledState, r as createScopedGeneratorRuntime, s as createLinkedImpactSignature, t as createSourceCandidateScanSignature, u as summarizeStringDiff, x as resolveViteFrameworkProfile, y as viteStyleInjectorDelegates } from "./source-candidate-scan-signature-CDrLxVKu.js";
|
|
@@ -6305,7 +6305,7 @@ function createUniAppXWebLocalStyleBridge(isEnabled) {
|
|
|
6305
6305
|
//#region src/uni-app-x/vite.ts
|
|
6306
6306
|
let transformUVuePromise;
|
|
6307
6307
|
function loadTransformUVue() {
|
|
6308
|
-
transformUVuePromise ?? (transformUVuePromise = import("./transform-
|
|
6308
|
+
transformUVuePromise ?? (transformUVuePromise = import("./transform-Bfi1_VgN.js").then((mod) => mod.transformUVue));
|
|
6309
6309
|
return transformUVuePromise;
|
|
6310
6310
|
}
|
|
6311
6311
|
const UVUE_NVUE_QUERY_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
@@ -8138,10 +8138,28 @@ function createGenerateBundleHook(context) {
|
|
|
8138
8138
|
//#endregion
|
|
8139
8139
|
//#region src/bundlers/vite/shared/generic-web-production-fast-path.ts
|
|
8140
8140
|
/**
|
|
8141
|
+
* Generic Web 非 watch 生产构建由 Tailwind Scanner 直接提供候选,不需要重复维护小程序候选状态。
|
|
8142
|
+
*/
|
|
8143
|
+
function shouldSkipGenericWebProductionSourceCandidates(options) {
|
|
8144
|
+
return options.frameworkName === "generic" && options.command === "build" && options.watch == null && options.isWebGeneratorTarget && options.requiresSourceCandidateState !== true;
|
|
8145
|
+
}
|
|
8146
|
+
/**
|
|
8147
|
+
* 在 Vite 解析插件列表时排除无需维护的候选层,避免其 hooks 进入模块图。
|
|
8148
|
+
*/
|
|
8149
|
+
function createGenericWebProductionSourceCandidatesApply(options) {
|
|
8150
|
+
return (config, env) => !shouldSkipGenericWebProductionSourceCandidates({
|
|
8151
|
+
command: env.command,
|
|
8152
|
+
frameworkName: options.frameworkName,
|
|
8153
|
+
isWebGeneratorTarget: options.getIsWebGeneratorTarget(),
|
|
8154
|
+
requiresSourceCandidateState: options.requiresSourceCandidateState,
|
|
8155
|
+
watch: config.build?.watch
|
|
8156
|
+
});
|
|
8157
|
+
}
|
|
8158
|
+
/**
|
|
8141
8159
|
* Generic Web 生产构建的 CSS 已在 Vite transform 阶段生成时,不需要再建立面向小程序的完整产物快照。
|
|
8142
8160
|
*/
|
|
8143
8161
|
function shouldUseGenericWebProductionFastPath(options) {
|
|
8144
|
-
return options
|
|
8162
|
+
return shouldSkipGenericWebProductionSourceCandidates(options) && options.hasProcessedCss;
|
|
8145
8163
|
}
|
|
8146
8164
|
/**
|
|
8147
8165
|
* Finalizer fast path 只处理无小程序结构语义的 Generic Web 生产产物。
|
|
@@ -9736,7 +9754,7 @@ function sameStringList(first, second) {
|
|
|
9736
9754
|
}
|
|
9737
9755
|
//#endregion
|
|
9738
9756
|
//#region src/bundlers/vite/shared/framework-source-candidates-plugin.ts
|
|
9739
|
-
function createFrameworkSourceCandidatesPlugin(options) {
|
|
9757
|
+
function createFrameworkSourceCandidatesPlugin(options, apply) {
|
|
9740
9758
|
const hasDifferentHotModules = (left, right) => left.length !== right.length || left.some((mod, index) => mod !== right[index]);
|
|
9741
9759
|
const hasTemplateHotSourceModule = (modules) => modules.some((mod) => {
|
|
9742
9760
|
const request = mod.url ?? mod.id;
|
|
@@ -9767,6 +9785,7 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9767
9785
|
};
|
|
9768
9786
|
return {
|
|
9769
9787
|
name: `${vitePluginName}:source-candidates`,
|
|
9788
|
+
apply,
|
|
9770
9789
|
enforce: "pre",
|
|
9771
9790
|
async load(id) {
|
|
9772
9791
|
if (!options.shouldOwnTailwindGeneration || options.isWebOrNativeAppPlatform(options.resolveViteStylePlatform()) || !isCSSRequest(id) || !shouldCollectTransformedSourceCandidates(id)) return;
|
|
@@ -10904,7 +10923,11 @@ ${tracedCss}`;
|
|
|
10904
10923
|
tailwindRootCssModuleIds,
|
|
10905
10924
|
transformEarlyMiniProgramCss,
|
|
10906
10925
|
viteProcessedCssSourceFiles: processedCssRegistry.sourceFiles
|
|
10907
|
-
}
|
|
10926
|
+
}, createGenericWebProductionSourceCandidatesApply({
|
|
10927
|
+
frameworkName: frameworkBranch.frameworkName,
|
|
10928
|
+
getIsWebGeneratorTarget: () => resolveCurrentGeneratorBranch().isWeb,
|
|
10929
|
+
requiresSourceCandidateState: isCssSourceTraceEnabled(opts)
|
|
10930
|
+
}));
|
|
10908
10931
|
const postPlugin = createFrameworkPostPlugin({
|
|
10909
10932
|
api: { registerProcessedCssAsset(entry) {
|
|
10910
10933
|
markViteProcessedCssSource(entry.sourceFile);
|
|
@@ -4,13 +4,13 @@ const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
|
4
4
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
5
5
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
6
6
|
require("./utils-CuKLf1Zv.cjs");
|
|
7
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
8
|
-
const require_wxml = require("./wxml-
|
|
9
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
10
|
-
const require_context = require("./context-
|
|
7
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
8
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-Cvh5UgnM.cjs");
|
|
10
|
+
const require_context = require("./context-DTLRADfE.cjs");
|
|
11
11
|
const require_tailwindcss = require("./tailwindcss-CexDJBhx.cjs");
|
|
12
12
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
13
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
13
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-BNt7NrrI.cjs");
|
|
14
14
|
const require_local_style_matcher = require("./local-style-matcher-DRpFEu1s.cjs");
|
|
15
15
|
require("./logger-TlKT3xmR.cjs");
|
|
16
16
|
const require_css_imports = require("./css-imports-BFMU7Hpd.cjs");
|
|
@@ -6314,7 +6314,7 @@ function createUniAppXWebLocalStyleBridge(isEnabled) {
|
|
|
6314
6314
|
//#region src/uni-app-x/vite.ts
|
|
6315
6315
|
let transformUVuePromise;
|
|
6316
6316
|
function loadTransformUVue() {
|
|
6317
|
-
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-
|
|
6317
|
+
transformUVuePromise ?? (transformUVuePromise = Promise.resolve().then(() => require("./transform-CL-UZW1U.cjs")).then((mod) => mod.transformUVue));
|
|
6318
6318
|
return transformUVuePromise;
|
|
6319
6319
|
}
|
|
6320
6320
|
const UVUE_NVUE_QUERY_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
@@ -8147,10 +8147,28 @@ function createGenerateBundleHook(context) {
|
|
|
8147
8147
|
//#endregion
|
|
8148
8148
|
//#region src/bundlers/vite/shared/generic-web-production-fast-path.ts
|
|
8149
8149
|
/**
|
|
8150
|
+
* Generic Web 非 watch 生产构建由 Tailwind Scanner 直接提供候选,不需要重复维护小程序候选状态。
|
|
8151
|
+
*/
|
|
8152
|
+
function shouldSkipGenericWebProductionSourceCandidates(options) {
|
|
8153
|
+
return options.frameworkName === "generic" && options.command === "build" && options.watch == null && options.isWebGeneratorTarget && options.requiresSourceCandidateState !== true;
|
|
8154
|
+
}
|
|
8155
|
+
/**
|
|
8156
|
+
* 在 Vite 解析插件列表时排除无需维护的候选层,避免其 hooks 进入模块图。
|
|
8157
|
+
*/
|
|
8158
|
+
function createGenericWebProductionSourceCandidatesApply(options) {
|
|
8159
|
+
return (config, env) => !shouldSkipGenericWebProductionSourceCandidates({
|
|
8160
|
+
command: env.command,
|
|
8161
|
+
frameworkName: options.frameworkName,
|
|
8162
|
+
isWebGeneratorTarget: options.getIsWebGeneratorTarget(),
|
|
8163
|
+
requiresSourceCandidateState: options.requiresSourceCandidateState,
|
|
8164
|
+
watch: config.build?.watch
|
|
8165
|
+
});
|
|
8166
|
+
}
|
|
8167
|
+
/**
|
|
8150
8168
|
* Generic Web 生产构建的 CSS 已在 Vite transform 阶段生成时,不需要再建立面向小程序的完整产物快照。
|
|
8151
8169
|
*/
|
|
8152
8170
|
function shouldUseGenericWebProductionFastPath(options) {
|
|
8153
|
-
return options
|
|
8171
|
+
return shouldSkipGenericWebProductionSourceCandidates(options) && options.hasProcessedCss;
|
|
8154
8172
|
}
|
|
8155
8173
|
/**
|
|
8156
8174
|
* Finalizer fast path 只处理无小程序结构语义的 Generic Web 生产产物。
|
|
@@ -9717,7 +9735,7 @@ function sameStringList(first, second) {
|
|
|
9717
9735
|
}
|
|
9718
9736
|
//#endregion
|
|
9719
9737
|
//#region src/bundlers/vite/shared/framework-source-candidates-plugin.ts
|
|
9720
|
-
function createFrameworkSourceCandidatesPlugin(options) {
|
|
9738
|
+
function createFrameworkSourceCandidatesPlugin(options, apply) {
|
|
9721
9739
|
const hasDifferentHotModules = (left, right) => left.length !== right.length || left.some((mod, index) => mod !== right[index]);
|
|
9722
9740
|
const hasTemplateHotSourceModule = (modules) => modules.some((mod) => {
|
|
9723
9741
|
const request = mod.url ?? mod.id;
|
|
@@ -9748,6 +9766,7 @@ function createFrameworkSourceCandidatesPlugin(options) {
|
|
|
9748
9766
|
};
|
|
9749
9767
|
return {
|
|
9750
9768
|
name: `${require_context.vitePluginName}:source-candidates`,
|
|
9769
|
+
apply,
|
|
9751
9770
|
enforce: "pre",
|
|
9752
9771
|
async load(id) {
|
|
9753
9772
|
if (!options.shouldOwnTailwindGeneration || options.isWebOrNativeAppPlatform(options.resolveViteStylePlatform()) || !isCSSRequest(id) || !shouldCollectTransformedSourceCandidates(id)) return;
|
|
@@ -10885,7 +10904,11 @@ ${tracedCss}`;
|
|
|
10885
10904
|
tailwindRootCssModuleIds,
|
|
10886
10905
|
transformEarlyMiniProgramCss,
|
|
10887
10906
|
viteProcessedCssSourceFiles: processedCssRegistry.sourceFiles
|
|
10888
|
-
}
|
|
10907
|
+
}, createGenericWebProductionSourceCandidatesApply({
|
|
10908
|
+
frameworkName: frameworkBranch.frameworkName,
|
|
10909
|
+
getIsWebGeneratorTarget: () => resolveCurrentGeneratorBranch().isWeb,
|
|
10910
|
+
requiresSourceCandidateState: require_v4_generation_core.isCssSourceTraceEnabled(opts)
|
|
10911
|
+
}));
|
|
10889
10912
|
const postPlugin = createFrameworkPostPlugin({
|
|
10890
10913
|
api: { registerProcessedCssAsset(entry) {
|
|
10891
10914
|
markViteProcessedCssSource(entry.sourceFile);
|
package/dist/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vite = require("./vite-
|
|
2
|
+
const require_vite = require("./vite-DMX5zoID.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-DJkhb8n1.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -5,10 +5,10 @@ Object.defineProperties(exports, {
|
|
|
5
5
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
6
6
|
const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
7
7
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
8
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
8
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
9
9
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
10
10
|
const require_css_imports = require("./css-imports-BFMU7Hpd.cjs");
|
|
11
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
11
|
+
const require_pipeline_helpers = require("./pipeline-helpers-CyVXL3h6.cjs");
|
|
12
12
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
13
13
|
const require_watch_dependencies = require("./watch-dependencies-DLZDrWdH.cjs");
|
|
14
14
|
let node_path = require("node:path");
|
|
@@ -3,14 +3,14 @@ const require_generator = require("./generator-DKiYbTFR.cjs");
|
|
|
3
3
|
const require_object = require("./object-DbHtAXRk.cjs");
|
|
4
4
|
const require_options = require("./options-BJrtIQbH.cjs");
|
|
5
5
|
const require_utils = require("./utils-CuKLf1Zv.cjs");
|
|
6
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
7
|
-
const require_wxml = require("./wxml-
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
9
|
-
const require_context = require("./context-
|
|
6
|
+
const require_v4_generation_core = require("./v4-generation-core-Dhsu9Deu.cjs");
|
|
7
|
+
const require_wxml = require("./wxml-PrK-8ARX.cjs");
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-Cvh5UgnM.cjs");
|
|
9
|
+
const require_context = require("./context-DTLRADfE.cjs");
|
|
10
10
|
const require_tailwindcss = require("./tailwindcss-CexDJBhx.cjs");
|
|
11
11
|
const require_style_options = require("./style-options-DW30H5PV.cjs");
|
|
12
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
13
|
-
const require_pipeline_helpers = require("./pipeline-helpers-
|
|
12
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-BNt7NrrI.cjs");
|
|
13
|
+
const require_pipeline_helpers = require("./pipeline-helpers-CyVXL3h6.cjs");
|
|
14
14
|
const require_css_loader_runtime = require("./css-loader-runtime-CSv0lKqV.cjs");
|
|
15
15
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
16
16
|
let node_fs = require("node:fs");
|
|
@@ -2497,7 +2497,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2497
2497
|
});
|
|
2498
2498
|
}
|
|
2499
2499
|
//#endregion
|
|
2500
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.
|
|
2500
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.21.2_tsx@4.23_4ea9b490ca7666240853ecf36690c5e2/node_modules/tsdown/esm-shims.js
|
|
2501
2501
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
2502
2502
|
const getDirname = () => path.dirname(getFilename());
|
|
2503
2503
|
const __dirname = /* @__PURE__ */ getDirname();
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_webpack = require("./webpack-
|
|
2
|
+
const require_webpack = require("./webpack-Cpy_yggg.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_webpack.WeappTailwindcss;
|
|
5
5
|
exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
|
package/dist/webpack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-CzhrD9p3.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
|
@@ -35772,7 +35772,7 @@ function babelParse(code, opts = {}) {
|
|
|
35772
35772
|
return result;
|
|
35773
35773
|
}
|
|
35774
35774
|
//#endregion
|
|
35775
|
-
//#region ../../node_modules/.pnpm/magic-string@1.
|
|
35775
|
+
//#region ../../node_modules/.pnpm/magic-string@1.2.2/node_modules/magic-string/dist/index.mjs
|
|
35776
35776
|
var BitSet = class BitSet {
|
|
35777
35777
|
constructor(arg) {
|
|
35778
35778
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -35910,12 +35910,24 @@ var Chunk = class Chunk {
|
|
|
35910
35910
|
}
|
|
35911
35911
|
}
|
|
35912
35912
|
};
|
|
35913
|
+
/**
|
|
35914
|
+
* The single error type thrown by MagicString.
|
|
35915
|
+
*
|
|
35916
|
+
* Every message is prefixed with `[MagicString]` so its source is obvious at a
|
|
35917
|
+
* glance, and is kept short and consistent in tone.
|
|
35918
|
+
*/
|
|
35919
|
+
var MagicStringError = class extends Error {
|
|
35920
|
+
constructor(message, options) {
|
|
35921
|
+
super(`[MagicString] ${message}`, options);
|
|
35922
|
+
require_object._defineProperty(this, "name", "MagicStringError");
|
|
35923
|
+
}
|
|
35924
|
+
};
|
|
35913
35925
|
function getBtoa() {
|
|
35914
35926
|
if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
35915
35927
|
const buffer = globalThis["Buffer"];
|
|
35916
35928
|
if (buffer) return (str) => buffer.from(str, "utf-8").toString("base64");
|
|
35917
35929
|
return () => {
|
|
35918
|
-
throw new
|
|
35930
|
+
throw new MagicStringError("unsupported environment: `btoa` or `Buffer` is required");
|
|
35919
35931
|
};
|
|
35920
35932
|
}
|
|
35921
35933
|
const btoa = /* #__PURE__ */ getBtoa();
|
|
@@ -36132,11 +36144,11 @@ var MagicString = class MagicString {
|
|
|
36132
36144
|
},
|
|
36133
36145
|
byStart: {
|
|
36134
36146
|
writable: true,
|
|
36135
|
-
value:
|
|
36147
|
+
value: /* @__PURE__ */ new Map([[0, chunk]])
|
|
36136
36148
|
},
|
|
36137
36149
|
byEnd: {
|
|
36138
36150
|
writable: true,
|
|
36139
|
-
value:
|
|
36151
|
+
value: /* @__PURE__ */ new Map([[string.length, chunk]])
|
|
36140
36152
|
},
|
|
36141
36153
|
filename: {
|
|
36142
36154
|
writable: true,
|
|
@@ -36165,10 +36177,12 @@ var MagicString = class MagicString {
|
|
|
36165
36177
|
offset: {
|
|
36166
36178
|
writable: true,
|
|
36167
36179
|
value: options.offset || 0
|
|
36180
|
+
},
|
|
36181
|
+
hasMovedChunks: {
|
|
36182
|
+
writable: true,
|
|
36183
|
+
value: false
|
|
36168
36184
|
}
|
|
36169
36185
|
});
|
|
36170
|
-
this.byStart = /* @__PURE__ */ new Map([[0, chunk]]);
|
|
36171
|
-
this.byEnd = /* @__PURE__ */ new Map([[string.length, chunk]]);
|
|
36172
36186
|
}
|
|
36173
36187
|
/**
|
|
36174
36188
|
* Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.
|
|
@@ -36180,7 +36194,7 @@ var MagicString = class MagicString {
|
|
|
36180
36194
|
* Appends the specified content to the end of the string.
|
|
36181
36195
|
*/
|
|
36182
36196
|
append(content) {
|
|
36183
|
-
if (typeof content !== "string") throw new
|
|
36197
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36184
36198
|
this.outro += content;
|
|
36185
36199
|
return this;
|
|
36186
36200
|
}
|
|
@@ -36191,7 +36205,7 @@ var MagicString = class MagicString {
|
|
|
36191
36205
|
*/
|
|
36192
36206
|
appendLeft(index, content) {
|
|
36193
36207
|
index = index + this.offset;
|
|
36194
|
-
if (typeof content !== "string") throw new
|
|
36208
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36195
36209
|
this._split(index);
|
|
36196
36210
|
const chunk = this.byEnd.get(index);
|
|
36197
36211
|
if (chunk) chunk.appendLeft(content);
|
|
@@ -36205,7 +36219,7 @@ var MagicString = class MagicString {
|
|
|
36205
36219
|
*/
|
|
36206
36220
|
appendRight(index, content) {
|
|
36207
36221
|
index = index + this.offset;
|
|
36208
|
-
if (typeof content !== "string") throw new
|
|
36222
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36209
36223
|
this._split(index);
|
|
36210
36224
|
const chunk = this.byStart.get(index);
|
|
36211
36225
|
if (chunk) chunk.appendRight(content);
|
|
@@ -36218,6 +36232,7 @@ var MagicString = class MagicString {
|
|
|
36218
36232
|
clone() {
|
|
36219
36233
|
const cloned = new MagicString(this.original, {
|
|
36220
36234
|
filename: this.filename,
|
|
36235
|
+
ignoreList: this.ignoreList,
|
|
36221
36236
|
offset: this.offset
|
|
36222
36237
|
});
|
|
36223
36238
|
let originalChunk = this.firstChunk;
|
|
@@ -36237,8 +36252,10 @@ var MagicString = class MagicString {
|
|
|
36237
36252
|
cloned.lastChunk = clonedChunk;
|
|
36238
36253
|
if (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
|
|
36239
36254
|
cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
|
|
36255
|
+
cloned.storedNames = { ...this.storedNames };
|
|
36240
36256
|
cloned.intro = this.intro;
|
|
36241
36257
|
cloned.outro = this.outro;
|
|
36258
|
+
cloned.hasMovedChunks = this.hasMovedChunks;
|
|
36242
36259
|
return cloned;
|
|
36243
36260
|
}
|
|
36244
36261
|
/**
|
|
@@ -36367,7 +36384,7 @@ var MagicString = class MagicString {
|
|
|
36367
36384
|
}
|
|
36368
36385
|
/** @internal */
|
|
36369
36386
|
insert() {
|
|
36370
|
-
throw new
|
|
36387
|
+
throw new MagicStringError("insert() is deprecated, use appendLeft() or prependRight()");
|
|
36371
36388
|
}
|
|
36372
36389
|
/** @internal */
|
|
36373
36390
|
insertLeft(index, content) {
|
|
@@ -36393,12 +36410,19 @@ var MagicString = class MagicString {
|
|
|
36393
36410
|
end = end + this.offset;
|
|
36394
36411
|
index = index + this.offset;
|
|
36395
36412
|
if (start === end) return this;
|
|
36396
|
-
if (index >= start && index <= end) throw new
|
|
36413
|
+
if (index >= start && index <= end) throw new MagicStringError("cannot move a selection inside itself");
|
|
36397
36414
|
this._split(start);
|
|
36398
36415
|
this._split(end);
|
|
36399
36416
|
this._split(index);
|
|
36400
36417
|
const first = this.byStart.get(start);
|
|
36401
36418
|
const last = this.byEnd.get(end);
|
|
36419
|
+
if (this.hasMovedChunks) {
|
|
36420
|
+
let cursor = first;
|
|
36421
|
+
while (cursor !== last) {
|
|
36422
|
+
cursor = cursor.next;
|
|
36423
|
+
if (!cursor || cursor.start < start || cursor.end > end) throw new MagicStringError(`cannot move ${start} to ${end} because an earlier move split that range`);
|
|
36424
|
+
}
|
|
36425
|
+
}
|
|
36402
36426
|
const oldLeft = first.previous;
|
|
36403
36427
|
const oldRight = last.next;
|
|
36404
36428
|
const newRight = this.byStart.get(index);
|
|
@@ -36417,6 +36441,7 @@ var MagicString = class MagicString {
|
|
|
36417
36441
|
last.next = newRight || null;
|
|
36418
36442
|
if (!newLeft) this.firstChunk = first;
|
|
36419
36443
|
if (!newRight) this.lastChunk = last;
|
|
36444
|
+
this.hasMovedChunks = true;
|
|
36420
36445
|
return this;
|
|
36421
36446
|
}
|
|
36422
36447
|
/**
|
|
@@ -36446,13 +36471,15 @@ var MagicString = class MagicString {
|
|
|
36446
36471
|
update(start, end, content, options) {
|
|
36447
36472
|
start = start + this.offset;
|
|
36448
36473
|
end = end + this.offset;
|
|
36449
|
-
if (typeof content !== "string") throw new
|
|
36474
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36450
36475
|
if (this.original.length !== 0) {
|
|
36451
36476
|
while (start < 0) start += this.original.length;
|
|
36452
36477
|
while (end < 0) end += this.original.length;
|
|
36453
36478
|
}
|
|
36454
|
-
if (
|
|
36455
|
-
if (
|
|
36479
|
+
if (start < 0) throw new MagicStringError(`start ${start} is out of bounds`);
|
|
36480
|
+
if (end > this.original.length) throw new MagicStringError(`end ${end} is out of bounds`);
|
|
36481
|
+
if (start === end) throw new MagicStringError(`cannot overwrite a zero-length range at ${start}, use appendLeft() or prependRight()`);
|
|
36482
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
36456
36483
|
this._split(start);
|
|
36457
36484
|
this._split(end);
|
|
36458
36485
|
if (options === true) {
|
|
@@ -36478,7 +36505,7 @@ var MagicString = class MagicString {
|
|
|
36478
36505
|
if (first) {
|
|
36479
36506
|
let chunk = first;
|
|
36480
36507
|
while (chunk !== last) {
|
|
36481
|
-
if (chunk.next !== this.byStart.get(chunk.end)) throw new
|
|
36508
|
+
if (chunk.next !== this.byStart.get(chunk.end)) throw new MagicStringError("cannot overwrite across a split point");
|
|
36482
36509
|
chunk = chunk.next;
|
|
36483
36510
|
chunk.edit("", false);
|
|
36484
36511
|
}
|
|
@@ -36494,7 +36521,7 @@ var MagicString = class MagicString {
|
|
|
36494
36521
|
* Prepends the string with the specified content.
|
|
36495
36522
|
*/
|
|
36496
36523
|
prepend(content) {
|
|
36497
|
-
if (typeof content !== "string") throw new
|
|
36524
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36498
36525
|
this.intro = content + this.intro;
|
|
36499
36526
|
return this;
|
|
36500
36527
|
}
|
|
@@ -36503,7 +36530,7 @@ var MagicString = class MagicString {
|
|
|
36503
36530
|
*/
|
|
36504
36531
|
prependLeft(index, content) {
|
|
36505
36532
|
index = index + this.offset;
|
|
36506
|
-
if (typeof content !== "string") throw new
|
|
36533
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36507
36534
|
this._split(index);
|
|
36508
36535
|
const chunk = this.byEnd.get(index);
|
|
36509
36536
|
if (chunk) chunk.prependLeft(content);
|
|
@@ -36515,7 +36542,7 @@ var MagicString = class MagicString {
|
|
|
36515
36542
|
*/
|
|
36516
36543
|
prependRight(index, content) {
|
|
36517
36544
|
index = index + this.offset;
|
|
36518
|
-
if (typeof content !== "string") throw new
|
|
36545
|
+
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
36519
36546
|
this._split(index);
|
|
36520
36547
|
const chunk = this.byStart.get(index);
|
|
36521
36548
|
if (chunk) chunk.prependRight(content);
|
|
@@ -36534,8 +36561,8 @@ var MagicString = class MagicString {
|
|
|
36534
36561
|
while (end < 0) end += this.original.length;
|
|
36535
36562
|
}
|
|
36536
36563
|
if (start === end) return this;
|
|
36537
|
-
if (start < 0 || end > this.original.length) throw new
|
|
36538
|
-
if (start > end) throw new
|
|
36564
|
+
if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
|
|
36565
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
36539
36566
|
this._split(start);
|
|
36540
36567
|
this._split(end);
|
|
36541
36568
|
let chunk = this.byStart.get(start);
|
|
@@ -36558,8 +36585,8 @@ var MagicString = class MagicString {
|
|
|
36558
36585
|
while (end < 0) end += this.original.length;
|
|
36559
36586
|
}
|
|
36560
36587
|
if (start === end) return this;
|
|
36561
|
-
if (start < 0 || end > this.original.length) throw new
|
|
36562
|
-
if (start > end) throw new
|
|
36588
|
+
if (start < 0 || end > this.original.length) throw new MagicStringError(`range ${start}–${end} is out of bounds`);
|
|
36589
|
+
if (start > end) throw new MagicStringError(`end must be greater than start (start: ${start}, end: ${end})`);
|
|
36563
36590
|
this._split(start);
|
|
36564
36591
|
this._split(end);
|
|
36565
36592
|
let chunk = this.byStart.get(start);
|
|
@@ -36625,12 +36652,12 @@ var MagicString = class MagicString {
|
|
|
36625
36652
|
if (chunk.start < end && chunk.end >= end) return result;
|
|
36626
36653
|
chunk = chunk.next;
|
|
36627
36654
|
}
|
|
36628
|
-
if (chunk && chunk.edited && chunk.start !== start) throw new
|
|
36655
|
+
if (chunk && chunk.edited && chunk.start !== start) throw new MagicStringError(`cannot use edited character ${start} as slice start anchor`);
|
|
36629
36656
|
const startChunk = chunk;
|
|
36630
36657
|
while (chunk) {
|
|
36631
36658
|
if (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro;
|
|
36632
36659
|
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
36633
|
-
if (containsEnd && chunk.edited && chunk.end !== end) throw new
|
|
36660
|
+
if (containsEnd && chunk.edited && chunk.end !== end) throw new MagicStringError(`cannot use edited character ${end} as slice end anchor`);
|
|
36634
36661
|
const sliceStart = startChunk === chunk ? start - chunk.start : 0;
|
|
36635
36662
|
const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
36636
36663
|
result += chunk.content.slice(sliceStart, sliceEnd);
|
|
@@ -36666,7 +36693,7 @@ var MagicString = class MagicString {
|
|
|
36666
36693
|
_splitChunk(chunk, index) {
|
|
36667
36694
|
if (chunk.edited && chunk.content.length) {
|
|
36668
36695
|
const loc = getLocator(this.original)(index);
|
|
36669
|
-
throw new
|
|
36696
|
+
throw new MagicStringError(`cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
|
|
36670
36697
|
}
|
|
36671
36698
|
const newChunk = chunk.split(index);
|
|
36672
36699
|
this.byEnd.set(index, chunk);
|
|
@@ -36778,7 +36805,19 @@ var MagicString = class MagicString {
|
|
|
36778
36805
|
* Indicates if the string has been changed.
|
|
36779
36806
|
*/
|
|
36780
36807
|
hasChanged() {
|
|
36781
|
-
|
|
36808
|
+
if (this.intro || this.outro) return true;
|
|
36809
|
+
let outputIndex = 0;
|
|
36810
|
+
let chunk = this.firstChunk;
|
|
36811
|
+
while (chunk) {
|
|
36812
|
+
if (chunk.intro || chunk.outro) return true;
|
|
36813
|
+
if (!chunk.edited && chunk.start === outputIndex) outputIndex = chunk.end;
|
|
36814
|
+
else {
|
|
36815
|
+
if (!this.original.startsWith(chunk.content, outputIndex)) return true;
|
|
36816
|
+
outputIndex += chunk.content.length;
|
|
36817
|
+
}
|
|
36818
|
+
chunk = chunk.next;
|
|
36819
|
+
}
|
|
36820
|
+
return outputIndex !== this.original.length;
|
|
36782
36821
|
}
|
|
36783
36822
|
/** @internal */
|
|
36784
36823
|
_replaceRegexp(searchValue, replacement) {
|
|
@@ -36848,7 +36887,7 @@ var MagicString = class MagicString {
|
|
|
36848
36887
|
*/
|
|
36849
36888
|
replaceAll(searchValue, replacement) {
|
|
36850
36889
|
if (typeof searchValue === "string") return this._replaceAllString(searchValue, replacement);
|
|
36851
|
-
if (!searchValue.global) throw new
|
|
36890
|
+
if (!searchValue.global) throw new MagicStringError("replaceAll() requires a global RegExp");
|
|
36852
36891
|
return this._replaceRegexp(searchValue, replacement);
|
|
36853
36892
|
}
|
|
36854
36893
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.3.
|
|
4
|
+
"version": "5.3.6",
|
|
5
5
|
"description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -205,18 +205,18 @@
|
|
|
205
205
|
"lightningcss": "^1.33.0",
|
|
206
206
|
"local-pkg": "^1.2.1",
|
|
207
207
|
"lru-cache": "11.5.2",
|
|
208
|
-
"magic-string": "^1.
|
|
208
|
+
"magic-string": "^1.2.2",
|
|
209
209
|
"micromatch": "^4.0.8",
|
|
210
|
-
"oxc-parser": "^0.
|
|
210
|
+
"oxc-parser": "^0.146.0",
|
|
211
211
|
"oxc-walker": "^1.1.1",
|
|
212
212
|
"semver": "~7.8.5",
|
|
213
213
|
"yaml": "^2.9.0",
|
|
214
214
|
"@weapp-tailwindcss/logger": "2.0.2",
|
|
215
|
-
"@weapp-tailwindcss/
|
|
215
|
+
"@weapp-tailwindcss/reset": "0.1.3",
|
|
216
216
|
"@weapp-tailwindcss/shared": "2.0.2",
|
|
217
217
|
"tailwindcss-config": "2.0.3",
|
|
218
|
-
"weapp-
|
|
219
|
-
"
|
|
218
|
+
"@weapp-tailwindcss/postcss": "3.2.11",
|
|
219
|
+
"weapp-style-injector": "1.0.3"
|
|
220
220
|
},
|
|
221
221
|
"devDependencies": {
|
|
222
222
|
"@mpxjs/webpack-plugin": "^2.11.1",
|