2019-09-04 16:00:54 +02:00
|
|
|
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants')
|
2018-04-12 09:47:42 +02:00
|
|
|
|
2019-05-30 03:19:32 +02:00
|
|
|
module.exports = phase => {
|
2018-04-12 09:47:42 +02:00
|
|
|
return {
|
|
|
|
distDir: phase === PHASE_DEVELOPMENT_SERVER ? '.next-dev' : '.next',
|
2019-02-12 02:28:47 +01:00
|
|
|
publicRuntimeConfig: {
|
|
|
|
foo: 'foo'
|
|
|
|
},
|
|
|
|
serverRuntimeConfig: {
|
|
|
|
bar: 'bar'
|
|
|
|
},
|
2019-07-08 07:45:41 +02:00
|
|
|
experimental: {
|
|
|
|
publicDirectory: true
|
|
|
|
},
|
2019-07-03 19:25:44 +02:00
|
|
|
exportTrailingSlash: true,
|
2018-04-12 09:47:42 +02:00
|
|
|
exportPathMap: function () {
|
|
|
|
return {
|
|
|
|
'/': { page: '/' },
|
|
|
|
'/about': { page: '/about' },
|
|
|
|
'/button-link': { page: '/button-link' },
|
2019-05-30 03:19:32 +02:00
|
|
|
'/get-initial-props-with-no-query': {
|
|
|
|
page: '/get-initial-props-with-no-query'
|
|
|
|
},
|
2018-04-12 09:47:42 +02:00
|
|
|
'/counter': { page: '/counter' },
|
|
|
|
'/dynamic-imports': { page: '/dynamic-imports' },
|
|
|
|
'/dynamic': { page: '/dynamic', query: { text: 'cool dynamic text' } },
|
2019-05-30 03:19:32 +02:00
|
|
|
'/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' }
|
|
|
|
},
|
2019-07-10 23:13:44 +02:00
|
|
|
'/query': { page: '/query', query: { a: 'blue' } },
|
2019-08-12 00:37:20 +02:00
|
|
|
// API route
|
2019-07-10 23:13:44 +02:00
|
|
|
'/blog/nextjs/comment/test': { page: '/blog/[post]/comment/[id]' }
|
2018-04-12 09:47:42 +02:00
|
|
|
}
|
2019-03-13 00:30:03 +01:00
|
|
|
} // end exportPathMap
|
2017-05-09 23:03:20 +02:00
|
|
|
}
|
|
|
|
}
|