X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcharging-station%2FBootstrap.ts;h=82aef5cd28c65a1c4be1246c6a6a2ac9fc2b6443;hb=44a95b7fc8487ae8116f89820ca03cb108dfada8;hp=cf7208efef1785057f35ac2ae162b98d8e59a698;hpb=45bd0627719f5f64127e014377bae9dd999d2c4c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index cf7208ef..82aef5cd 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -20,6 +20,7 @@ import Utils from '../utils/Utils'; import WorkerAbstract from '../worker/WorkerAbstract'; import WorkerFactory from '../worker/WorkerFactory'; import chalk from 'chalk'; +import { fileURLToPath } from 'url'; import { isMainThread } from 'worker_threads'; import path from 'path'; import { version } from '../../package.json'; @@ -38,9 +39,9 @@ export default class Bootstrap { private constructor() { this.started = false; this.workerScript = path.join( - path.resolve(__dirname, '../'), + path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../'), 'charging-station', - 'ChargingStationWorker.js' + 'ChargingStationWorker' + path.extname(fileURLToPath(import.meta.url)) ); this.initialize(); this.initWorkerImplementation(); @@ -188,7 +189,7 @@ export default class Bootstrap { const workerData: ChargingStationWorkerData = { index, templateFile: path.join( - path.resolve(__dirname, '../'), + path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../'), 'assets', 'station-templates', path.basename(stationTemplateUrl.file)