Update package.json & webpack

This commit is contained in:
Gennady Grishkovtsov
2018-10-05 22:51:20 +03:00
parent 206216643a
commit 5d8139d674
4 changed files with 82 additions and 73 deletions

View File

@@ -1,9 +1,11 @@
const path = require('path')
const webpack = require('webpack')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
devtool: '#source-map',
entry: './src/index.js',
entry: {
main: './src/index.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'vue-audio-recorder.min.js',
@@ -12,18 +14,21 @@ module.exports = {
libraryExport: 'default',
umdNamedDefine: true
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true
})
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: true
}
}),
new webpack.LoaderOptionsPlugin({
minimize: false
})