Reputation: 831
I am using the dotenv package to inject environment variables to my OS which I can specify by calling the following:
node -r dotenv/config dist/app.js
How can I run the same command from launch.json? Currently I have the following but it doesn't load the dotenv package
"program": "${workspaceFolder}\\dist\\app.js",
"args": [
"-r dotenv/config"
],
Upvotes: 3
Views: 4129
Reputation: 1596
Try using this as one of the keys instead of args
:
"runtimeArgs": [
"-r",
"dotenv/config"
]
Upvotes: 7