mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Build React in production mode by default
https://facebook.github.io/react/downloads.html says: "By default, React will be in development mode. To use React in production mode, set the environment variable NODE_ENV to production (using envify or webpack's DefinePlugin). A minifier that performs dead-code elimination such as UglifyJS is recommended to completely remove the extra code present in development mode."
This commit is contained in:
parent
9cb9a05ec0
commit
25b511f3d5
@ -148,6 +148,12 @@ const config = [
|
||||
jQuery: 'jQuery',
|
||||
$: 'jQuery',
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env':{
|
||||
// Builds React in production mode, avoiding console warnings
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
unused: false,
|
||||
|
Loading…
Reference in New Issue
Block a user