@dcloudio/uni-cli-shared 3.0.0-5000720260410001 → 3.0.0-5010520260709001
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/constants.d.ts +1 -3
- package/dist/constants.js +2 -6
- package/dist/deps.d.ts +1 -0
- package/dist/deps.js +22 -13
- package/dist/dom2/fontFamily.d.ts +4 -0
- package/dist/dom2/fontFamily.js +21 -0
- package/dist/dom2/index.d.ts +3 -0
- package/dist/dom2/index.js +3 -0
- package/dist/dom2/rootScrollView.d.ts +47 -0
- package/dist/dom2/rootScrollView.js +283 -0
- package/dist/dom2/sharedData.d.ts +4 -0
- package/dist/dom2/sharedData.js +40 -5
- package/dist/dom2/vue.d.ts +16 -0
- package/dist/dom2/vue.js +37 -0
- package/dist/easycom.d.ts +1 -0
- package/dist/easycom.js +23 -9
- package/dist/env/define.d.ts +0 -1
- package/dist/env/define.js +3 -11
- package/dist/hbx/alias.js +64 -10
- package/dist/hbx/log.js +9 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/json/app/manifest/plus.js +9 -1
- package/dist/json/app/pages/definePage.js +3 -1
- package/dist/json/index.d.ts +1 -1
- package/dist/json/index.js +2 -1
- package/dist/json/mp/index.d.ts +2 -0
- package/dist/json/mp/index.js +23 -1
- package/dist/json/mp/jsonFile.d.ts +3 -2
- package/dist/json/mp/jsonFile.js +83 -13
- package/dist/json/mp/pages.d.ts +1 -0
- package/dist/json/mp/pages.js +6 -2
- package/dist/json/mp/subpackage.d.ts +26 -0
- package/dist/json/mp/subpackage.js +236 -0
- package/dist/json/uni-x/index.d.ts +6 -0
- package/dist/json/uni-x/index.js +54 -1
- package/dist/json/uni-x/manifest.d.ts +1 -1
- package/dist/json/uni-x/manifest.js +2 -1
- package/dist/json/utils.js +24 -0
- package/dist/logs/console.js +4 -1
- package/dist/messages/en.d.ts +11 -2
- package/dist/messages/en.js +11 -2
- package/dist/messages/index.d.ts +22 -4
- package/dist/messages/zh_CN.d.ts +11 -2
- package/dist/messages/zh_CN.js +11 -2
- package/dist/mp/style.js +6 -2
- package/dist/mp/usingComponents.d.ts +7 -5
- package/dist/mp/usingComponents.js +63 -34
- package/dist/postcss/plugins/stylePluginExternal.d.ts +9 -10
- package/dist/postcss/plugins/stylePluginExternal.js +51 -45
- package/dist/resolve.d.ts +1 -0
- package/dist/resolve.js +9 -2
- package/dist/uni_modules.cloud.d.ts +7 -1
- package/dist/uni_modules.cloud.js +131 -14
- package/dist/uni_modules.js +3 -2
- package/dist/utils.js +5 -0
- package/dist/uts.d.ts +1 -0
- package/dist/uts.js +90 -6
- package/dist/vite/autoImport.js +7 -4
- package/dist/vite/cloud.js +13 -6
- package/dist/vite/extApi.js +4 -1
- package/dist/vite/plugins/cssScoped.js +11 -2
- package/dist/vite/plugins/easycom.js +3 -1
- package/dist/vite/plugins/inject.js +11 -3
- package/dist/vite/plugins/json.js +2 -69
- package/dist/vite/plugins/jsonJs.js +41 -3
- package/dist/vite/plugins/pre.js +2 -0
- package/dist/vite/plugins/sfc.js +4 -1
- package/dist/vite/plugins/stats.d.ts +5 -1
- package/dist/vite/plugins/stats.js +74 -3
- package/dist/vite/plugins/uts/uni_modules.d.ts +1 -1
- package/dist/vite/plugins/uts/uni_modules.js +30 -12
- package/dist/vite/plugins/vitejs/plugins/asset.js +14 -1
- package/dist/vite/plugins/vitejs/plugins/css.d.ts +2 -2
- package/dist/vite/plugins/vitejs/plugins/css.js +45 -6
- package/dist/vue/transforms/index.d.ts +1 -0
- package/dist/vue/transforms/index.js +2 -1
- package/dist/vue/transforms/transformTeleport.d.ts +2 -0
- package/dist/vue/transforms/transformTeleport.js +68 -0
- package/dist/vue/transforms/x/transformDirection.js +33 -4
- package/dist/workers.d.ts +1 -0
- package/dist/workers.js +12 -5
- package/dist/x.d.ts +11 -0
- package/dist/x.js +43 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.cjs +0 -7
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.mjs +0 -7
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +58 -63
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +58 -63
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +7 -1
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +22 -47
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +12 -23
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +12 -22
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +23 -74
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +5 -5
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +3 -20
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +310 -363
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +5 -5
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +810 -579
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.d.ts +33 -11114
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +1638 -1250
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +1031 -599
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +470 -328
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +1154 -709
- package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +16 -25
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +16 -25
- package/lib/dom2/app/@vue/shared/dist/shared.d.ts +5 -0
- package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +11 -23
- package/package.json +6 -6
|
@@ -16,3 +16,4 @@ export declare const transformTapToClick: import("@vue/compiler-core").NodeTrans
|
|
|
16
16
|
export declare const transformComponentLink: (node: import("@vue/compiler-core").RootNode | import("@vue/compiler-core").TemplateChildNode, context: import("@vue/compiler-core").TransformContext) => void;
|
|
17
17
|
export * from './x/transformMPBuiltInTag';
|
|
18
18
|
export * from './x/transformDirection';
|
|
19
|
+
export * from './transformTeleport';
|
|
@@ -40,7 +40,7 @@ Object.defineProperty(exports, "matchTransformOn", { enumerable: true, get: func
|
|
|
40
40
|
var vModel_1 = require("./vModel");
|
|
41
41
|
Object.defineProperty(exports, "createTransformModel", { enumerable: true, get: function () { return vModel_1.createTransformModel; } });
|
|
42
42
|
Object.defineProperty(exports, "matchTransformModel", { enumerable: true, get: function () { return vModel_1.defaultMatch; } });
|
|
43
|
-
exports.transformH5BuiltInComponents = (0, transformTag_1.createTransformTag)(uni_shared_1.
|
|
43
|
+
exports.transformH5BuiltInComponents = (0, transformTag_1.createTransformTag)(uni_shared_1.H5_BUILT_IN_TAG_NAMES.reduce((tags, tag) => ((tags[tag] = uni_shared_1.COMPONENT_PREFIX + tag), tags), {}));
|
|
44
44
|
exports.transformMatchMedia = (0, transformTag_1.createTransformTag)({
|
|
45
45
|
'match-media': 'uni-match-media',
|
|
46
46
|
});
|
|
@@ -56,3 +56,4 @@ exports.transformTapToClick = (0, transformEvent_1.createTransformEvent)({
|
|
|
56
56
|
exports.transformComponentLink = (0, transformComponent_1.createTransformComponentLink)(constants_1.COMPONENT_BIND_LINK);
|
|
57
57
|
__exportStar(require("./x/transformMPBuiltInTag"), exports);
|
|
58
58
|
__exportStar(require("./x/transformDirection"), exports);
|
|
59
|
+
__exportStar(require("./transformTeleport"), exports);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformTeleport = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const vite_1 = require("../../vite");
|
|
6
|
+
const compiler_core_1 = require("@vue/compiler-core");
|
|
7
|
+
const shared_1 = require("@vue/shared");
|
|
8
|
+
const transformTeleport = function (node) {
|
|
9
|
+
if (!(0, vite_1.isElementNode)(node)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (node.tag !== 'teleport') {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
node.tag = 'root-portal';
|
|
16
|
+
node.tagType = compiler_core_1.ElementTypes.ELEMENT;
|
|
17
|
+
const disabledProp = (0, compiler_core_1.findProp)(node, 'disabled', false, true);
|
|
18
|
+
if (disabledProp) {
|
|
19
|
+
// transform `disabled` prop to `enable` prop with inverse value
|
|
20
|
+
if ((0, vite_1.isAttributeNode)(disabledProp)) {
|
|
21
|
+
const disabledPropIndex = node.props.indexOf(disabledProp);
|
|
22
|
+
node.props.splice(disabledPropIndex, 1, (0, utils_1.createBindDirectiveNode)('enable', (0, compiler_core_1.createSimpleExpression)('false', false)));
|
|
23
|
+
}
|
|
24
|
+
else if ((0, vite_1.isDirectiveNode)(disabledProp)) {
|
|
25
|
+
disabledProp.arg = (0, compiler_core_1.createSimpleExpression)('enable', true);
|
|
26
|
+
disabledProp.exp = createEnableExpression(disabledProp.exp);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const toProp = (0, compiler_core_1.findProp)(node, 'to');
|
|
30
|
+
if (toProp) {
|
|
31
|
+
// delete `to` prop since it is not supported in mini program
|
|
32
|
+
node.props.splice(node.props.indexOf(toProp), 1);
|
|
33
|
+
}
|
|
34
|
+
const deferProp = (0, compiler_core_1.findProp)(node, 'defer', false, true);
|
|
35
|
+
if (deferProp) {
|
|
36
|
+
// delete `defer` prop since it is not supported in mini program
|
|
37
|
+
node.props.splice(node.props.indexOf(deferProp), 1);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.transformTeleport = transformTeleport;
|
|
41
|
+
function createEnableExpression(exp) {
|
|
42
|
+
const content = exp && stringifyExpression(exp);
|
|
43
|
+
return (0, compiler_core_1.createSimpleExpression)(content ? `!(${content})` : 'true', false);
|
|
44
|
+
}
|
|
45
|
+
function stringifyExpression(exp) {
|
|
46
|
+
if ((0, vite_1.isSimpleExpressionNode)(exp)) {
|
|
47
|
+
return exp.content;
|
|
48
|
+
}
|
|
49
|
+
if ((0, vite_1.isCompoundExpressionNode)(exp)) {
|
|
50
|
+
const children = [];
|
|
51
|
+
for (const child of exp.children) {
|
|
52
|
+
if ((0, shared_1.isString)(child)) {
|
|
53
|
+
children.push(child);
|
|
54
|
+
}
|
|
55
|
+
else if ((0, shared_1.isSymbol)(child)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const content = stringifyExpression(child);
|
|
60
|
+
if (content === undefined) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
children.push(content);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return children.join('');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -4,6 +4,7 @@ exports.transformDirection = void 0;
|
|
|
4
4
|
const vite_1 = require("../../../vite");
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const compiler_core_1 = require("@vue/compiler-core");
|
|
7
|
+
const shared_1 = require("@vue/shared");
|
|
7
8
|
/**
|
|
8
9
|
* 将direction属性转化为scroll-x和scroll-y
|
|
9
10
|
* 注意transformMPBuiltInTag内会讲list-view转化为scroll-view,所以此transform应该在transformMPBuiltInTag之后执行
|
|
@@ -27,7 +28,7 @@ const transformDirection = function (node, context) {
|
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
const directionProp = node.props[directionPropIndex];
|
|
30
|
-
if (
|
|
31
|
+
if ((0, vite_1.isAttributeNode)(directionProp)) {
|
|
31
32
|
const directionValue = directionProp.value?.content;
|
|
32
33
|
const scrollX = directionValue === 'horizontal' || directionValue === 'all';
|
|
33
34
|
const scrollY = !directionValue ||
|
|
@@ -39,12 +40,16 @@ const transformDirection = function (node, context) {
|
|
|
39
40
|
}
|
|
40
41
|
else if (directionProp.type === compiler_core_1.NodeTypes.DIRECTIVE) {
|
|
41
42
|
if (!directionProp.arg ||
|
|
42
|
-
directionProp.arg
|
|
43
|
+
!(0, vite_1.isSimpleExpressionNode)(directionProp.arg) ||
|
|
43
44
|
!directionProp.exp ||
|
|
44
|
-
directionProp.exp
|
|
45
|
+
!((0, vite_1.isSimpleExpressionNode)(directionProp.exp) ||
|
|
46
|
+
(0, vite_1.isCompoundExpressionNode)(directionProp.exp))) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const exp = stringifyExpression(directionProp.exp);
|
|
50
|
+
if (!exp) {
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
47
|
-
const exp = directionProp.exp.content;
|
|
48
53
|
const scrollX = `(${exp}) === 'horizontal' || (${exp}) === 'all'`;
|
|
49
54
|
const scrollY = `!(${exp}) || (${exp}) === 'vertical' || (${exp}) === 'all'`;
|
|
50
55
|
node.props.splice(directionPropIndex, 1);
|
|
@@ -53,3 +58,27 @@ const transformDirection = function (node, context) {
|
|
|
53
58
|
}
|
|
54
59
|
};
|
|
55
60
|
exports.transformDirection = transformDirection;
|
|
61
|
+
function stringifyExpression(exp) {
|
|
62
|
+
if ((0, vite_1.isSimpleExpressionNode)(exp)) {
|
|
63
|
+
return exp.content;
|
|
64
|
+
}
|
|
65
|
+
if ((0, vite_1.isCompoundExpressionNode)(exp)) {
|
|
66
|
+
const children = [];
|
|
67
|
+
for (const child of exp.children) {
|
|
68
|
+
if ((0, shared_1.isString)(child)) {
|
|
69
|
+
children.push(child);
|
|
70
|
+
}
|
|
71
|
+
else if ((0, shared_1.isSymbol)(child)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const content = stringifyExpression(child);
|
|
76
|
+
if (content === undefined) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
children.push(content);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return children.join('');
|
|
83
|
+
}
|
|
84
|
+
}
|
package/dist/workers.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export declare function getWorkersRootDirs(): string[];
|
|
|
11
11
|
export declare function initWorkers(workersDirs: string[], rootDir: string): Record<string, string>;
|
|
12
12
|
export declare function uniWorkersPlugin(): Plugin;
|
|
13
13
|
export declare function resolveWorkersDir(inputDir: string): Array<string>;
|
|
14
|
+
export declare function normalizeJavaScriptWorkerSource(content: string): string;
|
|
14
15
|
export declare function uniJavaScriptWorkersPlugin(): Plugin;
|
|
15
16
|
export declare function initUniXCompilerRootWorkers(rootDir: string, compiler: UniXCompiler): Promise<void>;
|
package/dist/workers.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.initUniXCompilerRootWorkers = exports.uniJavaScriptWorkersPlugin = exports.resolveWorkersDir = exports.uniWorkersPlugin = exports.initWorkers = exports.getWorkersRootDirs = exports.resolveWorkersRootDir = exports.getWorkers = void 0;
|
|
6
|
+
exports.initUniXCompilerRootWorkers = exports.uniJavaScriptWorkersPlugin = exports.normalizeJavaScriptWorkerSource = exports.resolveWorkersDir = exports.uniWorkersPlugin = exports.initWorkers = exports.getWorkersRootDirs = exports.resolveWorkersRootDir = exports.getWorkers = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const debug_1 = __importDefault(require("debug"));
|
|
@@ -13,6 +13,7 @@ const json_1 = require("./json");
|
|
|
13
13
|
const uts_1 = require("./uts");
|
|
14
14
|
const uni_modules_1 = require("./vite/plugins/uts/uni_modules");
|
|
15
15
|
const resolve_1 = require("./resolve");
|
|
16
|
+
const dom2_1 = require("./dom2");
|
|
16
17
|
const debugWorkers = (0, debug_1.default)('uni:workers');
|
|
17
18
|
let workersRootDir = null;
|
|
18
19
|
let workersRootDirs = [];
|
|
@@ -76,6 +77,7 @@ function uniWorkersPlugin() {
|
|
|
76
77
|
const uniXKotlinCompiler = platform === 'app-android'
|
|
77
78
|
? (0, uts_1.resolveUTSCompiler)().createUniXKotlinCompilerOnce({
|
|
78
79
|
resolveWorkers,
|
|
80
|
+
sourceFileCallback: (0, dom2_1.initSourceFileCallback)(),
|
|
79
81
|
})
|
|
80
82
|
: null;
|
|
81
83
|
const uniXSwiftCompiler = platform === 'app-ios'
|
|
@@ -154,6 +156,14 @@ function resolveWorkersDir(inputDir) {
|
|
|
154
156
|
return workersDirs;
|
|
155
157
|
}
|
|
156
158
|
exports.resolveWorkersDir = resolveWorkersDir;
|
|
159
|
+
function normalizeJavaScriptWorkerSource(content) {
|
|
160
|
+
const code = content
|
|
161
|
+
// 移除 export,worker 入口按普通脚本加载,不需要导出任务类。
|
|
162
|
+
.replace(/export\s+class\s+(.*)\s+extends\s+WorkerTaskImpl\s*{/, 'class $1 extends WorkerTaskImpl {');
|
|
163
|
+
// 保持模块语义,避免 uts2js 同时登记 .uts/.ts 快照时把任务类放到全局作用域导致重复声明。
|
|
164
|
+
return /(^|\n)\s*(import|export)\s/m.test(code) ? code : `${code}\nexport {}`;
|
|
165
|
+
}
|
|
166
|
+
exports.normalizeJavaScriptWorkerSource = normalizeJavaScriptWorkerSource;
|
|
157
167
|
function uniJavaScriptWorkersPlugin() {
|
|
158
168
|
// 仅小程序平台外置uni-worker.mp.js
|
|
159
169
|
const external = (process.env.UNI_UTS_PLATFORM || '').startsWith('mp-');
|
|
@@ -220,10 +230,7 @@ function uniJavaScriptWorkersPlugin() {
|
|
|
220
230
|
}
|
|
221
231
|
if (fs_extra_1.default.existsSync(filename)) {
|
|
222
232
|
let code = (viteServer ? `import '${workerPolyfillPath}';` : '') +
|
|
223
|
-
fs_extra_1.default
|
|
224
|
-
.readFileSync(filename, 'utf-8')
|
|
225
|
-
// 移除 export
|
|
226
|
-
.replace(/export\s+class\s+(.*)\s+extends\s+WorkerTaskImpl\s*{/, 'class $1 extends WorkerTaskImpl {');
|
|
233
|
+
normalizeJavaScriptWorkerSource(fs_extra_1.default.readFileSync(filename, 'utf-8'));
|
|
227
234
|
// 如果是入口文件,需要追加初始化代码
|
|
228
235
|
if (workerClass) {
|
|
229
236
|
code += `\n;new ${workerClass}().entry()`;
|
package/dist/x.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type AppXPlatform = typeof process.env.UNI_UTS_PLATFORM;
|
|
2
|
+
export declare function isUniAppX(): boolean;
|
|
3
|
+
export declare function isUniAppXAndroid(platform?: AppXPlatform): boolean;
|
|
4
|
+
export declare function isUniAppXIOS(platform?: AppXPlatform): boolean;
|
|
5
|
+
export declare function isUniAppXVapor(): boolean;
|
|
6
|
+
export declare function shouldUseHighResolutionSourceMap(): boolean;
|
|
7
|
+
export declare function isUniAppXAndroidVapor(platform?: AppXPlatform): boolean;
|
|
8
|
+
export declare function isUniAppXJsEngine(): boolean;
|
|
9
|
+
export declare function isUniAppXAndroidJsEngine(platform?: AppXPlatform): boolean;
|
|
10
|
+
export declare function isUniAppXAndroidNative(platform?: AppXPlatform): boolean;
|
|
11
|
+
export {};
|
package/dist/x.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isUniAppXAndroidNative = exports.isUniAppXAndroidJsEngine = exports.isUniAppXJsEngine = exports.isUniAppXAndroidVapor = exports.shouldUseHighResolutionSourceMap = exports.isUniAppXVapor = exports.isUniAppXIOS = exports.isUniAppXAndroid = exports.isUniAppX = void 0;
|
|
4
|
+
function isUniAppX() {
|
|
5
|
+
return process.env.UNI_APP_X === 'true';
|
|
6
|
+
}
|
|
7
|
+
exports.isUniAppX = isUniAppX;
|
|
8
|
+
function isUniAppXAndroid(platform = process.env.UNI_UTS_PLATFORM) {
|
|
9
|
+
return isUniAppX() && platform === 'app-android';
|
|
10
|
+
}
|
|
11
|
+
exports.isUniAppXAndroid = isUniAppXAndroid;
|
|
12
|
+
function isUniAppXIOS(platform = process.env.UNI_UTS_PLATFORM) {
|
|
13
|
+
return isUniAppX() && platform === 'app-ios';
|
|
14
|
+
}
|
|
15
|
+
exports.isUniAppXIOS = isUniAppXIOS;
|
|
16
|
+
function isUniAppXVapor() {
|
|
17
|
+
return isUniAppX() && process.env.UNI_APP_X_DOM2 === 'true';
|
|
18
|
+
}
|
|
19
|
+
exports.isUniAppXVapor = isUniAppXVapor;
|
|
20
|
+
function shouldUseHighResolutionSourceMap() {
|
|
21
|
+
return !(process.env.NODE_ENV === 'development' && isUniAppXVapor());
|
|
22
|
+
}
|
|
23
|
+
exports.shouldUseHighResolutionSourceMap = shouldUseHighResolutionSourceMap;
|
|
24
|
+
function isUniAppXAndroidVapor(platform = process.env.UNI_UTS_PLATFORM) {
|
|
25
|
+
return isUniAppXAndroid(platform) && process.env.UNI_APP_X_DOM2 === 'true';
|
|
26
|
+
}
|
|
27
|
+
exports.isUniAppXAndroidVapor = isUniAppXAndroidVapor;
|
|
28
|
+
function isUniAppXJsEngine() {
|
|
29
|
+
return isUniAppX() && process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE === 'js';
|
|
30
|
+
}
|
|
31
|
+
exports.isUniAppXJsEngine = isUniAppXJsEngine;
|
|
32
|
+
function isUniAppXAndroidJsEngine(platform = process.env.UNI_UTS_PLATFORM) {
|
|
33
|
+
return (isUniAppXAndroid(platform) &&
|
|
34
|
+
process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE === 'js');
|
|
35
|
+
}
|
|
36
|
+
exports.isUniAppXAndroidJsEngine = isUniAppXAndroidJsEngine;
|
|
37
|
+
function isUniAppXAndroidNative(platform = process.env.UNI_UTS_PLATFORM) {
|
|
38
|
+
return (isUniAppXAndroid(platform) &&
|
|
39
|
+
// 非 Vapor 或者 Vapor 但使用 native 引擎
|
|
40
|
+
(process.env.UNI_APP_X_DOM2 !== 'true' ||
|
|
41
|
+
process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE === 'native'));
|
|
42
|
+
}
|
|
43
|
+
exports.isUniAppXAndroidNative = isUniAppXAndroidNative;
|
|
@@ -320,13 +320,6 @@ function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
|
|
320
320
|
expressionPlugins.push("typescript");
|
|
321
321
|
}
|
|
322
322
|
const extraOptions = options.template?.compilerOptions?.extraOptions?.(descriptor);
|
|
323
|
-
if (extraOptions.helper) {
|
|
324
|
-
extraOptions.className = extraOptions.helper.GCN(
|
|
325
|
-
descriptor.filename,
|
|
326
|
-
process.env.UNI_INPUT_DIR
|
|
327
|
-
);
|
|
328
|
-
extraOptions.r = extraOptions.helper.K;
|
|
329
|
-
}
|
|
330
323
|
return {
|
|
331
324
|
...options.template,
|
|
332
325
|
// @ts-expect-error TODO remove when 3.6 is out
|
|
@@ -307,13 +307,6 @@ function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
|
|
307
307
|
expressionPlugins.push("typescript");
|
|
308
308
|
}
|
|
309
309
|
const extraOptions = options.template?.compilerOptions?.extraOptions?.(descriptor);
|
|
310
|
-
if (extraOptions.helper) {
|
|
311
|
-
extraOptions.className = extraOptions.helper.GCN(
|
|
312
|
-
descriptor.filename,
|
|
313
|
-
process.env.UNI_INPUT_DIR
|
|
314
|
-
);
|
|
315
|
-
extraOptions.r = extraOptions.helper.K;
|
|
316
|
-
}
|
|
317
310
|
return {
|
|
318
311
|
...options.template,
|
|
319
312
|
// @ts-expect-error TODO remove when 3.6 is out
|