mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
29 lines
731 B
JavaScript
Executable file
29 lines
731 B
JavaScript
Executable file
const isProd = process.env.NODE_ENV === 'production'
|
|
const withMDX = require('@next/mdx')({ extension: /\.mdx?$/ })
|
|
module.exports = withMDX({
|
|
trailingSlash: true,
|
|
pageExtensions: ['js', 'jsx', 'mdx'],
|
|
assetPrefix: isProd ? '/v3' : '',
|
|
webpack: (config, { isServer }) => {
|
|
if (isServer) {
|
|
require('./lib/sitemap')
|
|
}
|
|
|
|
return config
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/api/(.+)',
|
|
headers: [
|
|
{ key: 'Access-Control-Allow-Origin', value: '*' },
|
|
{
|
|
key: 'Access-Control-Allow-Methods',
|
|
value: 'GET, POST, OPTIONS'
|
|
},
|
|
{ key: 'Access-Control-Allow-Headers', value: 'Content-Type' }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
})
|