@dcloudio/uni-cli-shared 3.0.0-5000720260410001 → 3.0.0-5010420260703001
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 +17 -0
- package/dist/dom2/vue.js +50 -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 +66 -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/index.d.ts +1 -1
- package/dist/json/index.js +2 -1
- 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/messages/en.d.ts +10 -2
- package/dist/messages/en.js +10 -2
- package/dist/messages/index.d.ts +20 -4
- package/dist/messages/zh_CN.d.ts +10 -2
- package/dist/messages/zh_CN.js +10 -2
- package/dist/mp/style.js +6 -2
- package/dist/postcss/plugins/stylePluginExternal.d.ts +9 -10
- package/dist/postcss/plugins/stylePluginExternal.js +51 -45
- 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/inject.js +4 -1
- package/dist/vite/plugins/json.js +2 -69
- package/dist/vite/plugins/pre.js +2 -0
- 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/css.d.ts +2 -2
- package/dist/vite/plugins/vitejs/plugins/css.js +10 -5
- package/dist/vue/transforms/index.d.ts +1 -0
- package/dist/vue/transforms/index.js +1 -0
- 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 +10 -0
- package/dist/x.js +39 -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
package/dist/messages/zh_CN.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly 'app.compiler.version': "编译器版本:{version}";
|
|
3
|
+
readonly 'view.render.compiler.target': "当前视图层编译目标:{target}";
|
|
4
|
+
readonly 'view.render.compiler.target.bytecode': "字节码";
|
|
5
|
+
readonly 'view.render.compiler.target.nativecode': "机器码";
|
|
6
|
+
readonly 'style.isolation.version': "当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html";
|
|
3
7
|
readonly compiling: "正在编译中...";
|
|
4
8
|
readonly 'dev.performance': "请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。";
|
|
5
9
|
readonly 'dev.performance.nvue': "尤其是 app-nvue 的 sourcemap 影响较大";
|
|
@@ -11,14 +15,17 @@ declare const _default: {
|
|
|
11
15
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
12
16
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
13
17
|
readonly 'dev.watching.restart.vapor': "DONE Restart required. 切换蒸汽模式需要重新运行才能生效。";
|
|
18
|
+
readonly 'dev.watching.vapor.render.target': "manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。";
|
|
14
19
|
readonly 'build.failed': "DONE Build failed.";
|
|
15
20
|
readonly 'compiler.build.failed': "编译失败";
|
|
16
21
|
readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
|
|
17
|
-
readonly 'stat.warn.version': "当前应用未配置uni
|
|
18
|
-
readonly 'stat.warn.tip': "已开启
|
|
22
|
+
readonly 'stat.warn.version': "当前应用未配置 uni 统计版本,默认使用公有版;可配置为公有版或私有版。详情:https://uniapp.dcloud.io/uni-stat";
|
|
23
|
+
readonly 'stat.warn.tip': "已开启uni 统计 2.0{type}";
|
|
19
24
|
readonly 'i18n.fallbackLocale.default': "当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}";
|
|
20
25
|
readonly 'i18n.fallbackLocale.missing': "当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件";
|
|
21
26
|
readonly 'easycom.conflict': "easycom组件冲突:";
|
|
27
|
+
readonly 'dom2.compatible.component': "蒸汽模式不支持 uni-app 兼容模式组件 {name},检测到其实现文件为 {file}。请改用标准模式的UTS组件实现来实现。";
|
|
28
|
+
readonly 'dom2.root.scroll.view': "蒸汽模式下页面可滚动,建议移除根节点 scroll-view,以避免嵌套滚动。详情: https://doc.dcloud.net.cn/uni-app-x/page.html#disablescroll";
|
|
22
29
|
readonly 'mp.component.args[0]': "{0}的第一个参数必须为静态字符串";
|
|
23
30
|
readonly 'mp.component.args[1]': "{0}需要两个参数";
|
|
24
31
|
readonly 'mp.360.unsupported': "vue3暂不支持360小程序";
|
|
@@ -48,5 +55,6 @@ declare const _default: {
|
|
|
48
55
|
readonly 'uni_modules.import': "插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。";
|
|
49
56
|
readonly 'pages.json.page.notfound': "页面\"{pagePath}\"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。";
|
|
50
57
|
readonly 'pages.json.page.slash': "路径 \"{pagePath}\" 不能以 \"/\" 开头";
|
|
58
|
+
readonly 'pages.json.tabbar.page.notfound': "tabBar 中配置的页面 \"{pagePath}\" 未在 pages.json 中注册。";
|
|
51
59
|
};
|
|
52
60
|
export default _default;
|
package/dist/messages/zh_CN.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
'app.compiler.version': '编译器版本:{version}',
|
|
5
|
+
'view.render.compiler.target': '当前视图层编译目标:{target}',
|
|
6
|
+
'view.render.compiler.target.bytecode': '字节码',
|
|
7
|
+
'view.render.compiler.target.nativecode': '机器码',
|
|
8
|
+
'style.isolation.version': '当前样式隔离策略:{version}。详见:https://doc.dcloud.net.cn/uni-app-x/css/common/style-isolation.html',
|
|
5
9
|
compiling: '正在编译中...',
|
|
6
10
|
'dev.performance': '请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。',
|
|
7
11
|
'dev.performance.nvue': '尤其是 app-nvue 的 sourcemap 影响较大',
|
|
@@ -13,14 +17,17 @@ exports.default = {
|
|
|
13
17
|
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
|
|
14
18
|
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
|
|
15
19
|
'dev.watching.restart.vapor': 'DONE Restart required. 切换蒸汽模式需要重新运行才能生效。',
|
|
20
|
+
'dev.watching.vapor.render.target': 'manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。',
|
|
16
21
|
'build.failed': 'DONE Build failed.',
|
|
17
22
|
'compiler.build.failed': '编译失败',
|
|
18
23
|
'stat.warn.appid': '当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
|
|
19
|
-
'stat.warn.version': '当前应用未配置uni
|
|
20
|
-
'stat.warn.tip': '已开启
|
|
24
|
+
'stat.warn.version': '当前应用未配置 uni 统计版本,默认使用公有版;可配置为公有版或私有版。详情:https://uniapp.dcloud.io/uni-stat',
|
|
25
|
+
'stat.warn.tip': '已开启uni 统计 2.0{type}',
|
|
21
26
|
'i18n.fallbackLocale.default': '当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}',
|
|
22
27
|
'i18n.fallbackLocale.missing': '当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件',
|
|
23
28
|
'easycom.conflict': 'easycom组件冲突:',
|
|
29
|
+
'dom2.compatible.component': '蒸汽模式不支持 uni-app 兼容模式组件 {name},检测到其实现文件为 {file}。请改用标准模式的UTS组件实现来实现。',
|
|
30
|
+
'dom2.root.scroll.view': '蒸汽模式下页面可滚动,建议移除根节点 scroll-view,以避免嵌套滚动。详情: https://doc.dcloud.net.cn/uni-app-x/page.html#disablescroll',
|
|
24
31
|
'mp.component.args[0]': '{0}的第一个参数必须为静态字符串',
|
|
25
32
|
'mp.component.args[1]': '{0}需要两个参数',
|
|
26
33
|
'mp.360.unsupported': 'vue3暂不支持360小程序',
|
|
@@ -51,4 +58,5 @@ exports.default = {
|
|
|
51
58
|
'uni_modules.import': '插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。',
|
|
52
59
|
'pages.json.page.notfound': '页面"{pagePath}"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。',
|
|
53
60
|
'pages.json.page.slash': '路径 "{pagePath}" 不能以 "/" 开头',
|
|
61
|
+
'pages.json.tabbar.page.notfound': 'tabBar 中配置的页面 "{pagePath}" 未在 pages.json 中注册。',
|
|
54
62
|
};
|
package/dist/mp/style.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.transformPartSelector = exports.transformScopedCss = void 0;
|
|
|
4
4
|
const tags_1 = require("./tags");
|
|
5
5
|
const logs_1 = require("../logs");
|
|
6
6
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
7
|
+
const HTML_TAG_SELECTOR_RE = new RegExp(`/\\*[\\s\\S]*?(?:\\*/|$)|[\\s,}](${Object.keys(tags_1.HTML_TO_MINI_PROGRAM_TAGS).join('|')})\\s*(?=,|\\{)`, 'g');
|
|
7
8
|
function transformScopedCss(cssCode) {
|
|
8
9
|
checkHtmlTagSelector(cssCode);
|
|
9
10
|
return cssCode.replace(/\[(data-v-[a-f0-9]{8})\]/gi, (_, scopedId) => {
|
|
@@ -18,8 +19,11 @@ function transformPartSelector(cssCode) {
|
|
|
18
19
|
}
|
|
19
20
|
exports.transformPartSelector = transformPartSelector;
|
|
20
21
|
function checkHtmlTagSelector(cssCode) {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
HTML_TAG_SELECTOR_RE.lastIndex = 0;
|
|
23
|
+
let match;
|
|
24
|
+
while ((match = HTML_TAG_SELECTOR_RE.exec(cssCode))) {
|
|
25
|
+
const tag = match[1];
|
|
26
|
+
if (tag) {
|
|
23
27
|
(0, logs_1.output)('warn', `小程序端 style 暂不支持 ${tag} 标签选择器,推荐使用 class 选择器,详情参考:https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#style`);
|
|
24
28
|
break;
|
|
25
29
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { PluginCreator } from 'postcss';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 基于页面 externalClasses 使用情况提升页面样式优先级
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* .a ->
|
|
9
|
-
* -
|
|
10
|
-
* .foo ->
|
|
11
|
-
* .bar -> .bar
|
|
5
|
+
* 小程序平台(mp-*):
|
|
6
|
+
* - 页面没有使用 externalClasses:不做转换
|
|
7
|
+
* - 页面存在动态 externalClasses:选择器最后一个 class 追加 [class]
|
|
8
|
+
* .a -> .a[class]
|
|
9
|
+
* - 页面只有静态 externalClasses:仅命中静态 class 的选择器追加 [class]
|
|
10
|
+
* .foo -> .foo[class](foo 在 staticClasses 中)
|
|
11
|
+
* .bar -> .bar(bar 不在 staticClasses 中)
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* while minimizing unnecessary transformations for performance
|
|
13
|
+
* 追加 [class] 可以提升 class 选择器优先级,同时避免原先插入 page 带来的结构影响。
|
|
15
14
|
*/
|
|
16
15
|
declare const externalPlugin: PluginCreator<void>;
|
|
17
16
|
export default externalPlugin;
|
|
@@ -7,18 +7,17 @@ const postcss_selector_parser_1 = __importDefault(require("postcss-selector-pars
|
|
|
7
7
|
const pages_1 = require("../../json/pages");
|
|
8
8
|
const externalClasses_1 = require("../../mp/externalClasses");
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 基于页面 externalClasses 使用情况提升页面样式优先级
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* .a ->
|
|
16
|
-
* -
|
|
17
|
-
* .foo ->
|
|
18
|
-
* .bar -> .bar
|
|
12
|
+
* 小程序平台(mp-*):
|
|
13
|
+
* - 页面没有使用 externalClasses:不做转换
|
|
14
|
+
* - 页面存在动态 externalClasses:选择器最后一个 class 追加 [class]
|
|
15
|
+
* .a -> .a[class]
|
|
16
|
+
* - 页面只有静态 externalClasses:仅命中静态 class 的选择器追加 [class]
|
|
17
|
+
* .foo -> .foo[class](foo 在 staticClasses 中)
|
|
18
|
+
* .bar -> .bar(bar 不在 staticClasses 中)
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* while minimizing unnecessary transformations for performance
|
|
20
|
+
* 追加 [class] 可以提升 class 选择器优先级,同时避免原先插入 page 带来的结构影响。
|
|
22
21
|
*/
|
|
23
22
|
const externalPlugin = () => {
|
|
24
23
|
return {
|
|
@@ -27,21 +26,21 @@ const externalPlugin = () => {
|
|
|
27
26
|
const processedRules = new WeakSet();
|
|
28
27
|
return {
|
|
29
28
|
OnceExit(root) {
|
|
30
|
-
//
|
|
29
|
+
// 只有小程序平台需要处理 externalClasses 的样式优先级
|
|
31
30
|
const platform = process.env.UNI_PLATFORM || '';
|
|
32
31
|
if (!platform.startsWith('mp-')) {
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
|
-
//
|
|
34
|
+
// 从 postcss source 中获取当前样式所属文件
|
|
36
35
|
const filePath = root.source?.input?.file;
|
|
37
36
|
if (!filePath) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
//
|
|
39
|
+
// 只处理页面文件,组件文件保持原样
|
|
41
40
|
if (!(0, pages_1.isUniPageFile)(filePath)) {
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
|
-
//
|
|
43
|
+
// 获取页面中收集到的 externalClasses 使用信息
|
|
45
44
|
const externalClassesInfo = (0, externalClasses_1.findPageExternalClasses)(filePath);
|
|
46
45
|
let staticClasses = new Set();
|
|
47
46
|
let hasDynamic = false;
|
|
@@ -55,7 +54,7 @@ const externalPlugin = () => {
|
|
|
55
54
|
hasDynamic = true;
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
//
|
|
57
|
+
// 没有静态 class,也没有动态绑定时,直接跳过,避免无意义遍历
|
|
59
58
|
if (staticClasses.size === 0 && !hasDynamic) {
|
|
60
59
|
return;
|
|
61
60
|
}
|
|
@@ -68,60 +67,67 @@ const externalPlugin = () => {
|
|
|
68
67
|
};
|
|
69
68
|
};
|
|
70
69
|
function processRule(rule, processedRules, staticClasses, hasDynamic) {
|
|
71
|
-
//
|
|
70
|
+
// 同一个 Rule 只处理一次,避免被重复追加 [class]
|
|
72
71
|
if (processedRules.has(rule)) {
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
|
-
//
|
|
74
|
+
// keyframes 内部的 from/to 不是普通选择器,不能处理
|
|
76
75
|
if (rule.parent &&
|
|
77
76
|
rule.parent.type === 'atrule' &&
|
|
78
77
|
/-?keyframes$/.test(rule.parent.name)) {
|
|
79
78
|
return;
|
|
80
79
|
}
|
|
81
80
|
processedRules.add(rule);
|
|
82
|
-
//
|
|
81
|
+
// 根据 externalClasses 情况处理选择器
|
|
83
82
|
rule.selector = (0, postcss_selector_parser_1.default)((selectorRoot) => {
|
|
84
83
|
selectorRoot.each((selector) => {
|
|
84
|
+
let classNode;
|
|
85
85
|
if (hasDynamic) {
|
|
86
|
-
//
|
|
87
|
-
|
|
86
|
+
// 动态绑定无法提前知道具体 class,所有包含 class 的选择器都提升优先级
|
|
87
|
+
classNode = findLastClassNode(selector);
|
|
88
88
|
}
|
|
89
89
|
else {
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
// 静态绑定只处理命中 staticClasses 的选择器,减少无关 CSS 变更
|
|
91
|
+
classNode = findLastClassNode(selector, staticClasses);
|
|
92
|
+
}
|
|
93
|
+
if (classNode) {
|
|
94
|
+
appendClassAttribute(selector, classNode);
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
}).processSync(rule.selector);
|
|
97
98
|
}
|
|
98
99
|
/**
|
|
99
|
-
*
|
|
100
|
+
* 找到选择器最右侧的 class 节点。
|
|
101
|
+
* 传入 classes 时,仅在选择器包含目标 class 后才返回最右侧 class,
|
|
102
|
+
* 这样 .a .b 在命中 .a 时也能输出 .a .b[class],符合整体提权预期。
|
|
100
103
|
*/
|
|
101
|
-
function
|
|
102
|
-
let
|
|
103
|
-
selector.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
function findLastClassNode(selector, classes) {
|
|
105
|
+
let lastClassNode;
|
|
106
|
+
for (let i = selector.nodes.length - 1; i >= 0; i--) {
|
|
107
|
+
const node = selector.nodes[i];
|
|
108
|
+
if (node.type !== 'class') {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (!lastClassNode) {
|
|
112
|
+
lastClassNode = node;
|
|
113
|
+
}
|
|
114
|
+
if (!classes || classes.has(node.value)) {
|
|
115
|
+
return lastClassNode;
|
|
107
116
|
}
|
|
108
|
-
}
|
|
109
|
-
return found;
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
/**
|
|
112
|
-
*
|
|
113
|
-
* .a ->
|
|
114
|
-
* .
|
|
120
|
+
* 在 class 后追加 [class] 提升优先级。
|
|
121
|
+
* .a -> .a[class]
|
|
122
|
+
* .a[class] -> .a[class][class]
|
|
123
|
+
* .a .b -> .a .b[class]
|
|
115
124
|
*/
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
// Insert 'page' tag and a combinator (space) at the beginning
|
|
123
|
-
selector.prepend(postcss_selector_parser_1.default.combinator({ value: ' ' }));
|
|
124
|
-
selector.prepend(postcss_selector_parser_1.default.tag({ value: 'page' }));
|
|
125
|
+
function appendClassAttribute(selector, classNode) {
|
|
126
|
+
selector.insertAfter(classNode, postcss_selector_parser_1.default.attribute({
|
|
127
|
+
attribute: 'class',
|
|
128
|
+
value: undefined,
|
|
129
|
+
raws: {},
|
|
130
|
+
}));
|
|
125
131
|
}
|
|
126
132
|
externalPlugin.postcss = true;
|
|
127
133
|
exports.default = externalPlugin;
|
|
@@ -32,6 +32,7 @@ export interface EncryptPackageJson {
|
|
|
32
32
|
dependencies: string[];
|
|
33
33
|
artifacts: {
|
|
34
34
|
env: {
|
|
35
|
+
vapor: boolean;
|
|
35
36
|
compilerVersion: string;
|
|
36
37
|
} & Record<string, any>;
|
|
37
38
|
apis: string[];
|
|
@@ -45,9 +46,10 @@ export interface EncryptPackageJson {
|
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
export declare function initCheckEnv(): Record<string,
|
|
49
|
+
export declare function initCheckEnv(): Record<string, unknown>;
|
|
49
50
|
export declare function resolveEncryptUniModule(id: string, platform: typeof process.env.UNI_UTS_PLATFORM, isX?: boolean): string | undefined;
|
|
50
51
|
type CloudCompileSdkType = 'utssdk' | 'easycom' | 'all';
|
|
52
|
+
type VaporRenderTarget = 'bytecode' | 'nativecode';
|
|
51
53
|
export interface CloudCompileParams {
|
|
52
54
|
mode: 'development' | 'production';
|
|
53
55
|
packType: 'debug' | 'release';
|
|
@@ -56,8 +58,11 @@ export interface CloudCompileParams {
|
|
|
56
58
|
appname: string;
|
|
57
59
|
platform: typeof process.env.UNI_UTS_PLATFORM;
|
|
58
60
|
'uni-app-x': boolean;
|
|
61
|
+
vapor: boolean;
|
|
62
|
+
vaporRenderTarget?: VaporRenderTarget;
|
|
59
63
|
env: Record<string, string>;
|
|
60
64
|
}
|
|
65
|
+
export declare function validateCloudCompileAppInfo(params: Pick<CloudCompileParams, 'appid' | 'appname'>): string;
|
|
61
66
|
export declare function checkEncryptUniModules(inputDir: string, params: CloudCompileParams, sdkType?: CloudCompileSdkType): Promise<{} | undefined>;
|
|
62
67
|
export declare function getUniModulesEncryptType(pluginId: string): "" | "utssdk" | "easycom" | undefined;
|
|
63
68
|
export declare function parseUniModulesArtifacts(): {
|
|
@@ -66,5 +71,6 @@ export declare function parseUniModulesArtifacts(): {
|
|
|
66
71
|
scopedSlots: string[];
|
|
67
72
|
declaration: string;
|
|
68
73
|
}[];
|
|
74
|
+
export declare function copyEncryptUniModulesDom2Bytes(): boolean | Promise<boolean>;
|
|
69
75
|
export declare function virtualComponentPath(filepath: string): string;
|
|
70
76
|
export {};
|
|
@@ -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.virtualComponentPath = exports.parseUniModulesArtifacts = exports.getUniModulesEncryptType = exports.checkEncryptUniModules = exports.resolveEncryptUniModule = exports.initCheckEnv = exports.packUploadEncryptUniModules = exports.findUploadEncryptUniModulesFiles = exports.findCloudEncryptUniModules = exports.parseEasyComComponents = exports.parseUniModulesWithComponents = exports.genEncryptUTSModuleCode = exports.genEncryptEasyComModuleCode = void 0;
|
|
6
|
+
exports.virtualComponentPath = exports.copyEncryptUniModulesDom2Bytes = exports.parseUniModulesArtifacts = exports.getUniModulesEncryptType = exports.checkEncryptUniModules = exports.validateCloudCompileAppInfo = exports.resolveEncryptUniModule = exports.initCheckEnv = exports.packUploadEncryptUniModules = exports.findUploadEncryptUniModulesFiles = exports.findCloudEncryptUniModules = exports.parseEasyComComponents = exports.parseUniModulesWithComponents = exports.genEncryptUTSModuleCode = exports.genEncryptEasyComModuleCode = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const fast_glob_1 = require("fast-glob");
|
|
@@ -12,6 +12,7 @@ const easycom_1 = require("./easycom");
|
|
|
12
12
|
const messages_1 = require("./messages");
|
|
13
13
|
const constants_1 = require("./constants");
|
|
14
14
|
const url_1 = require("./url");
|
|
15
|
+
const x_1 = require("./x");
|
|
15
16
|
function genEncryptEasyComModuleIndex(pluginId, platform, components) {
|
|
16
17
|
const isMp = platform.startsWith('mp-');
|
|
17
18
|
const imports = [];
|
|
@@ -23,7 +24,7 @@ function genEncryptEasyComModuleIndex(pluginId, platform, components) {
|
|
|
23
24
|
ids.push(id);
|
|
24
25
|
}
|
|
25
26
|
let instance = '';
|
|
26
|
-
if (
|
|
27
|
+
if ((0, x_1.isUniAppXAndroidNative)(platform)) {
|
|
27
28
|
instance = (0, easycom_1.genUTSComponentPublicInstanceIdent)(component);
|
|
28
29
|
// 类型
|
|
29
30
|
ids.push(instance);
|
|
@@ -307,20 +308,22 @@ const KNOWN_ASSET_TYPES = [
|
|
|
307
308
|
'txt',
|
|
308
309
|
];
|
|
309
310
|
function findUniModuleFiles(platform, id, inputDir) {
|
|
311
|
+
const useUniAppXAndroidNative = (0, x_1.isUniAppXAndroidNative)(platform);
|
|
310
312
|
return (0, fast_glob_1.sync)(`uni_modules/${id}/**/*`, {
|
|
311
313
|
cwd: inputDir,
|
|
312
314
|
absolute: true,
|
|
313
315
|
ignore: [
|
|
314
316
|
'**/*.md',
|
|
315
|
-
...(
|
|
316
|
-
? [
|
|
317
|
-
: []),
|
|
317
|
+
...(useUniAppXAndroidNative // 仅旧版 Android x 需要扫描 assets
|
|
318
|
+
? []
|
|
319
|
+
: [`**/*.{${KNOWN_ASSET_TYPES.join(',')}}`]),
|
|
318
320
|
],
|
|
319
321
|
});
|
|
320
322
|
}
|
|
321
323
|
function initCheckEnv() {
|
|
322
324
|
return {
|
|
323
325
|
// 云端编译的版本号不带日期及小版本
|
|
326
|
+
vapor: process.env.UNI_APP_X_DOM2 === 'true',
|
|
324
327
|
compilerVersion: process.env.UNI_COMPILER_VERSION,
|
|
325
328
|
};
|
|
326
329
|
}
|
|
@@ -334,6 +337,9 @@ function findLastIndex(array, predicate) {
|
|
|
334
337
|
return -1;
|
|
335
338
|
}
|
|
336
339
|
let encryptUniModules = {};
|
|
340
|
+
function refreshEncryptUniModules(platform, inputDir) {
|
|
341
|
+
encryptUniModules = findCloudEncryptUniModules(platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR, 'all');
|
|
342
|
+
}
|
|
337
343
|
function resolveEncryptUniModule(id, platform, isX = true) {
|
|
338
344
|
id = id.split('?', 2)[0];
|
|
339
345
|
const parts = id.split('/');
|
|
@@ -367,31 +373,62 @@ function resolveEncryptUniModule(id, platform, isX = true) {
|
|
|
367
373
|
}
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
|
-
//
|
|
371
|
-
return (0, utils_1.normalizePath)(path_1.default.join(process.env.UNI_INPUT_DIR, `uni_modules/${uniModuleId}?${isX &&
|
|
376
|
+
// 仅旧版 Android x 原生引擎走 uts-proxy,JS 引擎与其他平台统一走 uni_helpers
|
|
377
|
+
return (0, utils_1.normalizePath)(path_1.default.join(process.env.UNI_INPUT_DIR, `uni_modules/${uniModuleId}?${isX && (0, x_1.isUniAppXAndroidNative)(platform)
|
|
378
|
+
? 'uts-proxy'
|
|
379
|
+
: 'uni_helpers'}`));
|
|
372
380
|
}
|
|
373
381
|
}
|
|
374
382
|
}
|
|
375
383
|
exports.resolveEncryptUniModule = resolveEncryptUniModule;
|
|
384
|
+
function validateCloudCompileAppInfo(params) {
|
|
385
|
+
const missingFields = [];
|
|
386
|
+
if (!String(params.appid || '').trim()) {
|
|
387
|
+
missingFields.push('appid');
|
|
388
|
+
}
|
|
389
|
+
if (!String(params.appname || '').trim()) {
|
|
390
|
+
missingFields.push('name');
|
|
391
|
+
}
|
|
392
|
+
if (missingFields.length) {
|
|
393
|
+
return `云编译插件失败:manifest.json 缺少 ${missingFields.join('、')},请先配置后重新编译。`;
|
|
394
|
+
}
|
|
395
|
+
return '';
|
|
396
|
+
}
|
|
397
|
+
exports.validateCloudCompileAppInfo = validateCloudCompileAppInfo;
|
|
376
398
|
async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
|
|
399
|
+
const isHarmonySplitCompile = params.platform === 'app-harmony' && sdkType !== 'all';
|
|
377
400
|
// 初始化指定 sdk 类型的加密插件
|
|
378
401
|
const curEncryptUniModules = findCloudEncryptUniModules(params.platform, inputDir, process.env.UNI_MODULES_ENCRYPT_CACHE_DIR, sdkType);
|
|
379
402
|
if (!Object.keys(curEncryptUniModules).length) {
|
|
403
|
+
// 鸿蒙会按 utssdk/easycom 分两次扫描,这里回填一次全量状态,避免子集扫描把插件类型覆盖掉
|
|
404
|
+
if (isHarmonySplitCompile) {
|
|
405
|
+
refreshEncryptUniModules(params.platform, inputDir);
|
|
406
|
+
}
|
|
380
407
|
return {};
|
|
381
408
|
}
|
|
382
409
|
if (!process.env.UNI_HBUILDERX_PLUGINS) {
|
|
410
|
+
if (isHarmonySplitCompile) {
|
|
411
|
+
refreshEncryptUniModules(params.platform, inputDir);
|
|
412
|
+
}
|
|
383
413
|
return {};
|
|
384
414
|
}
|
|
385
415
|
const cacheDir = process.env.UNI_MODULES_ENCRYPT_CACHE_DIR;
|
|
386
|
-
const
|
|
416
|
+
const needsCloudCompile = Object.keys(curEncryptUniModules).some((uniModuleId) => !curEncryptUniModules[uniModuleId]);
|
|
417
|
+
if (params.vapor && needsCloudCompile) {
|
|
418
|
+
const validateAppInfoError = validateCloudCompileAppInfo(params);
|
|
419
|
+
if (validateAppInfoError) {
|
|
420
|
+
console.error(validateAppInfoError);
|
|
421
|
+
return process.exit(0);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
const { zipFile, modules } = packUploadEncryptUniModules(curEncryptUniModules, params.platform, inputDir, cacheDir);
|
|
387
425
|
if (zipFile) {
|
|
388
426
|
const downloadFile = path_1.default.resolve(cacheDir, 'uni_modules.download.zip');
|
|
389
427
|
const { C, D, R, U } = (0, utils_1.requireUniHelpers)();
|
|
390
428
|
try {
|
|
391
429
|
const isLogin = await C();
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
: '';
|
|
430
|
+
const useUniAppXAndroidNative = (0, x_1.isUniAppXAndroidNative)(params.platform);
|
|
431
|
+
const tips = !useUniAppXAndroidNative ? '(此过程耗时较长)' : '';
|
|
395
432
|
console.log(`正在云编译插件${isLogin ? '' : '(请先登录)'}${tips}:${modules.join(',')}...`);
|
|
396
433
|
let downloadUrl = '';
|
|
397
434
|
try {
|
|
@@ -414,6 +451,7 @@ async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
|
|
|
414
451
|
const AdmZip = require('adm-zip');
|
|
415
452
|
const zip = new AdmZip(downloadFile);
|
|
416
453
|
zip.extractAllTo(cacheDir, true);
|
|
454
|
+
await Promise.resolve(copyEncryptUniModulesDom2Bytes());
|
|
417
455
|
fs_extra_1.default.unlinkSync(zipFile);
|
|
418
456
|
fs_extra_1.default.unlinkSync(downloadFile);
|
|
419
457
|
R({
|
|
@@ -431,8 +469,10 @@ async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
|
|
|
431
469
|
}
|
|
432
470
|
}
|
|
433
471
|
else {
|
|
434
|
-
|
|
435
|
-
|
|
472
|
+
await Promise.resolve(copyEncryptUniModulesDom2Bytes());
|
|
473
|
+
const useUniAppXAndroidNative = (0, x_1.isUniAppXAndroidNative)(params.platform);
|
|
474
|
+
// 仅旧版 Android x 需要在缓存命中时额外初始化
|
|
475
|
+
if (useUniAppXAndroidNative) {
|
|
436
476
|
const { R } = (0, utils_1.requireUniHelpers)();
|
|
437
477
|
R({
|
|
438
478
|
dir: process.env.UNI_INPUT_DIR,
|
|
@@ -441,7 +481,7 @@ async function checkEncryptUniModules(inputDir, params, sdkType = 'all') {
|
|
|
441
481
|
}
|
|
442
482
|
}
|
|
443
483
|
// 初始化所有
|
|
444
|
-
|
|
484
|
+
refreshEncryptUniModules(params.platform, inputDir);
|
|
445
485
|
}
|
|
446
486
|
exports.checkEncryptUniModules = checkEncryptUniModules;
|
|
447
487
|
function getUniModulesEncryptType(pluginId) {
|
|
@@ -464,6 +504,83 @@ function parseUniModulesArtifacts() {
|
|
|
464
504
|
return res;
|
|
465
505
|
}
|
|
466
506
|
exports.parseUniModulesArtifacts = parseUniModulesArtifacts;
|
|
507
|
+
function copyEncryptUniModulesDom2Bytes() {
|
|
508
|
+
if (process.env.UNI_APP_X_DOM2 !== 'true') {
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
if (!['app-android', 'app-ios', 'app-harmony'].includes(process.env.UNI_UTS_PLATFORM)) {
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
const cacheDir = process.env.UNI_MODULES_ENCRYPT_CACHE_DIR;
|
|
515
|
+
const outputDir = process.env.UNI_OUTPUT_DIR;
|
|
516
|
+
if (!cacheDir || !outputDir) {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
if (process.env.UNI_APP_X_VAPOR_RENDER_TARGET === 'bytecode') {
|
|
520
|
+
return copyEncryptUniModulesDom2BytesTarget(cacheDir, outputDir);
|
|
521
|
+
}
|
|
522
|
+
if (process.env.UNI_APP_X_VAPOR_RENDER_TARGET === 'nativecode') {
|
|
523
|
+
return copyEncryptUniModulesDom2CppTarget(cacheDir, outputDir);
|
|
524
|
+
}
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
exports.copyEncryptUniModulesDom2Bytes = copyEncryptUniModulesDom2Bytes;
|
|
528
|
+
function copyEncryptUniModulesDom2BytesTarget(cacheDir, outputDir) {
|
|
529
|
+
// 只依赖编译环境变量定位缓存目录和输出目录,避免拼接具体 unpackage/dist 路径。
|
|
530
|
+
const sourceBytesDir = path_1.default.resolve(cacheDir, 'bytes');
|
|
531
|
+
if (!fs_extra_1.default.existsSync(sourceBytesDir) ||
|
|
532
|
+
!fs_extra_1.default.statSync(sourceBytesDir).isDirectory()) {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
const outputBytesDir = path_1.default.resolve(outputDir, 'bytes');
|
|
536
|
+
// 云编译产出的 bytecode 在缓存目录中,这里只合并复制到当前编译输出目录。
|
|
537
|
+
fs_extra_1.default.copySync(sourceBytesDir, outputBytesDir, { overwrite: true });
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
async function copyEncryptUniModulesDom2CppTarget(cacheDir, outputDir) {
|
|
541
|
+
const sourceCppDir = path_1.default.resolve(cacheDir, 'cpp');
|
|
542
|
+
if (!fs_extra_1.default.existsSync(sourceCppDir) ||
|
|
543
|
+
!fs_extra_1.default.statSync(sourceCppDir).isDirectory()) {
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
const outputCppDir = process.env.UNI_APP_X_DOM2_CPP_DIR || path_1.default.resolve(outputDir, 'cpp');
|
|
547
|
+
// nativecode 的 cpp/h 暂时不走 DUM 解密,直接复制云端产物。
|
|
548
|
+
// const cppFiles = sync('**/*.{cpp,h}', {
|
|
549
|
+
// absolute: false,
|
|
550
|
+
// cwd: sourceCppDir,
|
|
551
|
+
// onlyFiles: true,
|
|
552
|
+
// }).filter((file) => !isIgnoreDom2CppFile(file))
|
|
553
|
+
// if (cppFiles.length) {
|
|
554
|
+
// const files = cppFiles.reduce((files, file) => {
|
|
555
|
+
// files[path.resolve(sourceCppDir, file)] = path.resolve(outputCppDir, file)
|
|
556
|
+
// return files
|
|
557
|
+
// }, {} as Record<string, string>)
|
|
558
|
+
// const { DUM } = requireUniHelpers()
|
|
559
|
+
// const errMsg = await DUM(path.basename(sourceCppDir), files)
|
|
560
|
+
// if (errMsg) {
|
|
561
|
+
// console.error(errMsg)
|
|
562
|
+
// process.exit(0)
|
|
563
|
+
// }
|
|
564
|
+
// }
|
|
565
|
+
// cpp 目录保持原目录结构直接复制,shared_data_init.h 由当前编译流程生成,不复制云端缓存版本。
|
|
566
|
+
fs_extra_1.default.copySync(sourceCppDir, outputCppDir, {
|
|
567
|
+
filter(src) {
|
|
568
|
+
if (fs_extra_1.default.statSync(src).isDirectory()) {
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
571
|
+
// shared_data_init.h 由当前编译生成,不能复制云端缓存里的旧文件覆盖本地结果。
|
|
572
|
+
if (isIgnoreDom2CppFile(src)) {
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
return true;
|
|
576
|
+
},
|
|
577
|
+
overwrite: true,
|
|
578
|
+
});
|
|
579
|
+
return true;
|
|
580
|
+
}
|
|
581
|
+
function isIgnoreDom2CppFile(filename) {
|
|
582
|
+
return path_1.default.basename(filename) === 'shared_data_init.h';
|
|
583
|
+
}
|
|
467
584
|
const uniComponentPrefix = 'uniComponent://';
|
|
468
585
|
function virtualComponentPath(filepath) {
|
|
469
586
|
return uniComponentPrefix + (0, url_1.encodeBase64Url)(filepath);
|
package/dist/uni_modules.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.parseUTSModuleDeps = exports.capitalize = exports.camelize = exports.par
|
|
|
7
7
|
// 重要:此文件编译后的js,需同步至 vue2 编译器中 uni-cli-shared/lib/uts/uni_modules.js
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const x_1 = require("./x");
|
|
10
11
|
const extApiProviders = [];
|
|
11
12
|
const extApiPlugins = new Set();
|
|
12
13
|
function getNonTreeShakingPlugins() {
|
|
@@ -228,7 +229,7 @@ function parseInjects(vite = true, platform, language, source, uniModuleRootDir,
|
|
|
228
229
|
// source = `${source}/utssdk/index.uts`
|
|
229
230
|
// }
|
|
230
231
|
}
|
|
231
|
-
else if (
|
|
232
|
+
else if ((0, x_1.isUniAppXJsEngine)()) {
|
|
232
233
|
if (fs_extra_1.default.existsSync(path_1.default.resolve(uniModuleRootDir, 'utssdk', 'app-js', 'index.uts'))) {
|
|
233
234
|
source = `${source}/utssdk/app-js/index.uts`;
|
|
234
235
|
}
|
|
@@ -291,7 +292,7 @@ function parseInject(vite = true, platform, language, source, globalObject, defi
|
|
|
291
292
|
const appOptions = defineOptions.app;
|
|
292
293
|
if (isPlainObject(appOptions)) {
|
|
293
294
|
// js engine 下且存在 app-js,不检查
|
|
294
|
-
const skipCheck = (
|
|
295
|
+
const skipCheck = ((0, x_1.isUniAppXJsEngine)() ||
|
|
295
296
|
process.env.UNI_UTS_PLATFORM === 'app-harmony') &&
|
|
296
297
|
source.includes('app-js');
|
|
297
298
|
if (!skipCheck) {
|
package/dist/utils.js
CHANGED
|
@@ -175,6 +175,11 @@ function enableSourceMap() {
|
|
|
175
175
|
if (process.env.UNI_APP_SOURCEMAP === 'false') {
|
|
176
176
|
return false;
|
|
177
177
|
}
|
|
178
|
+
if (process.env.NODE_ENV === 'development' &&
|
|
179
|
+
process.env.UNI_PLATFORM === 'app' &&
|
|
180
|
+
process.env.UNI_APP_X !== 'true') {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
178
183
|
return process.env.NODE_ENV === 'development' && isNormalCompileTarget();
|
|
179
184
|
}
|
|
180
185
|
exports.enableSourceMap = enableSourceMap;
|
package/dist/uts.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { EasycomMatcher } from './easycom';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function resolveUTSAppModule(platform: typeof process.env.UNI_UTS_PLATFORM, id: string, importer: string, includeUTSSDK?: boolean): string | undefined;
|
|
13
13
|
export declare function resolveUTSModule(id: string, importer: string, includeUTSSDK?: boolean): string | undefined;
|
|
14
|
+
export declare function hasUTSModulePlatformFile(pluginDir: string, platform: typeof process.env.UNI_UTS_PLATFORM): boolean;
|
|
14
15
|
export declare function resolveUTSCompiler(throwError?: boolean): typeof UTSCompiler;
|
|
15
16
|
export declare function resolveUTSCompilerVersion(): string;
|
|
16
17
|
interface UTSComponentMeta {
|