Skip to content

Commit

Permalink
Merge pull request #635 from QingWei-Li/fix/dependencies
Browse files Browse the repository at this point in the history
Fix import src file multiple times, fixed #634 #630
  • Loading branch information
Leopoldthecoder committed Oct 25, 2016
2 parents 06b2cab + 1a4905e commit 82232f6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions build/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
var Components = require('../components.json');
var path = require('path');
var dependencies = require('../package.json').dependencies;
var fs = require('fs');

var utilsList = fs.readdirSync(path.resolve(__dirname, '../src/utils'));
var mixinsList = fs.readdirSync(path.resolve(__dirname, '../src/mixins'));
var externals = {};

Object.keys(Components).forEach(function(key) {
Expand All @@ -12,11 +16,14 @@ 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/date'] = 'element-ui/lib/utils/date';
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['element-ui/src/utils/resize-event'] = 'element-ui/lib/utils/resize-event';
utilsList.forEach(function(file) {
file = path.basename(file, '.js');
externals[`element-ui/src/utils/${file}`] = `element-ui/lib/utils/${file}`;
});
mixinsList.forEach(function(file) {
file = path.basename(file, '.js');
externals[`element-ui/src/mixins/${file}`] = `element-ui/lib/mixins/${file}`;
});

exports.externals = Object.assign({
vue: 'vue'
Expand Down

0 comments on commit 82232f6

Please sign in to comment.