X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=0b43e8f8d3677921ab5fc3d8054e48dbaaac2382;hb=48b750721134de072049b7d2d7ea94e69428721f;hp=bdc96d661e2eb2d0f0c41ee078bfad4d551cd95a;hpb=44a95b7fc8487ae8116f89820ca03cb108dfada8;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index bdc96d66..0b43e8f8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,71 +1,73 @@ +/* eslint-disable n/no-unpublished-import */ +import json from '@rollup/plugin-json'; +import terser from '@rollup/plugin-terser'; +import typescript from '@rollup/plugin-typescript'; 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 ts from 'rollup-plugin-ts'; const isDevelopmentBuild = process.env.BUILD === 'development'; export default { - input: ['src/start.ts', 'src/ui/httpd/start.ts', 'src/charging-station/ChargingStationWorker.ts'], + input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'], + strictDeprecations: true, output: [ { dir: 'dist', - format: 'es', + format: 'esm', exports: 'auto', sourcemap: true, preserveModules: true, preserveModulesRoot: 'src', entryFileNames: '[name].mjs', - ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }), - }, - { - dir: 'dist', - format: 'cjs', - exports: 'auto', - sourcemap: true, - preserveModules: true, - preserveModulesRoot: 'src', - entryFileNames: '[name].cjs', - ...(!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }), + ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }), }, ], external: [ - 'basic-ftp', - 'chalk', - 'crypto', - 'express', - 'fs', '@mikro-orm/core', '@mikro-orm/reflection', - 'mnemonist/lru-map-with-delete', + 'ajv', + 'ajv-formats', + 'basic-ftp', + 'chalk', + 'http-status-codes', + 'just-clone', + 'just-merge', + 'mnemonist/lru-map-with-delete.js', 'moment', 'mongodb', - 'path', - 'perf_hooks', + 'node:async_hooks', + 'node:crypto', + 'node:fs', + 'node:http', + 'node:path', + 'node:perf_hooks', + 'node:stream', + 'node:url', + 'node:util', + 'node:worker_threads', 'poolifier', 'proper-lockfile', - 'reflect-metadata', 'tar', - 'url', - 'uuid', - 'ws', + 'winston', 'winston-daily-rotate-file', 'winston/lib/winston/transports/index.js', - 'winston', - 'worker_threads', + 'ws', ], plugins: [ json(), - ts({ + typescript({ tsconfig: 'tsconfig.json', - browserslist: false, }), - isDevelopmentBuild && istanbul(), del({ - targets: ['dist/*', '!dist/assets', 'dist/assets/*.json', 'dist/assets/station-templates'], + targets: [ + 'dist/*', + '!dist/assets', + 'dist/assets/*.json', + 'dist/assets/json-schemas', + 'dist/assets/station-templates', + 'dist/assets/ui-protocol', + ], }), copy({ targets: [{ src: 'src/assets', dest: 'dist/' }],