X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=bundle.js;h=e96d450c0152ffbd43391a844b4492d05ae82024;hb=be9f397bd55b221c24bacb110a64c21f012f36ab;hp=4bdee327fd0015cef8c3a4bc8c0e79dad72e678f;hpb=b7bf49739aa3aafdcbe6a22243aa4cf0552c5972;p=e-mobility-charging-stations-simulator.git diff --git a/bundle.js b/bundle.js index 4bdee327..e96d450c 100644 --- a/bundle.js +++ b/bundle.js @@ -1,19 +1,17 @@ /* eslint-disable n/no-unpublished-import */ -import { env } from 'node:process'; +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'; +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; +const isDevelopmentBuild = env.BUILD === 'development' +const sourcemap = !!isDevelopmentBuild -(async () => { - console.info( - chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'production'} mode`), - ); - console.time('Build time'); +;(async () => { + console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'production'} mode`)) + console.time('Build time') await build({ entryPoints: ['./src/start.ts', './src/charging-station/ChargingStationWorker.ts'], bundle: true, @@ -37,7 +35,7 @@ const sourcemap = !!isDevelopmentBuild; 'winston', 'winston/*', 'winston-daily-rotate-file', - 'ws', + 'ws' ], minify: true, sourcemap, @@ -51,30 +49,30 @@ const sourcemap = !!isDevelopmentBuild; './dist/assets/*.json', './dist/assets/json-schemas', './dist/assets/station-templates', - './dist/assets/ui-protocol', - ], + './dist/assets/ui-protocol' + ] }), copy({ assets: [ { from: ['./src/assets/config.json'], - to: ['./assets'], + to: ['./assets'] }, { from: ['./src/assets/idtags!(-template)*.json'], - to: ['./assets'], + to: ['./assets'] }, { from: ['./src/assets/json-schemas/**/*.json'], - to: ['./assets/json-schemas'], + to: ['./assets/json-schemas'] }, { from: ['./src/assets/station-templates/**/*.json'], - to: ['./assets/station-templates'], - }, - ], - }), - ], - }); - console.timeEnd('Build time'); -})(); + to: ['./assets/station-templates'] + } + ] + }) + ] + }) + console.timeEnd('Build time') +})()