/* 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,
'winston',
'winston/*',
'winston-daily-rotate-file',
- 'ws',
+ 'ws'
],
minify: true,
sourcemap,
'./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')
+})()