X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=bdc96d661e2eb2d0f0c41ee078bfad4d551cd95a;hb=ff82dc5fce136c2a9a677c896d70a19e8d90dfb0;hp=be738ef7d947b67444b9f261c66cd10d5db90d69;hpb=2820900f6eb56e178fda80e6ed7eaaa8103cf0d3;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index be738ef7..bdc96d66 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -10,15 +10,28 @@ const isDevelopmentBuild = process.env.BUILD === 'development'; export default { input: ['src/start.ts', 'src/ui/httpd/start.ts', 'src/charging-station/ChargingStationWorker.ts'], - output: { - dir: 'dist', - format: 'cjs', - exports: 'auto', - sourcemap: true, - preserveModules: true, - preserveModulesRoot: 'src', - ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }), - }, + output: [ + { + dir: 'dist', + format: 'es', + exports: 'auto', + sourcemap: true, + preserveModules: true, + preserveModulesRoot: 'src', + entryFileNames: '[name].mjs', + ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }), + }, + { + dir: 'dist', + format: 'cjs', + exports: 'auto', + sourcemap: true, + preserveModules: true, + preserveModulesRoot: 'src', + entryFileNames: '[name].cjs', + ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }), + }, + ], external: [ 'basic-ftp', 'chalk', @@ -40,7 +53,7 @@ export default { 'uuid', 'ws', 'winston-daily-rotate-file', - 'winston/lib/winston/transports', + 'winston/lib/winston/transports/index.js', 'winston', 'worker_threads', ],