Skip to content

Commit a0e4873

Browse files
committedMar 12, 2020
fix: 升级依赖,修复注册冲突
1 parent b3e293d commit a0e4873

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed
 

Diff for: ‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"license": "MIT",
4040
"peerDependencies": {
41-
"@micro-app/cli": ">=0.3.4",
41+
"@micro-app/cli": ">=0.3.5",
4242
"@micro-app/plugin-webpack": ">=0.0.6"
4343
},
4444
"devDependencies": {
@@ -49,7 +49,7 @@
4949
"webpack": "^4.42.0"
5050
},
5151
"dependencies": {
52-
"@micro-app/cli": "^0.3.4",
52+
"@micro-app/cli": "^0.3.5",
5353
"@micro-app/plugin-webpack": "^0.0.6"
5454
}
5555
}

Diff for: ‎src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const chainConfig = require('./service/chainConfig');
44

55
module.exports = function(api, vueConfig) {
66

7-
const { service } = require('@micro-app/cli');
7+
const { createService } = require('@micro-app/cli');
8+
const service = createService();
89

910
const builtIn = Symbol.for('built-in');
1011

Diff for: ‎src/service/chainConfig.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
'use strict';
22

3-
const { tryRequire } = require('@micro-app/shared-utils');
3+
const { _, tryRequire } = require('@micro-app/shared-utils');
44

55
module.exports = function chainDefault(api, vueConfig, options, webpackConfig) {
66
const webpackConfigAlias = webpackConfig.module.alias || {};
77

8-
[
8+
[ // string
99
'publicPath',
1010
'outputDir',
1111
'assetsDir',
1212
]
1313
.forEach(key => {
14-
if (options[key] !== undefined) {
14+
if (!_.isUndefined(options[key])) {
1515
vueConfig[key] = options[key];
1616
}
1717
});
1818

19-
// devServer
20-
vueConfig.devServer = Object.assign({}, vueConfig.devServer || {}, options.devServer || {});
21-
22-
// pages
23-
vueConfig.pages = Object.assign({}, vueConfig.pages || {}, options.pages || {});
24-
25-
// css
26-
vueConfig.css = Object.assign({}, vueConfig.css || {}, options.css || {});
19+
[ // object
20+
'devServer',
21+
'pages',
22+
'css',
23+
]
24+
.forEach(key => {
25+
if (!_.isEmpty(options[key]) && !_.isUndefined(options[key])) {
26+
vueConfig[key] = Object.assign({}, vueConfig[key] || {}, options[key] || {});
27+
}
28+
});
2729

2830
api.chainWebpack(webpackChain => {
2931
const outputDir = api.resolve(options.outputDir);

Diff for: ‎yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@
323323
dependencies:
324324
sourcemap-codec "^1.4.4"
325325

326-
"@micro-app/cli@^0.3.4":
327-
version "0.3.4"
328-
resolved "https://registry.npm.taobao.org/@micro-app/cli/download/@micro-app/cli-0.3.4.tgz#4d3e5db945e613f9ddfbb45efc0f73289e84df58"
329-
integrity sha1-TT5duUXmE/nd+7Re/A9zKJ6E31g=
326+
"@micro-app/cli@^0.3.5":
327+
version "0.3.5"
328+
resolved "https://registry.yarnpkg.com/@micro-app/cli/-/cli-0.3.5.tgz#a582a13f53951e4e1b1e1356ed8d88dc364c9858"
329+
integrity sha512-uqaBX7JtAzuyWLqYbKnhz0uysCnulio1GVJGSWty/clhX4KsPbgjr+w4WexSOfmR/Jjp6Po4j+VZg2zC3eMPPA==
330330
dependencies:
331331
"@micro-app/core" "^0.3.10"
332332
"@zkochan/cmd-shim" "^3.1.0"

0 commit comments

Comments
 (0)