Add initial unit tests: circular array
[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';
c4a19794 7import typescript from 'rollup-plugin-typescript2';
44b07a21 8
1d064457
JB
9const isDevelopmentBuild = process.env.BUILD === 'development';
10
44b07a21
JB
11export default {
12 input: ['src/start.ts', 'src/charging-station/StationWorker.ts'],
fc201913
JB
13 output:
14 {
44b07a21
JB
15 dir: 'dist',
16 format: 'cjs',
17 exports: 'auto',
18 sourcemap: true,
19 preserveModules: true,
fc201913
JB
20 preserveModulesRoot: 'src',
21 ...!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }
44b07a21 22 },
1d064457 23 external: ['crypto', 'perf_hooks', 'fs', 'path', 'poolifier', 'uuid', 'ws', 'winston-daily-rotate-file', 'winston/lib/winston/transports', 'winston', 'worker_threads'],
44b07a21 24 plugins: [
84e52c2c 25 json(),
c4a19794 26 typescript({
44b07a21
JB
27 tsconfig: 'tsconfig.json'
28 }),
4082efc1 29 isDevelopmentBuild && istanbul(),
44b07a21
JB
30 del({
31 targets: 'dist/*'
c4a19794
JB
32 }),
33 copy({
34 targets: [
35 { src: 'src/assets', dest: 'dist/' }
36 ]
cb1948a3
JB
37 }),
38 isDevelopmentBuild && analyze()
44b07a21
JB
39 ]
40};