提交 5bdb0cc8 编写于 作者: X xuguodong

Merge branch 'com_export' into '0.3.x-alpha'

组件导出依赖分离

See merge request beatles-component/new-open-chameleon-sets!77
......@@ -5,12 +5,18 @@ const CleanWebpackPlugin = require('clean-webpack-plugin')
var path = require('path');
module.exports = function (config, options) {
let { type, root } = options;
let { type, root, externals } = options;
let outputPath = options.outputPath || path.resolve(root, `dist/export/${type}`);
if (externals) {
Object.keys(externals).forEach(key => {
externals[key] = `require('${externals[key]}')`;
})
}
return merge(config, {
output: {
path: outputPath
},
externals,
plugins: [
new CleanWebpackPlugin(['./*'], {root: outputPath, verbose: false})
]
......
......@@ -14,7 +14,8 @@ module.exports = function(options) {
media,
root,
disableExtract,
mode = 'production'
mode = 'production',
externals
} = options;
function getstaticPath(filetype) {
......@@ -176,6 +177,11 @@ module.exports = function(options) {
)
}
if (externals) {
exportConfig.externals = externals;
}
return merge.smart(getWebCommonConfig(options), exportConfig);
......
......@@ -11,7 +11,8 @@ module.exports = function(options) {
let {
media,
root,
mode = 'production'
mode = 'production',
externals
} = options;
......@@ -153,6 +154,9 @@ module.exports = function(options) {
]
}
if (externals) {
exportConfig.externals = externals;
}
return merge.smart(getWeexCommonConfig(options), exportConfig)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册