zl程序教程

您现在的位置是:首页 >  前端

当前栏目

[NPM] Execute npx commands with $npm_ Environment Variables

npm with variables execute environment commands
2023-09-14 09:00:49 时间

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