X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=8ca037fb9f24753c042ee475b786197d2c36d51e;hb=baa539e6b66a5c479327f48195df5a4133b8c0e7;hp=0b43e8f8d3677921ab5fc3d8054e48dbaaac2382;hpb=0f4540150dd0b9c8bf96b92182413237e9ac0491;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 0b43e8f8..8ca037fb 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -7,6 +7,7 @@ import copy from 'rollup-plugin-copy'; import del from 'rollup-plugin-delete'; const isDevelopmentBuild = process.env.BUILD === 'development'; +const isAnalyzeBuild = process.env.ANALYZE; export default { input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'], @@ -16,10 +17,7 @@ export default { dir: 'dist', format: 'esm', exports: 'auto', - sourcemap: true, - preserveModules: true, - preserveModulesRoot: 'src', - entryFileNames: '[name].mjs', + ...(isDevelopmentBuild && { sourcemap: true }), ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }), }, ], @@ -47,7 +45,6 @@ export default { 'node:util', 'node:worker_threads', 'poolifier', - 'proper-lockfile', 'tar', 'winston', 'winston-daily-rotate-file', @@ -72,6 +69,6 @@ export default { copy({ targets: [{ src: 'src/assets', dest: 'dist/' }], }), - isDevelopmentBuild && analyze(), + isAnalyzeBuild && analyze(), ], };