2018-03-13 13:44:08 -04:00
|
|
|
const path = require('path')
|
2018-03-13 07:19:30 -04:00
|
|
|
const webpack = require('webpack')
|
|
|
|
const merge = require('webpack-merge')
|
|
|
|
|
|
|
|
const base = require('./webpack.config')
|
|
|
|
|
|
|
|
module.exports = merge(base, {
|
2018-04-06 06:28:21 -04:00
|
|
|
devtool: false,
|
2018-03-13 07:19:30 -04:00
|
|
|
|
2018-03-13 13:44:08 -04:00
|
|
|
output: {
|
|
|
|
// Override output path to minjs dir
|
|
|
|
path: path.join(__dirname, '/public/minjs/es'),
|
|
|
|
},
|
|
|
|
|
2018-03-13 07:19:30 -04:00
|
|
|
plugins: [
|
|
|
|
// Use UglifyJS to minimise output
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
// Enable compression (options here are UglifyJS options)
|
|
|
|
compress: {
|
|
|
|
drop_console: true, // Remove console logs
|
|
|
|
warnings: false // Silence Uglify warnings
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
comments: false // Remove comments
|
|
|
|
},
|
|
|
|
// Prevent source map files from being stripped out of bundle
|
|
|
|
sourceMap: true
|
|
|
|
})
|
|
|
|
]
|
|
|
|
})
|