mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
compile react in production mode
This commit is contained in:
parent
35dc518d05
commit
d1756436e8
2 changed files with 14 additions and 3 deletions
2
services/web/Jenkinsfile
vendored
2
services/web/Jenkinsfile
vendored
|
@ -101,7 +101,7 @@ pipeline {
|
|||
}
|
||||
}
|
||||
steps {
|
||||
sh 'make minify'
|
||||
sh 'WEBPACK_ENV=production make minify'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
|
||||
const MODULES_PATH = path.join(__dirname, '/modules')
|
||||
const webpackENV = process.env.WEBPACK_ENV || 'development'
|
||||
|
||||
// Generate a hash of entry points, including modules
|
||||
const entryPoints = {}
|
||||
|
@ -63,7 +65,16 @@ module.exports = {
|
|||
}]
|
||||
},
|
||||
|
||||
// TODO
|
||||
// plugins: {}
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
// Swaps out checks for NODE_ENV with the env. This is used by various
|
||||
// libs to enable dev-only features. These checks then become something
|
||||
// like `if ('production' == 'production')`. Minification will then strip
|
||||
// the dev-only code from the bundle
|
||||
'process.env': {
|
||||
NODE_ENV: JSON.stringify(webpackENV)
|
||||
},
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue