-
Notifications
You must be signed in to change notification settings - Fork 474
/
next.config.js
50 lines (45 loc) · 1.45 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
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.BUNDLE_ANALYZER === 'true',
});
const withRoutes = require('nextjs-routes/config')({
outDir: 'nextjs',
});
const headers = require('./nextjs/headers');
const redirects = require('./nextjs/redirects');
const rewrites = require('./nextjs/rewrites');
/** @type {import('next').NextConfig} */
const moduleExports = {
transpilePackages: [
'react-syntax-highlighter',
'swagger-client',
'swagger-ui-react',
],
reactStrictMode: true,
webpack(config) {
config.module.rules.push(
{
test: /\.svg$/,
use: [ '@svgr/webpack' ],
},
);
config.resolve.fallback = { fs: false, net: false, tls: false };
config.externals.push('pino-pretty', 'lokijs', 'encoding');
return config;
},
// NOTE: all config functions should be static and not depend on any environment variables
// since all variables will be passed to the app only at runtime and there is now way to change Next.js config at this time
// if you are stuck and strongly believe what you need some sort of flexibility here please fill free to join the discussion
// https://github.com/blockscout/frontend/discussions/167
rewrites,
redirects,
headers,
output: 'standalone',
productionBrowserSourceMaps: true,
experimental: {
staleTimes: {
dynamic: 30,
'static': 180,
},
},
};
module.exports = withBundleAnalyzer(withRoutes(moduleExports));