X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=bundle.js;h=455da66fae8497ea74113c1d3813ae34441c765a;hb=73b78a1f75b27bc503f90269690ad71b70f4f2eb;hp=ec12c5da80190df2696f816bae9a3f6015202084;hpb=ce1b06a72900f8c7a22db904ccc922452f5cdf88;p=e-mobility-charging-stations-simulator.git diff --git a/bundle.js b/bundle.js index ec12c5da..455da66f 100644 --- a/bundle.js +++ b/bundle.js @@ -1,17 +1,16 @@ /* 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; - -console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'production'} mode`)); -(async () => { - console.time('Build time'); +;(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({ entryPoints: ['./src/start.ts', './src/charging-station/ChargingStationWorker.ts'], bundle: true, @@ -27,7 +26,7 @@ console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'pr 'http-status-codes', 'just-merge', 'logform', - 'mnemonist/*', + // 'mnemonist', 'mongodb', 'node:*', 'poolifier', @@ -35,7 +34,7 @@ console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'pr 'winston', 'winston/*', 'winston-daily-rotate-file', - 'ws', + 'ws' ], minify: true, sourcemap, @@ -49,30 +48,30 @@ console.info(chalk.green(`Building in ${isDevelopmentBuild ? 'development' : 'pr './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') +})()