1 import json from '@rollup/plugin-json';
2 import analyze from 'rollup-plugin-analyzer';
3 import copy from 'rollup-plugin-copy';
4 import del from 'rollup-plugin-delete';
5 import { terser } from 'rollup-plugin-terser';
6 import ts from 'rollup-plugin-ts';
8 const isDevelopmentBuild = process.env.BUILD === 'development';
11 input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
18 preserveModules: true,
19 preserveModulesRoot: 'src',
20 entryFileNames: '[name].mjs',
21 ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }),
28 preserveModules: true,
29 preserveModulesRoot: 'src',
30 entryFileNames: '[name].cjs',
31 ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }),
36 '@mikro-orm/reflection',
46 'mnemonist/lru-map-with-delete',
59 'winston-daily-rotate-file',
60 'winston/lib/winston/transports',
67 tsconfig: 'tsconfig.json',
75 'dist/assets/station-templates',
76 'dist/assets/json-schemas',
80 targets: [{ src: 'src/assets', dest: 'dist/' }],
82 isDevelopmentBuild && analyze(),