X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=b5c0b285b77b8daa31ab63e4cd19f5152e688825;hb=0ea4c06708c761b6b4bd2f33336df61993672a0c;hp=99f833b4108e3f5b799b0310eef99d10ddde4122;hpb=5119cf1a3864eaadb079ae68df6d4dae1a52b2cb;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 99f833b4..b5c0b285 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,3 +1,4 @@ +import { cpus } from 'node: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 = 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 })] }) } ], @@ -46,6 +49,7 @@ export default { 'node:crypto', 'node:events', 'node:os', + 'node:perf_hooks', 'node:worker_threads' ], plugins: [