npm / npx

npm package executor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE] Is that possible to added a "--env-file" option?

Gcaufy opened this issue · comments

What / Why

Is that possible to support an option -e ( which is short of --env-file)
so that I can put all my environment variables in .env file. and then I can run npx -e webpack or npx -e other.env webpack (default to use .env file, and also you can specify a file)

There is a similar project called dotenv, which allow you to add your runtime environment variables by:

node -r dotenv/config yourscript.js

When you are using a cli library which like webpack, it will become much more complicated. like this:

node -r dotenv/config ./node_modules/.bin/webpack

So I wish we could have it in npx.

References