X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=bundle.js;h=dea5a97f58449ec15ef63971d195ac9cded35e33;hb=487f0dfd58d97d4755718793e313f02aaddb1a6d;hp=a3b0ad68535cef5a48f7dce1a1af75aa3eb35cb3;hpb=ab34592fea030548808b1c8b5944e9cb17774dcf;p=e-mobility-charging-stations-simulator.git diff --git a/bundle.js b/bundle.js index a3b0ad68..dea5a97f 100644 --- a/bundle.js +++ b/bundle.js @@ -1,6 +1,7 @@ /* eslint-disable n/no-unpublished-import */ import { env } from 'node:process'; +import chalk from 'chalk'; import { build } from 'esbuild'; import { clean } from 'esbuild-plugin-clean'; import { copy } from 'esbuild-plugin-copy'; @@ -8,6 +9,8 @@ import { copy } from 'esbuild-plugin-copy'; const isDevelopmentBuild = env.BUILD === 'development'; const sourcemap = !!isDevelopmentBuild; +console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'production'} mode`)); +console.time('Build time'); (async () => { await build({ entryPoints: ['./src/start.ts', './src/charging-station/ChargingStationWorker.ts'], @@ -38,9 +41,6 @@ const sourcemap = !!isDevelopmentBuild; sourcemap, entryNames: '[name]', outdir: './dist', - banner: { - js: "import { createRequire } from 'module';const require = createRequire(import.meta.url);", - }, plugins: [ clean({ patterns: [ @@ -75,3 +75,4 @@ const sourcemap = !!isDevelopmentBuild; ], }); })(); +console.timeEnd('Build time');