Use React production for CI builds

When running Nightly build we want to benefit from the fast runtime that React production offers and get rid of the runtime overhead that comes with development.

We are setting NODE_ENV and not "webpack.mode" to not loose sourcemaps and have minified sources in that environment
This commit is contained in:
Germain Souquet 2021-04-15 15:17:24 +01:00
parent f06eb14c48
commit 0532c9c37b

View File

@ -18,6 +18,20 @@ module.exports = (env, argv) => {
// We override this via environment variable to avoid duplicating the scripts
// in `package.json` just for a different mode.
argv.mode = "development";
// More and more people are using nightly build as their main client
// Libraries like React have a development build that is useful
// when working on the app but adds significant runtime overhead
// We want to use the React production build but not compile the whole
// application to productions standards
additionalPlugins.concat([
new webpack.EnvironmentPlugin({
"NODE_ENV": "production",
}),
new webpack.DefinePlugin({
"process.env.NODE_ENV": "production",
}),
]);
}
const development = {};