Skip to content

Commit

Permalink
Update node.js CLI flags
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Sep 12, 2017
1 parent 46f6361 commit 2b5825b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ v8flags(function (err, v8flags) {

const knownFlags = v8flags.concat([
'debug',
'inspect',
'--debug',
'--debug-brk',
'--inspect',
Expand All @@ -29,18 +30,16 @@ v8flags(function (err, v8flags) {
'--trace-deprecation',
'--allow-natives-syntax',
'--perf-basic-prof',
'--preserve-symlinks'
'--preserve-symlinks',
'--expose-gc',
'--expose-http2'
])

for (let i = 0; i < argv.length; i++) {
const arg = argv[i]
const flag = arg.split('=', 1)[0]

if (flag === '-d') {
nodeArgs.push('--debug')
} else if (flag === '-gc') {
nodeArgs.push('--expose-gc')
} else if (knownFlags.indexOf(flag) > -1) {
if (knownFlags.indexOf(flag) > -1) {
nodeArgs.push(arg)
} else if (/^-/.test(flag)) {
scriptArgs.push(arg)
Expand Down

0 comments on commit 2b5825b

Please sign in to comment.