generated from mantinedev/next-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
53 lines (50 loc) · 1.3 KB
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import bundleAnalyzer from '@next/bundle-analyzer';
import path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
export default withBundleAnalyzer({
reactStrictMode: false,
productionBrowserSourceMaps: false,
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
optimizePackageImports: ['@mantine/core', '@mantine/hooks'],
serverComponentsExternalPackages: ['mongoose'],
},
sassOptions: {
prependData: `@import "./_mantine.scss";`,
},
images: {
formats: ['image/avif'],
localPatterns: [
{
pathname: '/images/**',
},
],
remotePatterns: [
{
protocol: 'https',
hostname: 'storage.googleapis.com',
},
],
},
webpack: config => {
config.resolve.alias['@'] = path.resolve('./')
return config
},
redirects: async () => {
const categories = ['miscellaneous', 'RECORDERS', 'POCKET', 'MERCURY', 'BOURDON', 'ANEROID']
return categories.map(name => {
const source = '/collection/categories/' + name.toLowerCase()
return {
source, // old route
destination: source + '/date/1', // new route
permanent: true,
}
})
},
})