-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
43 lines (40 loc) · 988 Bytes
/
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
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import { fileURLToPath } from 'url';
/** @type {import('next').NextConfig} */
export default {
reactStrictMode: true,
swcMinify: true,
sassOptions: {
includePaths: [
fileURLToPath(new URL('src/', import.meta.url)),
fileURLToPath(new URL('node_modules/', import.meta.url)),
],
},
webpack: (config, { isServer }) => ({
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{ test: /\.svg$/, use: ['@svgr/webpack'] },
],
},
plugins: [
...config.plugins,
...(!isServer && process.env.ANALYZE === 'true') ? [
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: './analyze/client.html',
generateStatsFile: true,
}),
] : [],
],
node: {
...config.node,
__dirname: true,
},
}),
experimental: {
typedRoutes: true,
},
};