build(simulator): always minify bundle
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 28 May 2023 11:26:12 +0000 (13:26 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 28 May 2023 11:26:12 +0000 (13:26 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.vscode/settings.json
rollup.config.mjs

index 4ae6a955b38cf370d408a88bf07213f390b93322..d1b98041a0fe38ab128f61fe3d9f11121b59041a 100644 (file)
@@ -17,6 +17,7 @@
     "commitlint",
     "corepack",
     "csms",
+    "emerg",
     "emobility",
     "evse",
     "evses",
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: [