Skip to content

Commit

Permalink
fix domain config
Browse files Browse the repository at this point in the history
  • Loading branch information
yylgit committed Mar 27, 2019
1 parent 7681756 commit c1dd4b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/chameleon-tool/configs/getCommonConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ module.exports = function (options) {
// 兼容旧版api
let apiPrefix = options.apiPrefix || devApiPrefix;
// 新版api 优先读取domainMap
let domain = options.domain || {};
// 浅拷贝不影响config中的domain
let domain = {};
if (options.domain) {
domain = {
...options.domain
}
}


if (options.media === 'dev') {
Expand Down
2 changes: 1 addition & 1 deletion packages/chameleon-tool/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ _.get = function() {
if (baseConfig) {
platforms.forEach(platform => {
if (chameleonConfig[platform]) {
utils.merge(chameleonConfig[platform], baseConfig);
utils.merge(chameleonConfig[platform], JSON.parse(JSON.stringify(baseConfig)));
}
})
delete chameleonConfig.base;
Expand Down

0 comments on commit c1dd4b4

Please sign in to comment.