forked from sap-labs-france/ev-simulator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
41 lines (39 loc) · 1.26 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import analyze from 'rollup-plugin-analyzer';
import copy from 'rollup-plugin-copy';
import del from 'rollup-plugin-delete';
import istanbul from 'rollup-plugin-istanbul';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
import ts from 'rollup-plugin-ts';
const isDevelopmentBuild = process.env.BUILD === 'development';
export default {
input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
output:
{
dir: 'dist',
format: 'cjs',
exports: 'auto',
sourcemap: true,
preserveModules: true,
preserveModulesRoot: 'src',
...!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }
},
external: ['basic-ftp', 'chalk', 'crypto', 'fs', '@mikro-orm/core', '@mikro-orm/reflection', 'mongodb', 'path', 'perf_hooks', 'poolifier', 'proper-lockfile', 'reflect-metadata', 'tar', 'url', 'uuid', 'ws', 'winston-daily-rotate-file', 'winston/lib/winston/transports', 'winston', 'worker_threads'],
plugins: [
json(),
ts({
tsconfig: 'tsconfig.json',
browserslist: false
}),
isDevelopmentBuild && istanbul(),
del({
targets: 'dist/*'
}),
copy({
targets: [
{ src: 'src/assets', dest: 'dist/' }
]
}),
isDevelopmentBuild && analyze()
]
};