Add image base path configuration option (#23115)
I similarly [couldn't find this info](https://github.com/vercel/next.js/issues/19711#issuecomment-750414110) in the docs about configuring the image path when using an app `basePath`, so thought I'd add it.
This commit is contained in:
parent
e36eb381da
commit
308c2beca2
1 changed files with 12 additions and 0 deletions
|
@ -94,6 +94,18 @@ If you need a different provider, you can use the [`loader`](/docs/api-reference
|
|||
|
||||
> The `next/image` component's default loader is not supported when using [`next export`](/docs/advanced-features/static-html-export.md). However, other loader options will work.
|
||||
|
||||
### Base path
|
||||
|
||||
If you have deployed your application under a sub-path of a domain using the [`basePath`](/docs/api-reference/next.config.js/basepath.md) option, you will need to configure your images to reference this path.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
images: {
|
||||
path: `yourBasePath/_next/image`,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
## Caching
|
||||
|
||||
The following describes the caching algorithm for the default [loader](#loader). For all other loaders, please refer to your cloud provider's documentation.
|
||||
|
|
Loading…
Reference in a new issue