16624fced18a1d063567805f42f069b6a20ae270
[e-mobility-charging-stations-simulator.git] / rollup.config.js
1 import analyze from 'rollup-plugin-analyzer';
2 import copy from 'rollup-plugin-copy';
3 import del from 'rollup-plugin-delete';
4 import typescript from 'rollup-plugin-typescript2';
5
6 const isDevelopmentBuild = process.env.BUILD === 'development';
7
8 export default {
9 input: ['src/start.ts', 'src/charging-station/StationWorker.ts'],
10 output: {
11 dir: 'dist',
12 format: 'cjs',
13 exports: 'auto',
14 sourcemap: true,
15 preserveModules: true,
16 preserveModulesRoot: 'src'
17 },
18 external: ['crypto', 'perf_hooks', 'fs', 'path', 'poolifier', 'uuid', 'ws', 'winston-daily-rotate-file', 'winston/lib/winston/transports', 'winston', 'worker_threads'],
19 plugins: [
20 typescript({
21 tsconfig: 'tsconfig.json'
22 }),
23 del({
24 targets: 'dist/*'
25 }),
26 copy({
27 targets: [
28 { src: 'src/assets', dest: 'dist/' }
29 ]
30 }),
31 isDevelopmentBuild && analyze()
32 ]
33 };