Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
447322fc
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
447322fc
编写于
5月 18, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(mp-alipay): app.json support usingComponents (#3525)
上级
d6020a2b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
27 addition
and
9 deletion
+27
-9
packages/uni-cli-shared/src/json/mp/jsonFile.ts
packages/uni-cli-shared/src/json/mp/jsonFile.ts
+6
-1
packages/uni-mp-alipay/src/compiler/options.ts
packages/uni-mp-alipay/src/compiler/options.ts
+1
-0
packages/uni-mp-baidu/src/compiler/options.ts
packages/uni-mp-baidu/src/compiler/options.ts
+1
-0
packages/uni-mp-kuaishou/src/compiler/options.ts
packages/uni-mp-kuaishou/src/compiler/options.ts
+1
-0
packages/uni-mp-qq/src/compiler/options.ts
packages/uni-mp-qq/src/compiler/options.ts
+1
-0
packages/uni-mp-toutiao/src/compiler/options.ts
packages/uni-mp-toutiao/src/compiler/options.ts
+1
-0
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+4
-0
packages/uni-mp-vite/src/plugins/pagesJson.ts
packages/uni-mp-vite/src/plugins/pagesJson.ts
+10
-8
packages/uni-mp-weixin/src/compiler/options.ts
packages/uni-mp-weixin/src/compiler/options.ts
+1
-0
packages/uni-quickapp-webview/src/compiler/options.ts
packages/uni-quickapp-webview/src/compiler/options.ts
+1
-0
未找到文件。
packages/uni-cli-shared/src/json/mp/jsonFile.ts
浏览文件 @
447322fc
...
...
@@ -54,7 +54,9 @@ export function normalizeJsonFilename(filename: string) {
return
normalizeNodeModules
(
filename
)
}
export
function
findChangedJsonFiles
()
{
export
function
findChangedJsonFiles
(
supportGlobalUsingComponents
:
boolean
=
true
)
{
const
changedJsonFiles
=
new
Map
<
string
,
string
>
()
function
findChangedFile
(
filename
:
string
,
json
:
Record
<
string
,
any
>
)
{
const
newJson
=
JSON
.
parse
(
JSON
.
stringify
(
json
))
...
...
@@ -66,6 +68,9 @@ export function findChangedJsonFiles() {
// 格式化为相对路径,这样作为分包也可以直接运行
// app.json mp-baidu 在 win 不支持相对路径。所有平台改用绝对路径
if
(
filename
!==
'
app
'
)
{
if
(
!
supportGlobalUsingComponents
)
{
// TODO 从 appJsonCache 中读取 usingComponents 并 补充到 usingComponents 中
}
Object
.
keys
(
usingComponents
).
forEach
((
name
)
=>
{
const
componentFilename
=
usingComponents
[
name
]
if
(
componentFilename
.
startsWith
(
'
/
'
))
{
...
...
packages/uni-mp-alipay/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -102,6 +102,7 @@ export const options: UniMiniProgramPluginOptions = {
darkmode
:
false
,
subpackages
:
true
,
plugins
:
true
,
usingComponents
:
false
,
normalize
(
appJson
)
{
// 支付宝小程序默认主包,分包 js 模块不共享,会导致 getCurrentInstance,setCurrentInstance 不一致
appJson
.
subPackageBuildType
=
'
shared
'
...
...
packages/uni-mp-baidu/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -66,6 +66,7 @@ export const options: UniMiniProgramPluginOptions = {
app
:
{
darkmode
:
false
,
subpackages
:
true
,
usingComponents
:
true
,
},
project
:
{
filename
:
projectConfigFilename
,
...
...
packages/uni-mp-kuaishou/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -57,6 +57,7 @@ export const options: UniMiniProgramPluginOptions = {
app
:
{
darkmode
:
false
,
subpackages
:
true
,
usingComponents
:
true
,
},
project
:
{
filename
:
projectConfigFilename
,
...
...
packages/uni-mp-qq/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -66,6 +66,7 @@ export const options: UniMiniProgramPluginOptions = {
app
:
{
darkmode
:
false
,
subpackages
:
true
,
usingComponents
:
true
,
normalize
(
appJson
)
{
const
hasUsingComponents
=
appJson
.
usingComponents
&&
Object
.
keys
(
appJson
.
usingComponents
).
length
...
...
packages/uni-mp-toutiao/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -57,6 +57,7 @@ export const options: UniMiniProgramPluginOptions = {
app
:
{
darkmode
:
false
,
subpackages
:
true
,
usingComponents
:
true
,
},
project
:
{
filename
:
projectConfigFilename
,
...
...
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
447322fc
...
...
@@ -59,6 +59,10 @@ export interface UniMiniProgramPluginOptions {
* 是否支持发行插件
*/
plugins
?:
boolean
/**
* 是否支持全局组件
*/
usingComponents
:
boolean
normalize
?:
(
appJson
:
AppJson
)
=>
AppJson
}
project
?:
{
...
...
packages/uni-mp-vite/src/plugins/pagesJson.ts
浏览文件 @
447322fc
...
...
@@ -91,14 +91,16 @@ export function uniPagesJsonPlugin(
}
},
generateBundle
()
{
findChangedJsonFiles
().
forEach
((
value
,
key
)
=>
{
debugPagesJson
(
'
json.changed
'
,
key
)
this
.
emitFile
({
type
:
'
asset
'
,
fileName
:
key
+
'
.json
'
,
source
:
value
,
})
})
findChangedJsonFiles
(
options
.
app
.
usingComponents
).
forEach
(
(
value
,
key
)
=>
{
debugPagesJson
(
'
json.changed
'
,
key
)
this
.
emitFile
({
type
:
'
asset
'
,
fileName
:
key
+
'
.json
'
,
source
:
value
,
})
}
)
},
}
})
...
...
packages/uni-mp-weixin/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -98,6 +98,7 @@ export const options: UniMiniProgramPluginOptions = {
darkmode
:
true
,
subpackages
:
true
,
plugins
:
true
,
usingComponents
:
true
,
},
project
:
{
filename
:
projectConfigFilename
,
...
...
packages/uni-quickapp-webview/src/compiler/options.ts
浏览文件 @
447322fc
...
...
@@ -42,6 +42,7 @@ export const options: UniMiniProgramPluginOptions = {
app
:
{
darkmode
:
false
,
subpackages
:
true
,
usingComponents
:
true
,
},
json
:
{
formatAppJson
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录