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