site/next.config.js
2020-11-06 17:12:04 -05:00

35 lines
949 B
JavaScript
Executable file

const withMDX = require('@next/mdx')({ extension: /\.mdx?$/ })
module.exports = withMDX({
trailingSlash: true,
pageExtensions: ['js', 'jsx', 'mdx'],
images: {
domains: ['hackclub.com', 'dl.airtable.com', 'cdn.glitch.com']
},
webpack: (config, { isServer }) => {
if (isServer) require('./lib/sitemap')
return config
},
async headers() {
return [
{
source: '/banners/(.*)',
headers: [{ key: 'Access-Control-Allow-Origin', value: '*' }]
},
{
source: '/fonts/(.*)',
headers: [{ key: 'Access-Control-Allow-Origin', value: '*' }]
},
{
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' }
]
}
]
}
})