X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=rollup.config.js;h=be738ef7d947b67444b9f261c66cd10d5db90d69;hb=7c72977bb3400f474c8641fc91d9f54fba25cb64;hp=79cc619ae0b40ab377425b083006716efe7910c2;hpb=84e52c2c9bc85c3b45e61b37b89c3166fae6615e;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.js b/rollup.config.js index 79cc619a..be738ef7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,38 +1,62 @@ import analyze from 'rollup-plugin-analyzer'; import copy from 'rollup-plugin-copy'; 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/ui/httpd/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', + 'express', + 'fs', + '@mikro-orm/core', + '@mikro-orm/reflection', + 'mnemonist/lru-map-with-delete', + 'moment', + '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(), + ], };