-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
56 lines (50 loc) · 1.38 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
/* eslint-disable no-process-env */
/* eslint-disable import/no-extraneous-dependencies */
const withBundleAnalyzer = require('@next/bundle-analyzer')
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
const webpack = require('webpack')
const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
const nextConfig = {
webpack(config, { nextRuntime }) {
config.plugins.push(
new CaseSensitivePathsPlugin(),
// new DuplicatePackageCheckerPlugin(),
new webpack.EnvironmentPlugin(process.env)
)
if (typeof nextRuntime === 'undefined') {
// eslint-disable-next-line no-param-reassign
config.resolve.fallback = {
...config.resolve.fallback,
crypto: false, // do not bring node:crypto fallback to client
}
}
return config
},
async redirects() {
return [
{
source: '/api-tokens',
destination: '/api-keys',
permanent: true,
},
]
},
productionBrowserSourceMaps: process.env.ANALYZE === 'true',
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
deviceSizes: [384, 640, 750, 828, 1080, 1200],
},
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
}
const plugins = [bundleAnalyzer]
module.exports = () => plugins.reduce((acc, next) => next(acc), nextConfig)