2016-09-26 19:01:53 +08:00
|
|
|
var Components = require('../components.json');
|
|
|
|
var path = require('path');
|
2016-10-17 17:47:24 +08:00
|
|
|
var dependencies = require('../package.json').dependencies;
|
2016-09-26 19:01:53 +08:00
|
|
|
var externals = {};
|
|
|
|
|
|
|
|
Object.keys(Components).forEach(function(key) {
|
2016-10-13 11:12:24 +08:00
|
|
|
externals[`element-ui/packages/${key}/index.js`] = `element-ui/lib/${key}`;
|
|
|
|
externals[`element-ui/packages/${key}/style.css`] = `element-ui/lib/${key}/style.css`;
|
2016-09-26 19:01:53 +08:00
|
|
|
});
|
|
|
|
|
2016-10-17 17:47:24 +08:00
|
|
|
Object.keys(dependencies).forEach(function (key) {
|
|
|
|
externals[key] = key;
|
|
|
|
});
|
|
|
|
|
2016-10-13 11:12:24 +08:00
|
|
|
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';
|
2016-10-10 11:33:24 +08:00
|
|
|
|
2016-09-26 19:01:53 +08:00
|
|
|
exports.externals = Object.assign({
|
2016-10-17 17:47:24 +08:00
|
|
|
vue: 'vue'
|
2016-09-26 19:01:53 +08:00
|
|
|
}, externals);
|
|
|
|
|
|
|
|
exports.alias = {
|
|
|
|
main: path.resolve(__dirname, '../src'),
|
|
|
|
packages: path.resolve(__dirname, '../packages'),
|
2016-10-13 11:12:24 +08:00
|
|
|
examples: path.resolve(__dirname, '../examples'),
|
|
|
|
'element-ui': path.resolve(__dirname, '../')
|
2016-09-26 19:01:53 +08:00
|
|
|
};
|
|
|
|
|
2016-10-17 17:47:24 +08:00
|
|
|
exports.vue = {
|
|
|
|
root: 'Vue',
|
|
|
|
commonjs: 'vue',
|
|
|
|
commonjs2: 'vue',
|
|
|
|
amd: 'vue'
|
|
|
|
};
|
|
|
|
|
2016-09-26 19:01:53 +08:00
|
|
|
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date.\js/;
|
2016-10-11 19:00:37 +08:00
|
|
|
|
|
|
|
exports.postcss = function(webapck) {
|
|
|
|
return [
|
|
|
|
require('postcss-salad')({
|
|
|
|
browser: ['ie > 8', 'last 2 version'],
|
|
|
|
features: {
|
|
|
|
'partialImport': {
|
|
|
|
addDependencyTo: webapck
|
|
|
|
},
|
|
|
|
'bem': {
|
|
|
|
'shortcuts': {
|
|
|
|
'component': 'b',
|
|
|
|
'modifier': 'm',
|
|
|
|
'descendent': 'e'
|
|
|
|
},
|
|
|
|
'separators': {
|
|
|
|
'descendent': '__',
|
|
|
|
'modifier': '--'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|