X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=e78c1e9e26e145eaffa217fb2b0813520e9cf6c4;hb=805e8a892d75e4bd8b75f5b7c76110bde0e2dc81;hp=1e9c26b879efc49e5896f5277f3b6f90f9ef29d5;hpb=0f113d68a22dd919877279d32d8d12058ec06cee;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 1e9c26b8..e78c1e9e 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 })] }), }, ], @@ -38,6 +36,7 @@ export default { 'mongodb', 'node:async_hooks', 'node:crypto', + 'node:events', 'node:fs', 'node:http', 'node:path', @@ -47,7 +46,6 @@ export default { 'node:util', 'node:worker_threads', 'poolifier', - 'proper-lockfile', 'tar', 'winston', 'winston-daily-rotate-file', @@ -57,7 +55,7 @@ export default { plugins: [ json(), typescript({ - tsconfig: 'tsconfig-base.json', + tsconfig: 'tsconfig.json', }), del({ targets: [ @@ -72,6 +70,6 @@ export default { copy({ targets: [{ src: 'src/assets', dest: 'dist/' }], }), - isDevelopmentBuild && analyze(), + isAnalyzeBuild && analyze(), ], };