我不想遵循将环境变量(.env文件)放在 Nuxt 项目的根目录中的约定。
How can I achieve another directory or even name for it without using the @nuxtjs/dotenv module? (I know this one is already baked into Nuxt since v2.13 and hence, not needed anymore).
Looking at this answer: https://github.com/nuxt/nuxt.js/issues/8331#issuecomment-727533175
You can specify a different location and name if you'd like, with the following
yarn dev --dotenv variables/.env_file
Run Code Online (Sandbox Code Playgroud)
With the following structure
Of course, this will work with yarn generate and yarn build.
| 归档时间: |
|
| 查看次数: |
2105 次 |
| 最近记录: |