X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=a251ff5dab1ce283387aaac2246466b27be669ee;hb=7e0bf360b5f927c14f2e309be297883dbd547237;hp=6b113491dc7bc668d70e8eba682e9d32a50a544d;hpb=130783a74f495abcb198b7f01abe19dab4f7fb47;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 6b113491..a251ff5d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,34 +1,26 @@ +/* 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 { 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/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: [ @@ -36,44 +28,44 @@ export default { '@mikro-orm/reflection', 'ajv', 'ajv-formats', - 'async_hooks', 'basic-ftp', 'chalk', - 'http', 'http-status-codes', 'just-clone', 'just-merge', - 'mnemonist/lru-map-with-delete', + 'mnemonist/lru-map-with-delete.js', 'moment', 'mongodb', + 'node:async_hooks', 'node:crypto', 'node:fs', + 'node:http', 'node:path', + 'node:perf_hooks', + 'node:stream', 'node:url', 'node:util', - 'perf_hooks', + 'node:worker_threads', 'poolifier', - 'proper-lockfile', 'tar', 'winston', 'winston-daily-rotate-file', - 'winston/lib/winston/transports', - 'worker_threads', + 'winston/lib/winston/transports/index.js', 'ws', ], plugins: [ json(), - ts({ + typescript({ tsconfig: 'tsconfig.json', - browserslist: false, }), del({ targets: [ 'dist/*', '!dist/assets', 'dist/assets/*.json', - 'dist/assets/station-templates', 'dist/assets/json-schemas', + 'dist/assets/station-templates', + 'dist/assets/ui-protocol', ], }), copy({