我正在使用 next.js 构建一个静态站点,并且我希望我website.com/about.html的工作方式如下:website.com/about- 我不确定为什么它强迫我输入.html.
即使我构建了我的项目:pages/about/index.js- 它会在静态站点上生成一个about.html而不是about/index.html。
我在next的网站上找到了答案:
module.exports = {
exportTrailingSlash: true,
}
Run Code Online (Sandbox Code Playgroud)
https://nextjs.org/docs/api-reference/next.config.js/exportPathMap#adding-a-trailing-slash
| 归档时间: |
|
| 查看次数: |
874 次 |
| 最近记录: |