mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Copy paste some prod webpack config from v1
This commit is contained in:
parent
de94e33b5d
commit
4a801d266e
1 changed files with 32 additions and 0 deletions
32
services/web/webpack.config.prod.js
Normal file
32
services/web/webpack.config.prod.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
const webpack = require('webpack')
|
||||
const merge = require('webpack-merge')
|
||||
|
||||
const base = require('./webpack.config')
|
||||
|
||||
module.exports = merge(base, {
|
||||
// Enable a full source map.
|
||||
devtool: 'source-map',
|
||||
|
||||
output: {
|
||||
// Overwrite the default filename to include the chunkhash. This versions
|
||||
// the output files so that they can be cached (and cache-busted when they
|
||||
// change)
|
||||
filename: '[name]-[chunkhash].js'
|
||||
},
|
||||
|
||||
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
|
||||
})
|
||||
]
|
||||
})
|
Loading…
Reference in a new issue