rsnext/test/integration/export/next.config.js
Lukáš Huvar 2450c85e81 exportPathMap dynamic routes params fix (#7846)
* Fix dynamic page export fixes #7829

* Adding handling of unmatched path

* Remove logs

* Fix newline

* Tests

* Fix promise

* Fix amp tests

* Revert test

* Adjust error document

* Remove old argument

* Simplify export test

* Ensure page !== path for this check
2019-07-10 17:13:44 -04:00

44 lines
1.3 KiB
JavaScript

const { PHASE_DEVELOPMENT_SERVER } = require('next-server/constants')
module.exports = phase => {
return {
distDir: phase === PHASE_DEVELOPMENT_SERVER ? '.next-dev' : '.next',
publicRuntimeConfig: {
foo: 'foo'
},
serverRuntimeConfig: {
bar: 'bar'
},
experimental: {
publicDirectory: true
},
exportTrailingSlash: true,
exportPathMap: function () {
return {
'/': { page: '/' },
'/about': { page: '/about' },
'/button-link': { page: '/button-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: 'zeit is awesome' }
},
'/file-name.md': {
page: '/dynamic',
query: { text: 'this file has an extension' }
},
'/query': { page: '/query', query: { a: 'blue' } },
'/blog/nextjs/comment/test': { page: '/blog/[post]/comment/[id]' }
}
} // end exportPathMap
}
}