1 import json from '@rollup/plugin-json';
2 import terser from '@rollup/plugin-terser';
3 import typescript from '@rollup/plugin-typescript';
4 import analyze from 'rollup-plugin-analyzer';
5 import copy from 'rollup-plugin-copy';
6 import del from 'rollup-plugin-delete';
8 const isDevelopmentBuild = process.env.BUILD === 'development';
11 input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
12 strictDeprecations: true,
19 preserveModules: true,
20 preserveModulesRoot: 'src',
21 entryFileNames: '[name].mjs',
22 ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }),
29 preserveModules: true,
30 preserveModulesRoot: 'src',
31 entryFileNames: '[name].cjs',
32 ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }),
37 '@mikro-orm/reflection',
45 'mnemonist/lru-map-with-delete.js',
57 'node:worker_threads',
62 'winston-daily-rotate-file',
63 'winston/lib/winston/transports/index.js',
69 tsconfig: 'tsconfig.json',
76 'dist/assets/json-schemas',
77 'dist/assets/station-templates',
78 'dist/assets/ui-protocol',
82 targets: [{ src: 'src/assets', dest: 'dist/' }],
84 isDevelopmentBuild && analyze(),