提交 fa00fc21 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -7,7 +7,7 @@
获取 topWindow 的样式
> 未发布
> 3.1.0 新增
**平台差异说明**
......@@ -25,7 +25,7 @@ uni.getTopWindowStyle()
获取 leftWindow 的样式
> 未发布
> 3.1.0 新增
**平台差异说明**
......@@ -43,7 +43,7 @@ uni.getLeftWindowStyle()
获取 rightWindow 的样式
> 未发布
> 3.1.0 新增
**平台差异说明**
......
......@@ -17,7 +17,9 @@
- 方式3:原生开发的小程序仍保留,部分新功能使用uni-app开发。
* 使用发行为混合分包的功能
+ 在 HBuilderX 3.1.0+ 中点击发行小程序的菜单,勾选发行混合分包,填写分包目录名称,打包后,将对应目录文件拷贝至已有小程序中,需要自己补充原小程序app.json中的页面或分包配置
![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/dc4655a0-62e2-11eb-bdc1-8bd33eb6adaa.png)
+ 在 cli 中,执行命令:`npm run build:mp-weixin -- --subpackage=sub1``yarn build:mp-weixin --subpackage=sub1`
注意:
......
......@@ -197,24 +197,25 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
if (!isAppView) { // app-plus view不需要copy
plugins.push(new CopyWebpackPlugin(getCopyWebpackPluginOptions(manifestPlatformOptions, vueOptions)))
}
try {
const automatorJson = require.resolve('@dcloudio/uni-automator/dist/automator.json')
plugins.push(new CopyWebpackPlugin([{
from: automatorJson,
to: '../.automator/' + (process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM) +
'/.automator.json',
transform (content) {
if (process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
return JSON.stringify({
version: require('@dcloudio/uni-automator/package.json').version,
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
if (!process.env.UNI_SUBPACKGE) {
try {
const automatorJson = require.resolve('@dcloudio/uni-automator/dist/automator.json')
plugins.push(new CopyWebpackPlugin([{
from: automatorJson,
to: '../.automator/' + (process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM) +
'/.automator.json',
transform (content) {
if (process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
return JSON.stringify({
version: require('@dcloudio/uni-automator/package.json').version,
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
}
return ''
}
return ''
}
}]))
} catch (e) {}
}]))
} catch (e) {}
}
if (process.UNI_SCRIPT_ENV && Object.keys(process.UNI_SCRIPT_ENV).length) {
// custom define
......
......@@ -180,6 +180,8 @@ module.exports = function getSplitChunks () {
}
return true
}
} else {
return hasMainPackageComponent(m.module, subPackageRoot)
}
}
}
......@@ -202,7 +204,7 @@ module.exports = function getSplitChunks () {
matchSubPackages.has(root + '/') &&
!hasMainPackage(chunks) &&
!hasMainPackageComponent(module, matchSubPackages.values().next().value)
) {
) {
if (process.env.UNI_OPT_TRACE) {
console.log(root, module.resource, chunks.map(chunk => chunk.name))
}
......
......@@ -6,8 +6,7 @@ const {
getPlatformExts
} = require('@dcloudio/uni-cli-shared')
const {
getComponentSet,
getJsonFile
getComponentSet
} = require('@dcloudio/uni-cli-shared/lib/cache')
const {
......@@ -151,9 +150,10 @@ module.exports = function generateComponent (compilation, jsonpFunction = 'webpa
if (name.endsWith(fixExtname)) {
const source = assets[name].source()
const [ownerName, parentName, componentName, slotName] = source.split(',')
const json = getJsonFile(ownerName)
if (json) {
const data = JSON.parse(json)
const json = assets[ownerName + '.json']
const jsonSource = json.source()
if (jsonSource) {
const data = JSON.parse(jsonSource)
const usingComponents = data.usingComponents || {}
const componentPath = normalizePath(path.relative('/', usingComponents[parentName]))
const slots = fixSlots[componentPath] = fixSlots[componentPath] || {}
......@@ -221,7 +221,7 @@ function addComponent (name) {
if (fs.existsSync(bakJson)) {
try {
fs.renameSync(bakJson, path.join(process.env.UNI_OUTPUT_DIR, name + '.json'))
} catch (e) {}
} catch (e) { }
}
}
......@@ -229,5 +229,5 @@ function removeUnusedComponent (name) {
try {
fs.renameSync(path.join(process.env.UNI_OUTPUT_DIR, name + '.json'), path.join(process.env.UNI_OUTPUT_DIR, name +
'.bak.json'))
} catch (e) {}
}
} catch (e) { }
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册