X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.js;h=3900559c0e016c2a482f2a7b56a5acc450402b5e;hb=107efcc6655b5a4409fc5db3da90869d6881a195;hp=16624fced18a1d063567805f42f069b6a20ae270;hpb=cb1948a3ff8766777ac895efe645618278ee5ff3;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.js b/rollup.config.js index 16624fce..3900559c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,25 +1,33 @@ import analyze from 'rollup-plugin-analyzer'; import copy from 'rollup-plugin-copy'; import del from 'rollup-plugin-delete'; -import typescript from 'rollup-plugin-typescript2'; +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/StationWorker.ts'], - output: { + input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'], + output: + { dir: 'dist', format: 'cjs', exports: 'auto', sourcemap: true, preserveModules: true, - preserveModulesRoot: 'src' + preserveModulesRoot: 'src', + ...!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] } }, - external: ['crypto', 'perf_hooks', 'fs', 'path', 'poolifier', 'uuid', 'ws', 'winston-daily-rotate-file', 'winston/lib/winston/transports', 'winston', 'worker_threads'], + 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: [ - typescript({ - tsconfig: 'tsconfig.json' + json(), + ts({ + tsconfig: 'tsconfig.json', + browserslist: false }), + isDevelopmentBuild && istanbul(), del({ targets: 'dist/*' }),