From: Jérôme Benoit Date: Sun, 28 May 2023 11:29:52 +0000 (+0200) Subject: build: optimize minification X-Git-Tag: v2.5.0~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=509e904b46dca595dc59803516f9af85368a2860;p=poolifier.git build: optimize minification Signed-off-by: Jérôme Benoit --- diff --git a/rollup.config.mjs b/rollup.config.mjs index 99f833b4..0d5964e5 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,3 +1,4 @@ +import os from 'os' import terser from '@rollup/plugin-terser' import typescript from '@rollup/plugin-typescript' import analyze from 'rollup-plugin-analyzer' @@ -8,6 +9,8 @@ const isDevelopmentBuild = process.env.BUILD === 'development' const isAnalyzeBuild = process.env.ANALYZE const isDocumentationBuild = process.env.DOCUMENTATION +const maxWorkers = os.cpus().length / 2 + export default { input: 'src/index.ts', strictDeprecations: true, @@ -22,7 +25,7 @@ export default { }), ...(!isDevelopmentBuild && { file: 'lib/index.js', - plugins: [terser({ maxWorkers: 2 })] + plugins: [terser({ maxWorkers })] }) }, { @@ -36,7 +39,7 @@ export default { }), ...(!isDevelopmentBuild && { file: 'lib/index.mjs', - plugins: [terser({ maxWorkers: 2 })] + plugins: [terser({ maxWorkers })] }) } ],