3.8.4
先看看案例:
案例1
目录:
build
|- wechatgame
|- wechatgame-SDK
build-templates
|- wechatgame
|- test.js
|- wechatgame-SDK
|- test2.js
打包出来:
build
|- wechatgame
|- test.js
|- test2.js
|- wechatgame-SDK
|- test.js
|- test2.js
build-templates
|- wechatgame
|- test.js
|- wechatgame-SDK
|- test2.js
案例2
目录:
build
|- wechatgame
|- wechatgame-SDK
build-templates
|- wechatgame
|- game.json
其中game.json长这样
{
"plugins": {
"MiniGameCommon": {
"version": "latest",
"provider": "wxaed5ace05d92b218",
"contexts": [
{
"type": "isolatedContext"
}
]
}
},
"resizable": true
}
打包出来:
build/wechatgame-SDK/game.json
- 带有完整的内容
- 带有子包的内容
- 也带有
build-templates里面的plugins和resizable
{
"deviceOrientation": "portrait",
"openDataContext": "openDataContext",
"networkTimeout": {
"request": 5000,
"connectSocket": 5000,
"uploadFile": 5000,
"downloadFile": 500000
},
"plugins": {
"MiniGameCommon": {
"version": "latest",
"provider": "wxaed5ace05d92b218",
"contexts": [
{
"type": "isolatedContext"
}
]
}
},
"resizable": true,
"subpackages": [
{
"name": "xxx",
"root": "subpackages/xxx/"
}
// ...
]
}
build/wechatgame/game.json
- 所有的信息都没了
- 完完全全就是把原来的
game.json删了, 然后把build-templates/game.json复制过来
{
"plugins": {
"MiniGameCommon": {
"version": "latest",
"provider": "wxaed5ace05d92b218",
"contexts": [
{
"type": "isolatedContext"
}
]
}
},
"resizable": true
}
疑问
-
build-templates里面的目录叫wechatgame, 为什么我打包wechatgame-SDK也会生效呢? - 这个目录名, 它是怎么匹配的?
wechatgame是指wechatgame平台呢? 还是指build/wechatgame这个输出目录呢? - 为什么匹配
wechatgame-SDK的时候,game.json是融合json的内容, 但是匹配wechatgame的时候, 确是整个文件删除替换呢?