Apply prettier formating
[e-mobility-charging-stations-simulator.git] / rollup.config.js
CommitLineData
cb1948a3 1import analyze from 'rollup-plugin-analyzer';
c4a19794 2import copy from 'rollup-plugin-copy';
44b07a21 3import del from 'rollup-plugin-delete';
4082efc1 4import istanbul from 'rollup-plugin-istanbul';
84e52c2c 5import json from '@rollup/plugin-json';
fc201913 6import { terser } from 'rollup-plugin-terser';
ae8ee665 7import ts from 'rollup-plugin-ts';
44b07a21 8
1d064457
JB
9const isDevelopmentBuild = process.env.BUILD === 'development';
10
44b07a21 11export default {
07f35004 12 input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
e7aeea18 13 output: {
44b07a21
JB
14 dir: 'dist',
15 format: 'cjs',
16 exports: 'auto',
17 sourcemap: true,
18 preserveModules: true,
fc201913 19 preserveModulesRoot: 'src',
e7aeea18 20 ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }),
44b07a21 21 },
e7aeea18
JB
22 external: [
23 'basic-ftp',
24 'chalk',
25 'crypto',
26 'fs',
27 '@mikro-orm/core',
28 '@mikro-orm/reflection',
29 'mongodb',
30 'path',
31 'perf_hooks',
32 'poolifier',
33 'proper-lockfile',
34 'reflect-metadata',
35 'tar',
36 'url',
37 'uuid',
38 'ws',
39 'winston-daily-rotate-file',
40 'winston/lib/winston/transports',
41 'winston',
42 'worker_threads',
43 ],
44b07a21 44 plugins: [
84e52c2c 45 json(),
ae8ee665
JB
46 ts({
47 tsconfig: 'tsconfig.json',
e7aeea18 48 browserslist: false,
44b07a21 49 }),
4082efc1 50 isDevelopmentBuild && istanbul(),
44b07a21 51 del({
e7aeea18 52 targets: 'dist/*',
c4a19794
JB
53 }),
54 copy({
e7aeea18 55 targets: [{ src: 'src/assets', dest: 'dist/' }],
cb1948a3 56 }),
e7aeea18
JB
57 isDevelopmentBuild && analyze(),
58 ],
44b07a21 59};