refactor: cleanup rollup configuration
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 28 Jul 2023 23:44:22 +0000 (01:44 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 28 Jul 2023 23:44:22 +0000 (01:44 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
rollup.config.mjs

index 83c2e009b3d585b1c32afcf611f7cf0bd8046ddb..e06f14d0b64886e63df7a728937f03cd4adab9ab 100644 (file)
@@ -24,6 +24,7 @@ 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'],
@@ -32,7 +33,7 @@ export default {
     {
       dir: 'dist',
       format: 'esm',
-      sourcemap: !!isDevelopmentBuild,
+      sourcemap: sourceMap,
       plugins: [terser({ maxWorkers: Math.floor(availableParallelism() / 2) })],
     },
   ],
@@ -73,7 +74,7 @@ export default {
     typescript({
       tsconfig: 'tsconfig.json',
       compilerOptions: {
-        sourceMap: !!isDevelopmentBuild,
+        sourceMap,
       },
     }),
     del({