rsnext/test/integration/export/next.config.js
JJ Kasper ce0a32c39e
Make sure to not duplicate exports with exportTrailingSlash (#11011)
This makes sure we don't duplicate the `/` route or any others while exporting with `exportTrailingSlash` enabled. We do still output `404.html` with `exportTrailingSlash` enabled in case anyone was relying on this file being present.

Fixes: https://github.com/zeit/next.js/issues/11008
2020-05-27 05:48:50 +00:00

45 lines
1.4 KiB
JavaScript

const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')
module.exports = (phase) => {
return {
distDir: phase === PHASE_DEVELOPMENT_SERVER ? '.next-dev' : '.next',
publicRuntimeConfig: {
foo: 'foo',
},
serverRuntimeConfig: {
bar: 'bar',
},
exportTrailingSlash: true,
exportPathMap: function () {
return {
'/': { page: '/' },
'/index': { page: '/index' },
'/about': { page: '/about' },
'/button-link': { page: '/button-link' },
'/hash-link': { page: '/hash-link' },
'/get-initial-props-with-no-query': {
page: '/get-initial-props-with-no-query',
},
'/counter': { page: '/counter' },
'/dynamic-imports': { page: '/dynamic-imports' },
'/dynamic': { page: '/dynamic', query: { text: 'cool dynamic text' } },
'/dynamic/one': {
page: '/dynamic',
query: { text: 'next export is nice' },
},
'/dynamic/two': {
page: '/dynamic',
query: { text: 'Vercel is awesome' },
},
'/file-name.md': {
page: '/dynamic',
query: { text: 'this file has an extension' },
},
'/query': { page: '/query', query: { a: 'blue' } },
'/query-update': { page: '/query-update', query: { a: 'blue' } },
// API route
'/blog/nextjs/comment/test': { page: '/blog/[post]/comment/[id]' },
}
}, // end exportPathMap
}
}