Skip to content

Instantly share code, notes, and snippets.

@NickTomlin
Last active November 18, 2018 22:24
Show Gist options
  • Save NickTomlin/7cd3ca0da9fe158ea0dc997c640b3dbd to your computer and use it in GitHub Desktop.
Save NickTomlin/7cd3ca0da9fe158ea0dc997c640b3dbd to your computer and use it in GitHub Desktop.

An example for this issue

warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
$ node ./script.js --package-arg=1 -- foo
[ '/Users/ntomlin/.nvm/versions/node/v10.11.0/bin/node',
'/Users/ntomlin/workspace/node-playground/yarn-args/script.js',
'--package-arg=1',
'--',
'foo' ]
✨ Done in 0.12s.
{
"name": "example",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"script": "node ./script.js --package-arg=1"
}
}
console.log(process.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment