-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnext.config.js
48 lines (45 loc) · 1.15 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
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback.net = require.resolve('net-browserify');
}
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
tls: false,
async_hooks: false,
};
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: ['preset-default'],
},
dimensions: false,
memo: true,
svgProps: {
role: 'img',
},
},
},
],
});
// We were getting an annoying Critical dependency warning that we
// couldn't do anything about. This filters that out of our console.
config.plugins.push(
new FilterWarningsPlugin({
exclude: [/Critical dependency/],
}),
);
return config;
},
};
module.exports = nextConfig;