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';
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();
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)