Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuxt command line pass arguments

Tags:

vue.js

nuxt.js

I want to pass some arguments to nuxt command line like:

nuxt --myvar a

How to read this myvar inside nuxt.config.js?

I need this because I have 3 .env (localhost, production and development) files, but with current NODE_ENV I can use only 2 (production and development).

like image 818
AlexZd Avatar asked Feb 27 '26 19:02

AlexZd


1 Answers

You should check out the https://github.com/nuxt-community/dotenv-module.

The module loads variables from your .env file directly into your nuxt.js application context and process.env.

like image 180
ajobi Avatar answered Mar 02 '26 10:03

ajobi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!