feat: allow setting NODE_OPTIONS. (#448)
This commit is contained in:
@@ -5,8 +5,16 @@ export default async function disableNodeCli(compiler: NexeCompiler, next: () =>
|
||||
return next()
|
||||
}
|
||||
|
||||
const nodeccMarker = "argv[index][0] == '-'"
|
||||
const nodeccMarker = 'argv[index][0] =='
|
||||
|
||||
await compiler.replaceInFileAsync(
|
||||
'src/node.cc',
|
||||
`${nodeccMarker} '-'`,
|
||||
// allow NODE_OPTIONS, introduced in 8.0
|
||||
parseInt(compiler.target.version.split('.')[0]) >= 8
|
||||
? `(${nodeccMarker} is_env ? '-' : ']')`
|
||||
: `(${nodeccMarker} ']')`
|
||||
)
|
||||
|
||||
await compiler.replaceInFileAsync('src/node.cc', nodeccMarker, nodeccMarker.replace('-', ']'))
|
||||
return next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user