Environment
- Operating System:
Windows_NT
- Node Version:
v16.17.0
- Nuxt Version:
2.16.0-27720022.54e852f
- Nitro Version:
1.0.0
- Package Manager:
npm@8.18.0
- Builder:
webpack
- User Config:
typescript, alias, bridge, nitro, ssr, render, target, imports, loading, head, css, srcDir, plugins, components, buildModules, i18n, modules, publicRuntimeConfig, axios, router, vuetify, build, ignore, serverHandlers, devServerHandlers, devServer
- Runtime Modules:
@nuxtjs/axios@5.13.6,
@nuxtjs/i18n@7.3.0
- Build Modules:
(), @pinia/nuxt@0.4.6, @nuxtjs/svg@0.1.12, @nuxtjs/vuetify@1.12.3, @nuxt/bridge@3.0.0-27833237.ddd8ecc------------------------------
Reproduction
Not needed ( i dont think )
Describe the bug
nuxi commands always use the default .env file even if the --dotenv arg is specified
Additional context
I think the right spot for the fix is @nuxt/config-edge src/load.js loadNuxtConfig
With nuxi the incoming env config has the following pattern:
{
cwd: 'C:/code/Tempest/flexdeploy',
fileName: 'production.env'
}
which is the spread here:
envConfig = {
dotenv: ".env",
env: process.env,
expand: true,
...envConfig
};
Just changing to dotenv: envConfig.fileName ?? ".env" does the trick
Logs
No response
Environment
Windows_NTv16.17.02.16.0-27720022.54e852f1.0.0npm@8.18.0webpacktypescript,alias,bridge,nitro,ssr,render,target,imports,loading,head,css,srcDir,plugins,components,buildModules,i18n,modules,publicRuntimeConfig,axios,router,vuetify,build,ignore,serverHandlers,devServerHandlers,devServer@nuxtjs/axios@5.13.6,@nuxtjs/i18n@7.3.0(),@pinia/nuxt@0.4.6,@nuxtjs/svg@0.1.12,@nuxtjs/vuetify@1.12.3,@nuxt/bridge@3.0.0-27833237.ddd8ecc------------------------------Reproduction
Not needed ( i dont think )
Describe the bug
nuxi commands always use the default
.envfile even if the --dotenv arg is specifiedAdditional context
I think the right spot for the fix is
@nuxt/config-edge src/load.js loadNuxtConfigWith nuxi the incoming env config has the following pattern:
which is the spread here:
Just changing to
dotenv: envConfig.fileName ?? ".env"does the trickLogs
No response