How do I add comments to package.json for npm install?

后端 未结 20 1350
悲哀的现实
悲哀的现实 2020-12-07 07:30

I\'ve got a simple package.json file and I want to add a comment. Is there a way to do this, or are there any hacks to make this work?



        
20条回答
  •  無奈伤痛
    2020-12-07 07:59

    My take on the frustration of no comments in JSON. I create new nodes, named for the nodes they refer to, but prefixed with underscores. This is imperfect, but functional.

    {
      "name": "myapp",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "react": "^16.3.2",
        "react-dom": "^16.3.2",
        "react-scripts": "1.1.4"
      },
      "scripts": {
        "__start": [
            "a note about how the start script works"
        ],
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test --env=jsdom",
        "eject": "react-scripts eject"
      },
      "__proxy": [
        "A note about how proxy works",
        "multilines are easy enough to add"
      ],
      "proxy": "http://server.whatever.com:8000"
    }
    

提交回复
热议问题