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 istanbul from 'rollup-plugin-istanbul';
6 import { terser } from 'rollup-plugin-terser';
7 import ts from 'rollup-plugin-ts';
9 const isDevelopmentBuild = process.env.BUILD === 'development';
12 input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
19 preserveModules: true,
20 preserveModulesRoot: 'src',
21 entryFileNames: '[name].mjs',
22 ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }),
29 preserveModules: true,
30 preserveModulesRoot: 'src',
31 entryFileNames: '[name].cjs',
32 ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }),
37 '@mikro-orm/reflection',
45 'mnemonist/lru-map-with-delete',
57 'winston-daily-rotate-file',
58 'winston/lib/winston/transports/index.js',
65 tsconfig: 'tsconfig.json',
68 isDevelopmentBuild && istanbul(),
74 'dist/assets/station-templates',
75 'dist/assets/json-schemas',
79 targets: [{ src: 'src/assets', dest: 'dist/' }],
81 isDevelopmentBuild && analyze(),