vant/build/webpack.components.js
2017-07-31 10:54:56 +08:00

32 lines
593 B
JavaScript

const path = require('path');
const Components = require('../components.json');
const config = require('./webpack.build.js');
const webpack = require('webpack');
delete config.devtool;
const entry = {};
Object.keys(Components).forEach(key => {
entry[key + '/index'] = Components[key];
});
config.entry = entry;
config.externals = {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
}
};
config.output = {
path: path.join(__dirname, '../lib'),
filename: '[name].js',
libraryExport: "default",
libraryTarget: 'umd'
};
module.exports = config;