JonathanXDR / Application-Website-Frontend

My Personal Website
https://jonathan-russ.com
MIT License
1 stars 2 forks source link

Questions about how the .env.production configuration file is invoked after the project is packaged #69

Closed 4444TENSEI closed 3 weeks ago

4444TENSEI commented 3 weeks ago

Is it not possible to inject the information from .env.production into the server-side of the built package after running the nuxt build command? I am encountering an issue where the ProjectsSection.vue part is not being displayed. The reason seems to be that the bundled project does not include the GitHub configuration information from .env.production. I would like to ask, for deploying the bundled project to my personal Linux server, what steps do I need to take?I tried to move the .env.production file to the .output/server folder but failed to read the contents of the configuration file

4444TENSEI commented 3 weeks ago

I solved the problem by changing the build command to nuxt build --dotenv .env.production. But I would like to know if your deployment method is to configure environment variables on the deployed vendor? Since I have not been exposed to the use of environmental variables in the front-end development of the website, this problem may be relatively low-level, please forgive me!