-
Notifications
You must be signed in to change notification settings - Fork 65
/
next.config.js
46 lines (44 loc) · 981 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
44
45
46
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
});
const isCapacitor = process.env.CAPACITOR_BUILD === "true";
module.exports = withPWA({
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
images: {
imageSizes: [320, 480, 820, 1200, 1600],
domains: ["i.loli.net", "bgr.com", "www.ygeeker.com", "ygeeker.com"],
unoptimized: isCapacitor,
},
webpack: function (config) {
config.module.rules.push({
test: /\.md$/,
use: "raw-loader",
});
config.module.rules.push({
test: /\.ttf$/,
use: "ttf-loader",
});
config.module.rules.push({
test: /\.svg$/,
// issuer: {
// test: /\.(js|ts)x?$/,
// },
use: ["@svgr/webpack"],
});
return config;
},
i18n: isCapacitor
? undefined
: {
locales: ["zh-CN", "en-US"],
defaultLocale: "en-US",
},
});