1 /* eslint-disable n/no-unpublished-import */
2 import { cpus } from 'node:os';
4 import json from '@rollup/plugin-json';
5 import terser from '@rollup/plugin-terser';
6 import typescript from '@rollup/plugin-typescript';
7 import { copy } from '@web/rollup-plugin-copy';
8 import analyze from 'rollup-plugin-analyzer';
9 import del from 'rollup-plugin-delete';
11 const isDevelopmentBuild = process.env.BUILD === 'development';
12 const isAnalyzeBuild = process.env.ANALYZE;
15 input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
16 strictDeprecations: true,
21 sourcemap: !!isDevelopmentBuild,
22 plugins: [terser({ maxWorkers: cpus().length / 2 })],
27 '@mikro-orm/reflection',
48 'node:worker_threads',
52 'winston-daily-rotate-file',
53 'winston/lib/winston/transports/index.js',
59 tsconfig: 'tsconfig.json',
61 sourceMap: !!isDevelopmentBuild,
69 'dist/assets/json-schemas',
70 'dist/assets/station-templates',
71 'dist/assets/ui-protocol',
76 patterns: 'assets/**/*.json',
78 'assets/config-template.json',
79 'assets/*config[-_.]*.json',
80 'assets/idtags-template.json',
81 'assets/authorization-tags-template.json',
82 'assets/ui-protocol/**/*',
85 isAnalyzeBuild && analyze(),