mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### Why? The output layout breaks when running `next build --debug` #### Current ```sh ✓ Generating static pages (10/10) Finalizing page optimization . Collecting build traces .Redirects ┌ source: /:path+/ ├ destination: /:path+ └ permanent: true ✓ Collecting build traces ✓ Finalizing page optimization ``` #### Expected ```sh ✓ Generating static pages (4/4) Finalizing page optimization ... Collecting build traces ... Redirects ┌ source: /:path+/ ├ destination: /:path+ └ permanent: true ``` ### How? Moved the `debug` output right above the `routes` output. Also, ensured that the output layout has a consistent number of line breaks (example below marked as `>`): > Two line breaks for the next `option`, a single line break within the same content. ```sh Collecting build traces ... > > Redirects ┌ source: /:path+/ ├ destination: /:path+ └ permanent: true > ┌ source: /redirects ├ destination: / └ permanent: true > > Headers ┌ source: / └ headers: └ x-custom-headers: headers > > Rewrites ┌ source: /rewrites └ destination: / > > Route (app) Size First Load JS ┌ ○ / 141 B 86.2 kB └ ○ /_not-found 876 B 86.9 kB ``` Fixes #63192 ---------
34 lines
527 B
JavaScript
34 lines
527 B
JavaScript
/** @type {import('next').NextConfig} */
|
|
module.exports = {
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/redirects',
|
|
destination: '/',
|
|
permanent: true,
|
|
},
|
|
]
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/rewrites',
|
|
destination: '/',
|
|
},
|
|
]
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/',
|
|
headers: [
|
|
{
|
|
key: 'x-custom-headers',
|
|
value: 'headers',
|
|
},
|
|
],
|
|
},
|
|
]
|
|
},
|
|
}
|