X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=0b43e8f8d3677921ab5fc3d8054e48dbaaac2382;hb=2585c6e94e3d900bf7ecca428299df1e649252db;hp=231b7485adaa49fa621505f85b16bd197c44c91a;hpb=088ee3c1ea0466521948c3911da0db8517ea5b97;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 231b7485..0b43e8f8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,81 +1,72 @@ +/* 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: [ '@mikro-orm/core', '@mikro-orm/reflection', 'ajv', - 'ajv-draft-04', 'ajv-formats', - 'async_hooks', 'basic-ftp', 'chalk', - 'crypto', - 'fs', - 'http', 'http-status-codes', 'just-clone', 'just-merge', - 'mnemonist/lru-map-with-delete', + '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', 'winston', 'winston-daily-rotate-file', 'winston/lib/winston/transports/index.js', - 'worker_threads', '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({