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