next.config.js (911B)
1 /* eslint-disable */ 2 3 const withPWA = require('next-pwa')({ 4 dest: 'public', 5 disable: process.env.NODE_ENV === 'development', 6 }); 7 8 /** @type {import('next').NextConfig} */ 9 const nextConfig = withPWA({ 10 reactStrictMode: true, 11 trailingSlash: false, 12 experimental: { 13 // swcPlugins: [['superjson-next', { router: 'PAGE' }]], 14 }, 15 redirects: async () => { 16 const startClassRedirects = [1, 2, 3].flatMap((g) => 17 [1, 2, 3, 4, 5, 6, 7, 8].map((c) => { 18 const className = `${g}-${c}`; 19 return { 20 source: '/start', 21 has: [ 22 { 23 type: 'cookie', 24 key: 'default_class', 25 value: className, 26 }, 27 ], 28 destination: '/' + className, 29 permanent: false, 30 }; 31 }), 32 ); 33 34 const startDefaultRedirect = { 35 source: '/start', 36 destination: '/', 37 permanent: false, 38 }; 39 40 return [...startClassRedirects, startDefaultRedirect]; 41 }, 42 }); 43 44 module.exports = nextConfig;