Skip to content

Commit

Permalink
Don't pass invalid NODE_OPTIONS to worker (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: fisker <lionkay@gmail.com>
  • Loading branch information
donovanglover and fisker committed Apr 17, 2024
1 parent 23c0aab commit 4465bd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion source/threads-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ThreadsWorker {
const lock = IS_PRODUCTION ? {} : new Lock()

const worker = new Worker(WORKER_FILE, {
execArgv: process.env.NODE_OPTIONS?.split(' '),
workerData: {
workerRunningSemaphore: lock.semaphore,
...this.#workerData,
Expand Down
14 changes: 9 additions & 5 deletions tests/loaders.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ async function run({type}) {
)
await fs.writeFile(
file,
`
import print from ${JSON.stringify(module.href)}
console.log(JSON.stringify(print(), undefined, 2))
`,
/* Indent */ `
import print from ${JSON.stringify(module.href)}
console.log(JSON.stringify(print(), undefined, 2))
`,
)

return await execaCommand('yarn node foo.mjs --silent', {
cwd: directory,
env: {FORCE_COLOR: '0'},
env: {
FORCE_COLOR: '0',
// https://github.com/fisker/make-synchronized/pull/44
NODE_OPTIONS: '--max-old-space-size=4096',
},
})
} finally {
await fs.rm(directory, {force: true, recursive: true})
Expand Down

0 comments on commit 4465bd2

Please sign in to comment.