未验证 提交 308c2bec 编写于 作者: S Shane Rogers 提交者: GitHub

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.
上级 e36eb381
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册