0

Package.json

 {
        custom: "",
        "build:xapp": "webpack ....",
        "test:xapp": "karma ....",
        "build:yapp": "webpack ....",
        "test:yapp": "karma ...."
         ... n number of apps
 }

If want to pass the entire command for the custom script as an argument, How can i do that?

something like this

yarn custom -- -"yarn build:xapp, yarn build:yapp, yarn test:xapp"

tk421
  • 5,775
  • 6
  • 23
  • 34
hashbytes
  • 769
  • 1
  • 8
  • 26

1 Answers1

0

It looks like you want to run multiple npm scripts that are defined in package.json. I think npm-run-all is what you are looking for: https://www.npmjs.com/package/npm-run-all

Once you install, you can then run npm-run-all build:xapp build:yapp test:xapp

If you are looking for passing command line arguments, this has been answered here: Sending command line arguments to npm script

olore
  • 4,687
  • 3
  • 28
  • 40