Capítulo 248 de 456
Controls whether Next.js URLs resolve with or without a trailing slash, and which direction the automatic redirect goes.
trailingSlash: boolean config; default false redirects /about/ → /about. Setting true reverses it, redirecting /about → /about/.trailingSlash: true: static file URLs (files with extensions) and any path under .well-known/ never get a trailing slash appended.output: "export": with trailingSlash: true, /about outputs /about/index.html instead of the default /about.html.module.exports = {
trailingSlash: true,
}
| Version | Changes |
|---|---|
v9.5.0 | trailingSlash added. |
.well-known/ nunca recebem barra final, mesmo com a opção ligada.output: "export", muda o nome do arquivo HTML gerado por rota.