You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Several modules (sitemap, i18n, axios, http, and possibly many more 馃檲) are asking in some way for the app's baseUrl. Unfortunately, most of them have their own configuration option for it (e.g. publicRuntimeConfig.axios.baseUrl, sitemap.baseUrl, ...). This creates a little more boilerplate than necessary while the url itself stays the same and reduces the risk of forgetting to set a baseUrl somewhere.
Describe the solution you'd like
Ideally, the modules access some "general" place for the baseUrl, e.g. publicRuntimeConfig.baseUrl. This would reduce the boilerplate and makes configuration easier - set and forget 馃構.
This could be documented at each module documentation but maybe also in the main Nuxt documentation?
To avoid breaking changes, modules could use the "general" configuration as a fallback if no specific value is set. This could also make migration easier as it is not immediately necessary but can be hinted via warning.
The text was updated successfully, but these errors were encountered:
In Nuxt 3 this is now configurable via app.baseURL which is accessible within modules by accessing that from the nuxt options object. At runtime it is accessible via useRuntimeConfig().app.baseURL
Is your feature request related to a problem? Please describe.
Several modules (sitemap, i18n, axios, http, and possibly many more 馃檲) are asking in some way for the app's
baseUrl
. Unfortunately, most of them have their own configuration option for it (e.g.publicRuntimeConfig.axios.baseUrl
,sitemap.baseUrl
, ...). This creates a little more boilerplate than necessary while the url itself stays the same and reduces the risk of forgetting to set abaseUrl
somewhere.Describe the solution you'd like
Ideally, the modules access some "general" place for the baseUrl, e.g.
publicRuntimeConfig.baseUrl
. This would reduce the boilerplate and makes configuration easier - set and forget 馃構.This could be documented at each module documentation but maybe also in the main Nuxt documentation?
To avoid breaking changes, modules could use the "general" configuration as a fallback if no specific value is set. This could also make migration easier as it is not immediately necessary but can be hinted via warning.
The text was updated successfully, but these errors were encountered: