Skip to content

Commit

Permalink
Allow extra flags in babel-node (#16554)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jun 5, 2024
1 parent 14a0b08 commit 9ca1175
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/babel-node/src/_babel-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ program.option(
program.option("-w, --plugins [string]", "", collect);
program.option("-b, --presets [string]", "", collect);

program.allowUnknownOption(true);

program.version(PACKAGE_JSON.version);
program.usage("[options] [ -e script | script.js ] [arguments]");
program.parse(process.argv);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(process.argv.slice(2));
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"args": ["bar", "--extra-option"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ '--extra-option' ]

0 comments on commit 9ca1175

Please sign in to comment.