提交 23f1c944 编写于 作者: fxy060608's avatar fxy060608

feat(mp-alipay): custom mini.project.json (#3929)

上级 29b404ee
const path = require('path')
const { parseJson } = require('@dcloudio/uni-cli-shared/lib/json')
const {
parseJson
} = require('@dcloudio/uni-cli-shared/lib/json')
module.exports = {
options: {
......@@ -17,7 +19,8 @@ module.exports = {
filter: '.sjs'
},
filterTag: 'sjs',
subPackages: true
subPackages: true,
project: 'mini.project.json'
},
copyWebpackOptions (platformOptions, vueOptions) {
const copyOptions = ['mycomponents', 'customize-tab-bar', 'ext.json']
......
const fs = require('fs')
const path = require('path')
const {
parsePages
parsePages,
getPlatformProject
} = require('@dcloudio/uni-cli-shared')
const {
......@@ -84,13 +88,21 @@ module.exports = function (pagesJson, manifestJson) {
if (app.usingComponents) {
updateAppJsonUsingComponents(app.usingComponents)
}
const projectName = getPlatformProject()
const project = Object.assign({
appid: platformJson.appid
})
let project = {}
const projectPath = path.resolve(process.env.UNI_INPUT_DIR, projectName)
if (fs.existsSync(projectPath)) {
project = require(projectPath)
} else {
if (platformJson.appid) {
project.appid = platformJson.appid
}
project.component2 = hasOwn(platformJson, 'component2') ? platformJson.component2 : true
project.enableAppxNg = hasOwn(platformJson, 'enableAppxNg') ? platformJson.enableAppxNg : true
}
return [{
name: 'app',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册