fix: worker path
This commit is contained in:
1 parent
12e8e2f93a
commit
78e3055344
1 file changed
+4
-3
+4
-3
@@ -17,9 +17,10 @@ let workerRunning = false
|
|||||||
// En binaire Bun compilé : le worker est à côté de l'exécutable
|
// En binaire Bun compilé : le worker est à côté de l'exécutable
|
||||||
// En Docker/dev : à côté du fichier courant
|
// En Docker/dev : à côté du fichier courant
|
||||||
function resolveWorkerPath(): string {
|
function resolveWorkerPath(): string {
|
||||||
const _isBunBinary = typeof (globalThis as any).Bun !== 'undefined'
|
// Si Bun est présent → le worker est toujours à côté de l'exécutable
|
||||||
&& path.dirname((process as any).execPath) !== process.cwd()
|
// (que ce soit un binaire compilé ou `bun run` en dev)
|
||||||
if (_isBunBinary) {
|
// En Node/tsx → on utilise import.meta.url
|
||||||
|
if (typeof (globalThis as any).Bun !== 'undefined') {
|
||||||
return path.join(path.dirname((process as any).execPath), 'organize-worker.js')
|
return path.join(path.dirname((process as any).execPath), 'organize-worker.js')
|
||||||
}
|
}
|
||||||
return path.join(path.dirname(new URL(import.meta.url).pathname), 'organize-worker.js')
|
return path.join(path.dirname(new URL(import.meta.url).pathname), 'organize-worker.js')
|
||||||
|
|||||||
Reference in new issue
Block a user