refactor: cleanup bundling code
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 30 Dec 2023 13:58:10 +0000 (14:58 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 30 Dec 2023 13:58:10 +0000 (14:58 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
bundle.js

index e96d450c0152ffbd43391a844b4492d05ae82024..0d609c2d789aa4e9c0ef568bfcbc57b9b3d7a792 100644 (file)
--- a/bundle.js
+++ b/bundle.js
@@ -5,11 +5,9 @@ import chalk from 'chalk'
 import { build } from 'esbuild'
 import { clean } from 'esbuild-plugin-clean'
 import { copy } from 'esbuild-plugin-copy'
-
-const isDevelopmentBuild = env.BUILD === 'development'
-const sourcemap = !!isDevelopmentBuild
-
 ;(async () => {
+  const isDevelopmentBuild = env.BUILD === 'development'
+  const sourcemap = !!isDevelopmentBuild
   console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'production'} mode`))
   console.time('Build time')
   await build({