iview/build/webpack.dist.dev.config.js
梁灏 9e74a856f6 update webpack config
update webpack config
2017-03-01 11:35:00 +08:00

51 lines
1.2 KiB
JavaScript

var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
main: './src/index.js'
},
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: '/dist/',
filename: 'iview.js',
library: 'iview',
libraryTarget: 'umd',
umdNamedDefine: true
},
externals: {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
}
},
resolve: {
extensions: ['.js', '.vue']
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
postLoaders: {
html: 'babel-loader'
}
}
},
{
test: /\.js$/,
loader: 'babel-loader', exclude: /node_modules/
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"'
}
})
]
}