Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianMazur committed Sep 3, 2024
1 parent db32a77 commit be0f865
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ export default class WorkerThreadRunner {
)
) {
execArgv = ["-r", pnpApiPath]
pnpLoaderPath = join(pnpApiPath, "../.pnp.loader.mjs")
if (isFile(pnpLoaderPath)) {
const experimentalLoader = pathToFileURL(pnpLoaderPath).toString()
execArgv = ["--experimental-loader", experimentalLoader, ...execArgv]
// eslint-disable-next-line no-underscore-dangle
const _pnpLoaderPath = join(pnpApiPath, "../.pnp.loader.mjs")
if (isFile(_pnpLoaderPath)) {
pnpLoaderPath = pathToFileURL(_pnpLoaderPath).toString()
if (!IS_NODE_20) {
execArgv = ["--experimental-loader", pnpLoaderPath, ...execArgv]
}
}
}
}
Expand All @@ -63,13 +66,6 @@ export default class WorkerThreadRunner {
},
}

if (pnpLoaderPath && !IS_NODE_20) {
workerOptions.execArgv.push(
"--experimental-loader",
pathToFileURL(pnpLoaderPath).toString(),
)
}

this.#workerThread = new Worker(
join(import.meta.url, "workerThreadHelper.js"),
workerOptions,
Expand Down

0 comments on commit be0f865

Please sign in to comment.