weapp-tailwindcss 5.1.9 → 5.1.11
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/shared/generator-css/generation-helpers.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/types.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +1 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +7 -2
- package/dist/bundlers/vite/web-css-compat.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +3 -0
- package/dist/cli.js +3 -2
- package/dist/cli.mjs +2 -1
- package/dist/{context-CfXr3hWz.mjs → context-DzkSFEVL.mjs} +4 -4
- package/dist/{context-CRhUs_5e.js → context-y2BGCok4.js} +10 -10
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/generator/options.d.ts +8 -1
- package/dist/{v4-engine-BZP2462H.js → generator-Bz94KTkH.js} +229 -17
- package/dist/{v4-engine-CjjWONB0.mjs → generator-ROzBodj6.mjs} +185 -9
- package/dist/generator.js +7 -8
- package/dist/generator.mjs +1 -2
- package/dist/{gulp-CRjkPsbX.mjs → gulp-BKqMb_Ds.mjs} +4 -4
- package/dist/{gulp-JUfnhOOo.js → gulp-DfOLvYLs.js} +10 -10
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DcIEXnf8.js → hmr-timing-DOTdH18A.js} +556 -170
- package/dist/{hmr-timing-BecOXMd8.mjs → hmr-timing-DwtYJdwb.mjs} +430 -56
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +2 -3
- package/dist/postcss.mjs +1 -2
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +5 -4
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-10tvdJVC.js → source-candidate-scan-signature-BrWuBTjY.js} +34 -6
- package/dist/{source-candidate-scan-signature-DAg8QSgh.mjs → source-candidate-scan-signature-CQ04hiox.mjs} +29 -7
- package/dist/{tailwindcss-BZjZZi60.js → tailwindcss-Dn5DVlkI.js} +55 -47
- package/dist/{tailwindcss-PA2jHHpx.mjs → tailwindcss-hzy_WaC9.mjs} +14 -6
- package/dist/{transform-wNEbcZeQ.mjs → transform-BgnNYkIG.mjs} +1 -1
- package/dist/{transform-B0BxX3XB.js → transform-DZQETx51.js} +1 -1
- package/dist/{vite-CHk7V9EA.js → vite-DODC15Fr.js} +865 -254
- package/dist/{vite-ClpyoD9e.mjs → vite-oI2ReOic.mjs} +818 -207
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +613 -63
- package/dist/{webpack-2s-TFhgm.mjs → webpack-CCapGlNg.mjs} +235 -38
- package/dist/{webpack-BhM4Hqla.js → webpack-XxBCIrBp.js} +276 -79
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +5 -5
- package/dist/generator-DaaFxR5V.js +0 -174
- package/dist/generator-DugIHBgl.mjs +0 -127
package/dist/webpack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_webpack = require("./webpack-
|
|
2
|
+
const require_webpack = require("./webpack-XxBCIrBp.js");
|
|
3
3
|
exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_webpack.WeappTailwindcss;
|
|
5
5
|
exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
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-CCapGlNg.mjs";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"@babel/parser": "~7.29.7",
|
|
192
192
|
"@babel/traverse": "~7.29.7",
|
|
193
193
|
"@babel/types": "~7.29.7",
|
|
194
|
-
"@tailwindcss-mangle/engine": "0.1.
|
|
194
|
+
"@tailwindcss-mangle/engine": "0.1.3",
|
|
195
195
|
"@vue/compiler-dom": "^3.5.39",
|
|
196
196
|
"@weapp-core/escape": "~8.0.0",
|
|
197
197
|
"comment-json": "^5.0.0",
|
|
@@ -204,8 +204,8 @@
|
|
|
204
204
|
"semver": "~7.8.5",
|
|
205
205
|
"yaml": "^2.9.0",
|
|
206
206
|
"@weapp-tailwindcss/logger": "2.0.0",
|
|
207
|
-
"@weapp-tailwindcss/postcss": "3.1.8",
|
|
208
207
|
"@weapp-tailwindcss/reset": "0.1.1",
|
|
208
|
+
"@weapp-tailwindcss/postcss": "3.1.9",
|
|
209
209
|
"@weapp-tailwindcss/shared": "2.0.0",
|
|
210
210
|
"tailwindcss-config": "2.0.1",
|
|
211
211
|
"weapp-style-injector": "1.0.1"
|
|
@@ -215,8 +215,8 @@
|
|
|
215
215
|
},
|
|
216
216
|
"scripts": {
|
|
217
217
|
"dev": "tsdown --watch --sourcemap",
|
|
218
|
-
"build": "tsdown &&
|
|
219
|
-
"build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false &&
|
|
218
|
+
"build": "tsdown && tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false && tsx ../../tools/weapp-tailwindcss-scripts/src/rewrite-dts-aliases.ts && tsx ../../tools/weapp-tailwindcss-scripts/src/create-entry-dts.ts && tsx ../../tools/weapp-tailwindcss-scripts/src/ensure-escape-dts.ts",
|
|
219
|
+
"build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist --noEmit false && tsx ../../tools/weapp-tailwindcss-scripts/src/rewrite-dts-aliases.ts && tsx ../../tools/weapp-tailwindcss-scripts/src/create-entry-dts.ts",
|
|
220
220
|
"build:tsc": "cross-env NODE_ENV=development tsc --build tsconfig.json",
|
|
221
221
|
"build:cli": "cd plugins/cli && pnpm run build",
|
|
222
222
|
"build:css": "pnpm --filter @weapp-tailwindcss/scripts build:css",
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
const require_v4_engine = require("./v4-engine-BZP2462H.js");
|
|
2
|
-
const require_utils = require("./utils-D3h8j7Mk.js");
|
|
3
|
-
//#region src/runtime-branch/create-branch.ts
|
|
4
|
-
function createRuntimeBranch(base, platformFamily, options) {
|
|
5
|
-
const { context, tailwindcssVersion } = base;
|
|
6
|
-
return {
|
|
7
|
-
tailwindcssVersion,
|
|
8
|
-
generatorTarget: context.generatorTarget,
|
|
9
|
-
platformFamily,
|
|
10
|
-
platform: options.platform,
|
|
11
|
-
nativeAppPlatform: options.nativeAppPlatform,
|
|
12
|
-
isTailwindV4: tailwindcssVersion === 4,
|
|
13
|
-
isWeb: platformFamily === "web",
|
|
14
|
-
isMiniProgram: platformFamily === "mini-program",
|
|
15
|
-
isNativeApp: platformFamily === "native-app"
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/runtime-branch/mini-program.ts
|
|
20
|
-
function createMiniProgramRuntimeBranch(base) {
|
|
21
|
-
const { context, uniUtsPlatform } = base;
|
|
22
|
-
return createRuntimeBranch(base, "mini-program", { platform: typeof context.platform === "string" && context.platform.length > 0 ? context.platform : uniUtsPlatform.isMp ? uniUtsPlatform.normalized : context.platform });
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/runtime-branch/platform.ts
|
|
26
|
-
function isRuntimeUniAppXEnabled(value) {
|
|
27
|
-
return value === true || typeof value === "object" && value?.enabled !== false;
|
|
28
|
-
}
|
|
29
|
-
function normalizeRuntimeUniUtsPlatform(value) {
|
|
30
|
-
return typeof value === "object" && value !== null ? value : require_utils.resolveUniUtsPlatform(value);
|
|
31
|
-
}
|
|
32
|
-
function resolveNativeAppPlatform(platform) {
|
|
33
|
-
if (platform.isAppAndroid) return "android";
|
|
34
|
-
if (platform.isAppIos) return "ios";
|
|
35
|
-
if (platform.isAppHarmony) return "harmony";
|
|
36
|
-
return "unknown";
|
|
37
|
-
}
|
|
38
|
-
function resolveExplicitOrEnvPlatform(context, uniUtsPlatform) {
|
|
39
|
-
if (typeof context.platform === "string" && context.platform.length > 0) return context.platform;
|
|
40
|
-
return uniUtsPlatform.normalized;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/runtime-branch/native-app.ts
|
|
44
|
-
function createNativeAppRuntimeBranch(base) {
|
|
45
|
-
return createRuntimeBranch(base, "native-app", {
|
|
46
|
-
platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform),
|
|
47
|
-
nativeAppPlatform: resolveNativeAppPlatform(base.uniUtsPlatform)
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/runtime-branch/tailwind-version.ts
|
|
52
|
-
function resolveTailwindcssBranchVersion(_majorVersion) {
|
|
53
|
-
return 4;
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/runtime-branch/web.ts
|
|
57
|
-
function createWebRuntimeBranch(base) {
|
|
58
|
-
return createRuntimeBranch(base, "web", { platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform) });
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/runtime-branch/index.ts
|
|
62
|
-
function shouldUseNativeAppBranch(base, uniUtsPlatform) {
|
|
63
|
-
return base.appType === "uni-app-x" && isRuntimeUniAppXEnabled(base.uniAppX) && uniUtsPlatform.isApp;
|
|
64
|
-
}
|
|
65
|
-
function resolveRuntimeBranch(context) {
|
|
66
|
-
const uniUtsPlatform = normalizeRuntimeUniUtsPlatform(context.uniUtsPlatform);
|
|
67
|
-
const base = {
|
|
68
|
-
context,
|
|
69
|
-
tailwindcssVersion: resolveTailwindcssBranchVersion(context.tailwindcssMajorVersion),
|
|
70
|
-
uniUtsPlatform
|
|
71
|
-
};
|
|
72
|
-
if (context.generatorTarget === "web") return createWebRuntimeBranch(base);
|
|
73
|
-
if (shouldUseNativeAppBranch(context, uniUtsPlatform)) return createNativeAppRuntimeBranch(base);
|
|
74
|
-
return createMiniProgramRuntimeBranch(base);
|
|
75
|
-
}
|
|
76
|
-
function resolveGeneratorRuntimeBranch(options, context = {}) {
|
|
77
|
-
return options.branch ?? resolveRuntimeBranch({
|
|
78
|
-
...context,
|
|
79
|
-
generatorTarget: options.target
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function shouldUseMiniProgramCssBranch(branch) {
|
|
83
|
-
return branch.platformFamily === "mini-program" || branch.platformFamily === "native-app";
|
|
84
|
-
}
|
|
85
|
-
function shouldUseNativeAppCssBranch(branch) {
|
|
86
|
-
return branch.platformFamily === "native-app";
|
|
87
|
-
}
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/generator/options.ts
|
|
90
|
-
function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
91
|
-
const target = options?.target ?? (require_v4_engine.shouldUseUniAppViteWebViewGeneratorTarget(context.appType, context.platform) ? "web" : require_v4_engine.inferGeneratorTargetFromEnv());
|
|
92
|
-
const branch = resolveRuntimeBranch({
|
|
93
|
-
...context,
|
|
94
|
-
generatorTarget: target
|
|
95
|
-
});
|
|
96
|
-
const hasExplicitTarget = options !== void 0 && Object.hasOwn(options, "target");
|
|
97
|
-
const webCompat = options?.webCompat ?? (!hasExplicitTarget && branch.isWeb ? true : void 0);
|
|
98
|
-
if (options == null) return {
|
|
99
|
-
target,
|
|
100
|
-
branch,
|
|
101
|
-
webCompat,
|
|
102
|
-
importFallback: false,
|
|
103
|
-
bareArbitraryValues: void 0
|
|
104
|
-
};
|
|
105
|
-
return {
|
|
106
|
-
target,
|
|
107
|
-
branch,
|
|
108
|
-
config: options.config,
|
|
109
|
-
styleOptions: options.styleOptions,
|
|
110
|
-
webCompat,
|
|
111
|
-
importFallback: options.importFallback ?? false,
|
|
112
|
-
bareArbitraryValues: options.bareArbitraryValues
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/generator/index.ts
|
|
117
|
-
function createWeappTailwindcssGenerator(source) {
|
|
118
|
-
return require_v4_engine.createTailwindV4Engine(source);
|
|
119
|
-
}
|
|
120
|
-
async function resolveTailwindSourceFromRuntime(tailwindRuntime) {
|
|
121
|
-
return require_v4_engine.resolveTailwindV4SourceFromRuntime(tailwindRuntime);
|
|
122
|
-
}
|
|
123
|
-
async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
124
|
-
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
Object.defineProperty(exports, "createWeappTailwindcssGenerator", {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function() {
|
|
130
|
-
return createWeappTailwindcssGenerator;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
Object.defineProperty(exports, "createWeappTailwindcssGeneratorFromRuntime", {
|
|
134
|
-
enumerable: true,
|
|
135
|
-
get: function() {
|
|
136
|
-
return createWeappTailwindcssGeneratorFromRuntime;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(exports, "normalizeWeappTailwindcssGeneratorOptions", {
|
|
140
|
-
enumerable: true,
|
|
141
|
-
get: function() {
|
|
142
|
-
return normalizeWeappTailwindcssGeneratorOptions;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
Object.defineProperty(exports, "resolveGeneratorRuntimeBranch", {
|
|
146
|
-
enumerable: true,
|
|
147
|
-
get: function() {
|
|
148
|
-
return resolveGeneratorRuntimeBranch;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
Object.defineProperty(exports, "resolveRuntimeBranch", {
|
|
152
|
-
enumerable: true,
|
|
153
|
-
get: function() {
|
|
154
|
-
return resolveRuntimeBranch;
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
Object.defineProperty(exports, "resolveTailwindSourceFromRuntime", {
|
|
158
|
-
enumerable: true,
|
|
159
|
-
get: function() {
|
|
160
|
-
return resolveTailwindSourceFromRuntime;
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
Object.defineProperty(exports, "shouldUseMiniProgramCssBranch", {
|
|
164
|
-
enumerable: true,
|
|
165
|
-
get: function() {
|
|
166
|
-
return shouldUseMiniProgramCssBranch;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
Object.defineProperty(exports, "shouldUseNativeAppCssBranch", {
|
|
170
|
-
enumerable: true,
|
|
171
|
-
get: function() {
|
|
172
|
-
return shouldUseNativeAppCssBranch;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { Dt as inferGeneratorTargetFromEnv, Ot as shouldUseUniAppViteWebViewGeneratorTarget, ct as createTailwindV4Engine, n as resolveTailwindV4SourceFromRuntime } from "./v4-engine-CjjWONB0.mjs";
|
|
2
|
-
import { o as resolveUniUtsPlatform } from "./utils-DodxWHGz.mjs";
|
|
3
|
-
//#region src/runtime-branch/create-branch.ts
|
|
4
|
-
function createRuntimeBranch(base, platformFamily, options) {
|
|
5
|
-
const { context, tailwindcssVersion } = base;
|
|
6
|
-
return {
|
|
7
|
-
tailwindcssVersion,
|
|
8
|
-
generatorTarget: context.generatorTarget,
|
|
9
|
-
platformFamily,
|
|
10
|
-
platform: options.platform,
|
|
11
|
-
nativeAppPlatform: options.nativeAppPlatform,
|
|
12
|
-
isTailwindV4: tailwindcssVersion === 4,
|
|
13
|
-
isWeb: platformFamily === "web",
|
|
14
|
-
isMiniProgram: platformFamily === "mini-program",
|
|
15
|
-
isNativeApp: platformFamily === "native-app"
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/runtime-branch/mini-program.ts
|
|
20
|
-
function createMiniProgramRuntimeBranch(base) {
|
|
21
|
-
const { context, uniUtsPlatform } = base;
|
|
22
|
-
return createRuntimeBranch(base, "mini-program", { platform: typeof context.platform === "string" && context.platform.length > 0 ? context.platform : uniUtsPlatform.isMp ? uniUtsPlatform.normalized : context.platform });
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/runtime-branch/platform.ts
|
|
26
|
-
function isRuntimeUniAppXEnabled(value) {
|
|
27
|
-
return value === true || typeof value === "object" && value?.enabled !== false;
|
|
28
|
-
}
|
|
29
|
-
function normalizeRuntimeUniUtsPlatform(value) {
|
|
30
|
-
return typeof value === "object" && value !== null ? value : resolveUniUtsPlatform(value);
|
|
31
|
-
}
|
|
32
|
-
function resolveNativeAppPlatform(platform) {
|
|
33
|
-
if (platform.isAppAndroid) return "android";
|
|
34
|
-
if (platform.isAppIos) return "ios";
|
|
35
|
-
if (platform.isAppHarmony) return "harmony";
|
|
36
|
-
return "unknown";
|
|
37
|
-
}
|
|
38
|
-
function resolveExplicitOrEnvPlatform(context, uniUtsPlatform) {
|
|
39
|
-
if (typeof context.platform === "string" && context.platform.length > 0) return context.platform;
|
|
40
|
-
return uniUtsPlatform.normalized;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/runtime-branch/native-app.ts
|
|
44
|
-
function createNativeAppRuntimeBranch(base) {
|
|
45
|
-
return createRuntimeBranch(base, "native-app", {
|
|
46
|
-
platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform),
|
|
47
|
-
nativeAppPlatform: resolveNativeAppPlatform(base.uniUtsPlatform)
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/runtime-branch/tailwind-version.ts
|
|
52
|
-
function resolveTailwindcssBranchVersion(_majorVersion) {
|
|
53
|
-
return 4;
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/runtime-branch/web.ts
|
|
57
|
-
function createWebRuntimeBranch(base) {
|
|
58
|
-
return createRuntimeBranch(base, "web", { platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform) });
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/runtime-branch/index.ts
|
|
62
|
-
function shouldUseNativeAppBranch(base, uniUtsPlatform) {
|
|
63
|
-
return base.appType === "uni-app-x" && isRuntimeUniAppXEnabled(base.uniAppX) && uniUtsPlatform.isApp;
|
|
64
|
-
}
|
|
65
|
-
function resolveRuntimeBranch(context) {
|
|
66
|
-
const uniUtsPlatform = normalizeRuntimeUniUtsPlatform(context.uniUtsPlatform);
|
|
67
|
-
const base = {
|
|
68
|
-
context,
|
|
69
|
-
tailwindcssVersion: resolveTailwindcssBranchVersion(context.tailwindcssMajorVersion),
|
|
70
|
-
uniUtsPlatform
|
|
71
|
-
};
|
|
72
|
-
if (context.generatorTarget === "web") return createWebRuntimeBranch(base);
|
|
73
|
-
if (shouldUseNativeAppBranch(context, uniUtsPlatform)) return createNativeAppRuntimeBranch(base);
|
|
74
|
-
return createMiniProgramRuntimeBranch(base);
|
|
75
|
-
}
|
|
76
|
-
function resolveGeneratorRuntimeBranch(options, context = {}) {
|
|
77
|
-
return options.branch ?? resolveRuntimeBranch({
|
|
78
|
-
...context,
|
|
79
|
-
generatorTarget: options.target
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function shouldUseMiniProgramCssBranch(branch) {
|
|
83
|
-
return branch.platformFamily === "mini-program" || branch.platformFamily === "native-app";
|
|
84
|
-
}
|
|
85
|
-
function shouldUseNativeAppCssBranch(branch) {
|
|
86
|
-
return branch.platformFamily === "native-app";
|
|
87
|
-
}
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/generator/options.ts
|
|
90
|
-
function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
91
|
-
const target = options?.target ?? (shouldUseUniAppViteWebViewGeneratorTarget(context.appType, context.platform) ? "web" : inferGeneratorTargetFromEnv());
|
|
92
|
-
const branch = resolveRuntimeBranch({
|
|
93
|
-
...context,
|
|
94
|
-
generatorTarget: target
|
|
95
|
-
});
|
|
96
|
-
const hasExplicitTarget = options !== void 0 && Object.hasOwn(options, "target");
|
|
97
|
-
const webCompat = options?.webCompat ?? (!hasExplicitTarget && branch.isWeb ? true : void 0);
|
|
98
|
-
if (options == null) return {
|
|
99
|
-
target,
|
|
100
|
-
branch,
|
|
101
|
-
webCompat,
|
|
102
|
-
importFallback: false,
|
|
103
|
-
bareArbitraryValues: void 0
|
|
104
|
-
};
|
|
105
|
-
return {
|
|
106
|
-
target,
|
|
107
|
-
branch,
|
|
108
|
-
config: options.config,
|
|
109
|
-
styleOptions: options.styleOptions,
|
|
110
|
-
webCompat,
|
|
111
|
-
importFallback: options.importFallback ?? false,
|
|
112
|
-
bareArbitraryValues: options.bareArbitraryValues
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/generator/index.ts
|
|
117
|
-
function createWeappTailwindcssGenerator(source) {
|
|
118
|
-
return createTailwindV4Engine(source);
|
|
119
|
-
}
|
|
120
|
-
async function resolveTailwindSourceFromRuntime(tailwindRuntime) {
|
|
121
|
-
return resolveTailwindV4SourceFromRuntime(tailwindRuntime);
|
|
122
|
-
}
|
|
123
|
-
async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
124
|
-
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
export { resolveGeneratorRuntimeBranch as a, shouldUseNativeAppCssBranch as c, normalizeWeappTailwindcssGeneratorOptions as i, createWeappTailwindcssGeneratorFromRuntime as n, resolveRuntimeBranch as o, resolveTailwindSourceFromRuntime as r, shouldUseMiniProgramCssBranch as s, createWeappTailwindcssGenerator as t };
|