feat(build): optimize build
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-01-15 17:37:26 +01:00
parent 3f51bdd362
commit 8ee3cc8767
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -8,6 +8,8 @@ if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
} }
const TERSER_PARALLEL = process.env.hasOwnProperty('CPU_COUNT') ? parseInt(process.env.CPU_COUNT) : true;
Encore Encore
// directory where compiled assets will be stored // directory where compiled assets will be stored
.setOutputPath('public/build/') .setOutputPath('public/build/')
@ -52,7 +54,7 @@ Encore
}) })
.configureTerserPlugin((config) => { .configureTerserPlugin((config) => {
config.parallel = process.env.CPU_COUNT || true; config.parallel = TERSER_PARALLEL;
}) })
// enables @babel/preset-env polyfills // enables @babel/preset-env polyfills