-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
79 lines (65 loc) · 1.8 KB
/
next.config.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const { i18n } = require('./next-i18next.config')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
const createWithImages = (imageConfig) => (nextConfig) =>
require('next-images')({ ...imageConfig, ...nextConfig })
const withImages = createWithImages({
// exclude: /\.svg$/,
})
const config = {
// experimental: {
// forceSwcTransforms: true,
// },
images: {
disableStaticImages: true,
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
issuer: /\.tsx?$/,
loader: 'svg-react-loader',
})
// TODO: Remove this if nx fix their webpack overrides - see issue
// https://github.com/nrwl/nx/issues/4182
// Prevent nx from adding an svg handler - stick to what is provided by
// nextjs or that we have defined ourselves.
config.module.rules.push = (...items) => {
Array.prototype.push.call(
config.module.rules,
...items.filter((item) => item.test.toString() !== '/\\.svg$/')
)
}
return config
},
i18n,
serverRuntimeConfig: {
API_URL: process.env.API_URL,
},
productionBrowserSourceMaps: true,
// async redirects() {
// return [
// {
// source: '/signup',
// destination:
// process.env.NEXT_PUBLIC_NEW_SIGNUP_FLOW === 'false'
// ? '/signup/0'
// : '/signup/account-type',
// permanent: true,
// },
// ]
// },
// async rewrites() {
// if (process.env.NEXT_PUBLIC_PROXY_ENABLED === 'true') {
// console.log('RUNNING APPLICATION WITH PROXY')
// return []
// }
// return [
// {
// source: '/api/:slug*',
// destination: '/404',
// },
// ]
// },
}
module.exports = withBundleAnalyzer(withImages(config))