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