-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathnext.config.js
52 lines (49 loc) · 1.13 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
/** @type {import('next').NextConfig} */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { i18n } = require('./next-i18next.config');
module.exports = withBundleAnalyzer({
i18n,
trailingSlash: false,
reactStrictMode: false,
compress: true, // 启用压缩
eslint: {
dirs: ['src'],
},
// Uncoment to add domain whitelist
images: {
domains: [
'raw.githubusercontent.com',
'img.hellogithub.com',
'thirdwx.qlogo.cn',
],
},
// SVGR
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: [
{
loader: '@svgr/webpack',
options: {
typescript: true,
icon: true,
},
},
],
});
config.module.rules.push({
test: /\.md$/,
use: 'raw-loader',
});
return config;
},
// experimental: {
// disableOptimizedLoading: true,
// scrollRestoration: true,
// },
});