diff --git a/next.config.js b/next.config.js index dae7d40b..e7bf37c7 100755 --- a/next.config.js +++ b/next.config.js @@ -1,21 +1,24 @@ -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' : '', images: { - domains: ['hackclub.com', 'v3.hackclub.dev', 'v3.hackclub.com', 'dl.airtable.com', 'cdn.glitch.com'] + domains: ['hackclub.com', 'dl.airtable.com', 'cdn.glitch.com'] }, webpack: (config, { isServer }) => { - if (isServer) { - require('./lib/sitemap') - } - + 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: [ diff --git a/vercel.json b/vercel.json index 820fe328..59391486 100644 --- a/vercel.json +++ b/vercel.json @@ -3,10 +3,100 @@ "env": { "SLACK_BOT_TOKEN": "@slack-bot-token-production-8avf" }, + "redirects": [ + { "source": "/clubs/", "destination": "/", "permanent": false }, + { "source": "/c9/", "destination": "/cloud9_setup/" }, + { "source": "/slack_invite/", "destination": "/slack/" }, + { "source": "/workshops/slack/", "destination": "/slack/" }, + { "source": "/community/", "destination": "/slack/" }, + { "source": "/hack_camp/", "destination": "/camp/" }, + { "source": "/repl/", "destination": "/" }, + { "source": "/coc/", "destination": "/conduct/" }, + { "source": "/code_of_conduct/", "destination": "/conduct/" }, + { "source": "/branding/", "destination": "/brand/" }, + { "source": "/ama/", "destination": "/amas/" }, + { "source": "/finder/", "destination": "https://finder.hackclub.com" }, + { "source": "/apply/", "destination": "https://apply.hackclub.com" }, + { "source": "/icons/", "destination": "https://icons.hackclub.com" }, + { + "source": "/updates/", + "destination": "https://www.youtube.com/playlist?list=PLbNbddgD-XxEC5-_KQTye6nFPBLtI_mds" + }, + { + "source": "/admin/", + "destination": "https://5c8804a629a378000833619c--hackclub.netlify.com/admin/" + }, + { + "source": "/checkup/", + "destination": "https://5c8804a629a378000833619c--hackclub.netlify.com/checkup/", + "statusCode": 302 + }, + { + "source": "/workshops/", + "destination": "https://workshops.hackclub.com/" + }, + { + "source": "/workshops/([a-z_]+)/", + "destination": "https://workshops.hackclub.com/$1/" + } + ], "rewrites": [ { "source": "/v3/_next/:path*", "destination": "/_next/:path*" + }, + { + "source": "/workshops/_next/:path*", + "destination": "https://workshops.hackclub.com/_next/:path*" + }, + { + "source": "/summer/_next/:path*", + "destination": "https://summer.hackclub.com/_next/:path*" + }, + { + "source": "/sponsorship/", + "destination": "https://workshops.hackclub.com/sponsorship/" + }, + { + "source": "/covid19/", + "destination": "https://workshops.hackclub.com/covid19/" + }, + { + "source": "/sunsetting-som/", + "destination": "https://workshops.hackclub.com/sunsetting-som/" + }, + { + "source": "/banner/", + "destination": "https://workshops.hackclub.com/banner/" + }, + { + "source": "/conduct/", + "destination": "https://workshops.hackclub.com/conduct/" + }, + { + "source": "/workshop-bounty/", + "destination": "https://workshops.hackclub.com/workshop-bounty/" + }, + { + "source": "/vip-newsletters/", + "destination": "https://workshops.hackclub.com/vip-newsletters/" + }, + { + "source": "/vip-newsletters/(.*)", + "destination": "https://workshops.hackclub.com/vip-newsletters/$1" + }, + { + "source": "/transparency/may-2020/", + "destination": "https://workshops.hackclub.com/transparency-may/" + }, + { + "source": "/map/", + "destination": "https://map.hackclub.dev/" + }, + { + "source": "/(.*)/", + "destination": "https://site.hackclub.dev/$1/" } - ] + ], + "github": { "silent": true } }