build(ui): refine tsconfig.json
[e-mobility-charging-stations-simulator.git] / rollup.config.mjs
index baaeda78fe4753b19b52de5620f07ace98e20512..6ba6851921ad50c39170767bfef9487d6a0ffa59 100644 (file)
@@ -14,9 +14,9 @@ const availableParallelism = () => {
   try {
     availableParallelism = os.availableParallelism();
   } catch {
-    const numberOfCpus = os.cpus();
-    if (Array.isArray(numberOfCpus) && numberOfCpus.length > 0) {
-      availableParallelism = numberOfCpus.length;
+    const cpus = os.cpus();
+    if (Array.isArray(cpus) && cpus.length > 0) {
+      availableParallelism = cpus.length;
     }
   }
   return availableParallelism;
@@ -24,15 +24,16 @@ const availableParallelism = () => {
 
 const isDevelopmentBuild = process.env.BUILD === 'development';
 const isAnalyzeBuild = process.env.ANALYZE;
+const sourceMap = !!isDevelopmentBuild;
 
 export default {
-  input: ['src/start.ts', 'src/charging-station/ChargingStationWorker.ts'],
+  input: ['./src/start.ts', './src/charging-station/ChargingStationWorker.ts'],
   strictDeprecations: true,
   output: [
     {
-      dir: 'dist',
+      dir: './dist',
       format: 'esm',
-      sourcemap: !!isDevelopmentBuild,
+      sourcemap: sourceMap,
       plugins: [terser({ maxWorkers: Math.floor(availableParallelism() / 2) })],
     },
   ],
@@ -44,8 +45,8 @@ export default {
     'basic-ftp',
     'chalk',
     'date-fns',
+    'deep-clone',
     'http-status-codes',
-    'just-clone',
     'just-merge',
     'mnemonist/lru-map-with-delete.js',
     'mnemonist/queue.js',
@@ -55,6 +56,7 @@ export default {
     'node:events',
     'node:fs',
     'node:http',
+    'node:http2',
     'node:path',
     'node:perf_hooks',
     'node:stream',
@@ -71,23 +73,23 @@ export default {
   plugins: [
     json(),
     typescript({
-      tsconfig: 'tsconfig.json',
+      tsconfig: './tsconfig.json',
       compilerOptions: {
-        sourceMap: !!isDevelopmentBuild,
+        sourceMap,
       },
     }),
     del({
       targets: [
-        'dist/*',
-        '!dist/assets',
-        'dist/assets/*.json',
-        'dist/assets/json-schemas',
-        'dist/assets/station-templates',
-        'dist/assets/ui-protocol',
+        './dist/*',
+        '!./dist/assets',
+        './dist/assets/*.json',
+        './dist/assets/json-schemas',
+        './dist/assets/station-templates',
+        './dist/assets/ui-protocol',
       ],
     }),
     copy({
-      rootDir: 'src',
+      rootDir: './src',
       patterns: 'assets/**/*.json',
       exclude: [
         'assets/config-template.json',