X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=8ca037fb9f24753c042ee475b786197d2c36d51e;hb=111aaf897c1c7b5c2f48678923a458f62406e3e2;hp=a0128a547b2bcb4cbf8999e37157aefaf885da00;hpb=b768993dd4636df8276b0ea47158dd9bdc9a997b;p=e-mobility-charging-stations-simulator.git diff --git a/rollup.config.mjs b/rollup.config.mjs index a0128a54..8ca037fb 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,3 +1,4 @@ +/* eslint-disable n/no-unpublished-import */ import json from '@rollup/plugin-json'; import terser from '@rollup/plugin-terser'; import typescript from '@rollup/plugin-typescript'; @@ -6,6 +7,7 @@ import copy from 'rollup-plugin-copy'; import del from 'rollup-plugin-delete'; const isDevelopmentBuild = process.env.BUILD === 'development'; +const isAnalyzeBuild = process.env.ANALYZE; export default { input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'], @@ -15,20 +17,7 @@ export default { dir: 'dist', format: 'esm', exports: 'auto', - sourcemap: true, - preserveModules: true, - preserveModulesRoot: 'src', - entryFileNames: '[name].mjs', - ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }), - }, - { - dir: 'dist', - format: 'cjs', - exports: 'auto', - sourcemap: true, - preserveModules: true, - preserveModulesRoot: 'src', - entryFileNames: '[name].cjs', + ...(isDevelopmentBuild && { sourcemap: true }), ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }), }, ], @@ -56,7 +45,6 @@ export default { 'node:util', 'node:worker_threads', 'poolifier', - 'proper-lockfile', 'tar', 'winston', 'winston-daily-rotate-file', @@ -73,13 +61,14 @@ export default { 'dist/*', '!dist/assets', 'dist/assets/*.json', - 'dist/assets/station-templates', 'dist/assets/json-schemas', + 'dist/assets/station-templates', + 'dist/assets/ui-protocol', ], }), copy({ targets: [{ src: 'src/assets', dest: 'dist/' }], }), - isDevelopmentBuild && analyze(), + isAnalyzeBuild && analyze(), ], };