Skip to content

Commit ea6941a

Browse files
author
guchengwei
committed
add external option
1 parent c596813 commit ea6941a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

build/webpack.base.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = {
3939
resolveLoader: {
4040
modules
4141
},
42+
externals: config.build.externals,
4243
module: {
4344
rules: [
4445
{

config/argv.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function mergeArgvConfig (config) {
101101
output: argvOutput, // pathString, undefined
102102
config: argvCnf, // pathString, undefined
103103
definePlugin: argvDefinePlugin, // object, undefined
104+
externals: argvExternals, // object, undefined
104105
...resetConfig
105106
} = argv
106107
const mpType = argvComponent ? 'component' : 'page'
@@ -142,6 +143,11 @@ function mergeArgvConfig (config) {
142143
const assetsRoot = path.resolve(outputPath)
143144
defConfig.assetsRoot = assetsRoot
144145
}
146+
147+
// 外部扩展
148+
if (argvExternals && typeof argvExternals === 'object') {
149+
defConfig.externals = argvExternals
150+
}
145151

146152
const allEntry = Object.keys(defConfig.entry)
147153

0 commit comments

Comments
 (0)