X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.js;h=e086e90909abc0385768a0ba84ed847edf964e0b;hb=073bd0984b486270c4537353b7e96b7111adcbb3;hp=46683b3b1f9900d71aaf90b136efe296947936eb;hpb=4082efc1bec069b34506a467524b5d4bb9013202;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.js b/rollup.config.js index 46683b3b..e086e909 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: ['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: [ json(), - typescript({ - tsconfig: 'tsconfig.json' + ts({ + tsconfig: 'tsconfig.json', + browserslist: false, }), isDevelopmentBuild && istanbul(), del({ - targets: 'dist/*' + targets: ['dist/*', '!dist/assets', 'dist/assets/*.json', 'dist/assets/station-templates'], }), copy({ - targets: [ - { src: 'src/assets', dest: 'dist/' } - ] + targets: [{ src: 'src/assets', dest: 'dist/' }], }), - isDevelopmentBuild && analyze() - ] + isDevelopmentBuild && analyze(), + ], };