Pass an argument to an npm run script comprising m

2019-04-18 15:28发布

问题:

I'd like to pass an argument into the first of two commands in my npm script:

"scripts": {
  "myscript": "a && b"
}

When I run npm run myscript -- --somearg=somevalue, the argument is passed to command b but not command a. Is there some way to instead ensure that the first command receives the argument?

回答1:

"scripts": {
  "myscript": "a",
  "postmyscript": "b"
}