build(simulator): always minify bundle
[e-mobility-charging-stations-simulator.git] / rollup.config.mjs
index e660242612b1a9892dd84a0daa390819f3356dda..82b5b79aa27de94041111165e4d95eb415334288 100644 (file)
@@ -1,4 +1,6 @@
 /* eslint-disable n/no-unpublished-import */
+import os from 'os';
+
 import json from '@rollup/plugin-json';
 import terser from '@rollup/plugin-terser';
 import typescript from '@rollup/plugin-typescript';
@@ -16,9 +18,8 @@ export default {
     {
       dir: 'dist',
       format: 'esm',
-      exports: 'auto',
-      ...(isDevelopmentBuild && { sourcemap: true }),
-      ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }),
+      sourcemap: !!isDevelopmentBuild,
+      plugins: [terser({ maxWorkers: os.cpus().length / 2 })],
     },
   ],
   external: [