[NPM] Execute npx commands with $npm_ Environment Variables

We will incorporate npm specific environment variables when executing various npx commands. In our example, we will transpile code to a folder name that matches the version of the current package.

 

"scripts": {
      "build": "babel index.js -d lib/$npm_package_version"
  },

 

output file will be stored in lib/1.0.0/index.js

posted @ 2019-03-12 19:09  Zhentiw  阅读(327)  评论(0)    收藏  举报