No, not at all! You can use both together. An env file will set certain options that you might want to check during runtime via runtimeConfig The env aware config will enable you to change your config fully based on the environment. Could you do the same via env? Probably, but it’d be less clean or obvious
Hey Alex! you what would be a great episode? Unit testing in Nuxt 3! I haven't started unit testing my components but I should. It would be great to watch a good video tutorial as I heard it was a nightmare to test Nuxt 3 apps....
I really learn a lot from your videos. Any chance you could do a video clarifying what packages should go into dependencies or devDependencies? For example, I have seen nuxt entered in dependencies and also in devDependencies, which is right? How can we know which package should go where?
Very happy that my videos help you 🙌🏻 Yes, this is on the list but can vary a lot based on what type of framework you use and if you build an app or library ☺️ For a nuxt app, I would put all in deps except libs for testing, linting etc etc
Hey Alex, I'd really like to see the implementation of websockets in Nuxt3. I know it is theoretically possible with unjs ecosystem's H3/CrossWS packages, but since I've been experimenting with those and wasn't able to establish a handshake with wss, I could really use your help with those.
@@TheAlexLichter Thank you so much for this one! At first I was like 'NO WAY' but it turned out you actually found spare time and put effort into making a video about the EXACT thing I was interested in 🙂. I am honored and humbled by this gesture of yours! Thank you for your everyday work and dedication ❤❤❤ Hats off to you Sir Alex of Nuxt!
Great video! What if i want to have multiple versions of a website. For example I have a website but it needs to run in multiple country's with specific configs and runtime variables. Do i just make multiple nuxt.config files? How do i handle that?
This is what I want to do but I cant set NODE_ENV because Nuxt will always change it back to "production" and show the warning as shown in the video... How to set NODE_ENV ???
@@TheAlexLichter Correct me if I am wrong. I thought the nuxt.config.ts will only be executed during build time. Let said, during build time the production.title is configured as 'Build Title'. During runtime, I would like to change the title name to 'Runtime Title'. I would like to do this without using environment variable. I tried your method, it does not seems work. The config file is not being read during runtime.
Ah, sorry. My bad! No, you are correct. RuntimeConfig and env variables would be the only way to do so. The env-aware config should mainly help with "different types of builds", dev, and a testing environment.
Can you use this to conditionally auto import different files for a js import based on dev/prod/test? Eg. database_dev.js vs database_prod.js but in nuxt refer to database only, but have it auto import the correct file
What will you use the env-aware config option for?
isn't using env files the standard ? won't it conflict ?
No, not at all! You can use both together. An env file will set certain options that you might want to check during runtime via runtimeConfig
The env aware config will enable you to change your config fully based on the environment.
Could you do the same via env? Probably, but it’d be less clean or obvious
Hey Alex! you what would be a great episode? Unit testing in Nuxt 3! I haven't started unit testing my components but I should. It would be great to watch a good video tutorial as I heard it was a nightmare to test Nuxt 3 apps....
100%
As mentioned after the intro, this is definitely planned!
@@TheAlexLichteralso unit testing the API part of nuxt. There are no resources on this at all currently!
@@TheAlexLichter awesome. Looking forward to it!
Понастоящему полезный контент💪.
Спасибо огромное
Пожалуйста!
Had no idea it is that easy! Awesome video as always
It's amazing, isn't it?
Thanks 🙏
Thanks Alex! Much appreciate your work man.
another video that just saved my day :D thank you ill use this to set diferent apis urls for dev and prod :D
That's a good case (but also could work via runtimeConfig 😊) You are welcome!
I really learn a lot from your videos. Any chance you could do a video clarifying what packages should go into dependencies or devDependencies? For example, I have seen nuxt entered in dependencies and also in devDependencies, which is right? How can we know which package should go where?
Very happy that my videos help you 🙌🏻
Yes, this is on the list but can vary a lot based on what type of framework you use and if you build an app or library ☺️
For a nuxt app, I would put all in deps except libs for testing, linting etc etc
Thanks for the video!
Glad you enjoyed it 🙌
Hey Alex, I'd really like to see the implementation of websockets in Nuxt3.
I know it is theoretically possible with unjs ecosystem's H3/CrossWS packages, but since I've been experimenting with those and wasn't able to establish a handshake with wss, I could really use your help with those.
Video is coming ;)
And here it is - ua-cam.com/video/OfY7JcrqkPg/v-deo.html
@@TheAlexLichter Thank you so much for this one! At first I was like 'NO WAY' but it turned out you actually found spare time and put effort into making a video about the EXACT thing I was interested in 🙂.
I am honored and humbled by this gesture of yours!
Thank you for your everyday work and dedication ❤❤❤
Hats off to you Sir Alex of Nuxt!
awesome, thanks for the video
You are welcome 🙌😊
nice video, really usefull. Thanks
Thank you 🙏🏻
wow this is a great one!
Thanks 🙏🏻
Great video!
What if i want to have multiple versions of a website. For example I have a website but it needs to run in multiple country's with specific configs and runtime variables.
Do i just make multiple nuxt.config files?
How do i handle that?
How do I use custom environments?
If I set $env: {$preview:{...} }, I still run in production
Follow along github.com/nuxt/cli/issues/357 ☺️
I am facing the same problem ... Cant set the NODE_ENV to anything because it will always fall back to production
Thanks!!
You are welcome! 🙌
Gents is there anyway to define production API baseURL and development base_URL using this settings ?
For example through the runtime config, absolutely!
I really like your videos about nuxt 3, im planning to migrate from nuxt 2 to nuxt 3 but im having a problem on implementing simple jwt auth on nuxt 3
Take a look at github.com/Atinux/nuxt-auth-utils 😊
How it fits there if I have a node_env named "preview". Do I do $preview:{...}
It is:
$env: { $preview: {...} }
This is what I want to do but I cant set NODE_ENV because Nuxt will always change it back to "production" and show the warning as shown in the video... How to set NODE_ENV ???
Does it work during runtime? Means, can I change the config after build, will it take effect?
That’s the whole idea, yes!
@@TheAlexLichter Correct me if I am wrong. I thought the nuxt.config.ts will only be executed during build time. Let said, during build time the production.title is configured as 'Build Title'. During runtime, I would like to change the title name to 'Runtime Title'. I would like to do this without using environment variable. I tried your method, it does not seems work. The config file is not being read during runtime.
Ah, sorry. My bad! No, you are correct. RuntimeConfig and env variables would be the only way to do so.
The env-aware config should mainly help with "different types of builds", dev, and a testing environment.
Can you use this to conditionally auto import different files for a js import based on dev/prod/test? Eg. database_dev.js vs database_prod.js but in nuxt refer to database only, but have it auto import the correct file
Never tried that but I think this is possible, yes!
Quick Nick
I have set up a cron job in /cron/some-job.ts. Is it possible to define that this cronjob should only run in the prod environment?
awesome. thanks
Glad you enjoy it ☺️