mirror of https://github.com/ElemeFE/element
Fix build common config
parent
426ce5da36
commit
0a2ec8efb0
|
@ -1,5 +1,6 @@
|
|||
var Components = require('../components.json');
|
||||
var path = require('path');
|
||||
var dependencies = require('../package.json').dependencies;
|
||||
var externals = {};
|
||||
|
||||
Object.keys(Components).forEach(function(key) {
|
||||
|
@ -7,18 +8,16 @@ Object.keys(Components).forEach(function(key) {
|
|||
externals[`element-ui/packages/${key}/style.css`] = `element-ui/lib/${key}/style.css`;
|
||||
});
|
||||
|
||||
Object.keys(dependencies).forEach(function (key) {
|
||||
externals[key] = key;
|
||||
});
|
||||
|
||||
externals['element-ui/src/utils/clickoutside'] = 'element-ui/lib/utils/clickoutside';
|
||||
externals['element-ui/src/utils/popper'] = 'element-ui/lib/utils/popper';
|
||||
externals['element-ui/src/utils/vue-popper'] = 'element-ui/lib/utils/vue-popper';
|
||||
externals['vue-popup'] = 'vue-popup';
|
||||
|
||||
exports.externals = Object.assign({
|
||||
vue: {
|
||||
root: 'Vue',
|
||||
commonjs: 'vue',
|
||||
commonjs2: 'vue',
|
||||
amd: 'vue'
|
||||
}
|
||||
vue: 'vue'
|
||||
}, externals);
|
||||
|
||||
exports.alias = {
|
||||
|
@ -28,4 +27,11 @@ exports.alias = {
|
|||
'element-ui': path.resolve(__dirname, '../')
|
||||
};
|
||||
|
||||
exports.vue = {
|
||||
root: 'Vue',
|
||||
commonjs: 'vue',
|
||||
commonjs2: 'vue',
|
||||
amd: 'vue'
|
||||
};
|
||||
|
||||
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date.\js/;
|
||||
|
|
|
@ -9,7 +9,7 @@ cooking.set({
|
|||
moduleName: 'ELEMENT',
|
||||
extends: ['vue2'],
|
||||
alias: config.alias,
|
||||
externals: { vue: config.externals.vue }
|
||||
externals: { vue: config.vue }
|
||||
});
|
||||
|
||||
cooking.add('output.filename', 'index.js');
|
||||
|
|
Loading…
Reference in New Issue