iview/build/webpack.dist.locale.config.js

46 lines
1 KiB
JavaScript
Raw Normal View History

2017-09-29 09:45:50 +02:00
const path = require('path');
const webpack = require('webpack');
const entry = require('./locale');
2017-07-17 16:03:21 +08:00
process.env.NODE_ENV = 'production';
module.exports = {
2017-07-17 23:36:33 +08:00
entry,
2017-07-17 16:03:21 +08:00
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
2017-09-29 09:45:50 +02:00
]
2017-07-17 16:03:21 +08:00
},
output: {
path: path.resolve(__dirname, '../dist/locale'),
publicPath: '/dist/locale/',
filename: '[name].js',
library: 'iview/locale',
libraryTarget: 'umd',
umdNamedDefine: true
},
2017-11-16 11:02:01 +08:00
externals: {
vue: {
root: 'Vue',
commonjs: 'vue',
commonjs2: 'vue',
amd: 'vue'
}
},
2017-07-17 16:03:21 +08:00
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
2017-11-09 17:06:49 +08:00
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
2017-07-17 16:03:21 +08:00
})
]
2017-09-29 09:45:50 +02:00
};