From: Jérôme Benoit Date: Sun, 28 May 2023 11:26:12 +0000 (+0200) Subject: build(simulator): always minify bundle X-Git-Tag: v1.2.15~24 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=31b5738e12a713a409827124e88d8bc03bbed519;p=e-mobility-charging-stations-simulator.git build(simulator): always minify bundle Signed-off-by: Jérôme Benoit --- diff --git a/.vscode/settings.json b/.vscode/settings.json index 4ae6a955..d1b98041 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,6 +17,7 @@ "commitlint", "corepack", "csms", + "emerg", "emobility", "evse", "evses", diff --git a/rollup.config.mjs b/rollup.config.mjs index e6602426..82b5b79a 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -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: [