X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.js;h=b1114284ea7bbe9d5d596fd46d04ce11f3a8a2e4;hb=d2971a4b3d274f5b79df906a335c6c3b6725b025;hp=58de2f5dfc301c0417fc7feb8c7497737ba5d383;hpb=8eac9a09368f841fc44e980f31674146833e449b;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.js b/rollup.config.js index 58de2f5d..b1114284 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,37 +4,56 @@ 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 typescript from 'rollup-plugin-typescript2'; +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', - ...!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] } + ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }), }, - external: ['basic-ftp', 'chalk', 'crypto', 'perf_hooks', 'fs', 'path', 'poolifier', 'tar', 'url', '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: [ json(), - typescript({ - tsconfig: 'tsconfig.json' + ts({ + tsconfig: 'tsconfig.json', + browserslist: false, }), isDevelopmentBuild && istanbul(), del({ - targets: 'dist/*' + targets: 'dist/*', }), copy({ - targets: [ - { src: 'src/assets', dest: 'dist/' } - ] + targets: [{ src: 'src/assets', dest: 'dist/' }], }), - isDevelopmentBuild && analyze() - ] + isDevelopmentBuild && analyze(), + ], };