-export default {
- input: ['src/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 })] }
- },
- external: ['basic-ftp', 'chalk', 'crypto', 'fs', '@mikro-orm/core', '@mikro-orm/reflection', 'mongodb', 'path', 'perf_hooks', 'poolifier', 'proper-lockfile', 'reflect-metadata', 'tar', 'url', 'uuid', 'ws', 'winston-daily-rotate-file', 'winston/lib/winston/transports', 'winston', 'worker_threads'],
+export default defineConfig({
+ input: ['./src/start.ts', './src/charging-station/ChargingStationWorker.ts'],
+ strictDeprecations: true,
+ output: [
+ {
+ dir: './dist',
+ format: 'esm',
+ sourcemap,
+ plugins: [terser({ maxWorkers: Math.floor(availableParallelism() / 2) })],
+ },
+ ],
+ external: [
+ '@mikro-orm/core',
+ '@mikro-orm/reflection',
+ 'ajv',
+ 'ajv-formats',
+ 'basic-ftp',
+ 'chalk',
+ 'date-fns',
+ 'deep-clone',
+ 'http-status-codes',
+ 'just-merge',
+ 'mnemonist/lru-map-with-delete.js',
+ 'mnemonist/queue.js',
+ 'mongodb',
+ 'node:async_hooks',
+ 'node:crypto',
+ 'node:events',
+ 'node:fs',
+ 'node:http',
+ 'node:http2',
+ 'node:path',
+ 'node:perf_hooks',
+ 'node:process',
+ 'node:stream',
+ 'node:url',
+ 'node:util',
+ 'node:worker_threads',
+ 'poolifier',
+ 'tar',
+ 'winston',
+ 'winston-daily-rotate-file',
+ 'winston/lib/winston/transports/index.js',
+ 'ws',
+ ],