How to use environment variables in package.json

后端 未结 6 1779
有刺的猬
有刺的猬 2020-12-30 19:01

Because we don\'t want sensitive data in the project code, including the package.json file, using environment variables would be a logical choice in my opinion.

Exam

6条回答
  •  攒了一身酷
    2020-12-30 19:38

    No, it's not possible. You should access the repo using git+ssh, and store a private key in ~/.ssh.

    Your line then looks like:

    "my-private-module":"git+ssh://git@bitbucket.org/foo/bar.git"
    

    Which doesn't contain anything sensitive.

提交回复
热议问题