-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
53 lines (48 loc) · 1.23 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
53
// Не поддавайтесь соблазну использовать здесь import
const runtimeCaching = require('next-pwa/cache');
const plugins = [];
const withPWA = require('next-pwa')({
dest: 'public',
register: true,
runtimeCaching,
mode: 'production',
reloadOnOnline: true,
cacheOnFrontEndNav: true,
disable: process.env.NODE_ENV === 'development',
skipWaiting: true,
sw: '/sw.js',
buildExcludes: [
/middleware-manifest\.json$/,
/_middleware\.js$/,
/_middleware\.js\.map$/,
/middleware-runtime\.js$/,
/server\/pages\/_middleware\.js$/,
],
});
plugins.push(withPWA);
const nextConfig = {
compiler: {
removeConsole: process.env.NODE_ENV !== 'development',
},
reactStrictMode: true,
images: {
domains: [
'xieffect.pythonanywhere.com',
'cdn.discordapp.com',
'localhost:3000',
'localhost:5000',
'xieffect.ru:5000',
'xieffect.ru',
'www.youtube.com',
],
},
webpack(config) {
config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)$/i,
issuer: { and: [/\.(js|ts|md)x?$/] },
type: 'asset/resource',
});
return config;
},
};
module.exports = () => plugins.reduce((acc, next) => next(acc), nextConfig);