0

I am looking for a way to pass a "flag" (or otherwise) which would modify the package.json field value "inline".

I came across this question which has some similarities, but in my case I believe it is to late since I am running in the context of the package scripts.

Edit package.json from command line

For reference the original package.json looks like this:

{
...
  "main": "./out/extension"
  "scripts" : {
    ...
    "vsce:package": "vsce package"
  }
}

I would like to add a new script. In that script I need to use a different value for "main", such that it is modified to be "./out/extension2".

i.e.

{
...
  "main": "extension" << this needs to be modified in the script 
  "scripts" : {
    ...
    "vsce:package": "vsce package",
    "vsce:package2": "modify 'main' here to be 'extension2' .... && vsce package"
  }
}
Avba
  • 14,822
  • 20
  • 92
  • 192

0 Answers0