build(deps-dev): apply updates
[poolifier.git] / rollup.config.mjs
index 99f833b4108e3f5b799b0310eef99d10ddde4122..7454ef722b2fa32c8987187ec7fb12b5faeb0602 100644 (file)
@@ -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 })]
       })
     }
   ],