forked from EliteMasterEric/Teyvat.moe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
58 lines (49 loc) · 1.48 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
54
55
56
57
58
const withBundleAnalyzer = require('@next/bundle-analyzer')({
// enabled: process.env.ANALYZE === 'true',
enabled: false,
});
// Allows use of multiple plugins.
const withPlugins = require('next-compose-plugins');
/**
* Specifies a list of modules to be transpiled when building.
*/
const withTM = require('next-transpile-modules')([
'react-adaptive-hooks', // Provided as ESM module.
'react-leaflet-cluster', // Contains global CSS.
]);
/**
* Include internationalization configuration.
*/
const { i18n } = require('./next-i18next.config');
const baseConfig = {
// Target must be serverless to run on Netlify.
//target: 'serverless',
// Target must be experimental-serverless-trace to work with next-i18next.
target: 'experimental-serverless-trace',
// Provides source maps in production.
// These are used to improve stack traces in error reports.
productionBrowserSourceMaps: true,
future: {
webpack5: true,
},
webpack(config) {
// url loader
config.module.rules.push({
test: /\.(png|jpg|gif|svg)$/,
use: {
loader: 'url-loader',
},
});
// IDK why but this fixes a bug.
config.optimization.minimize = false;
return config;
},
i18n,
images: {
loader: 'default',
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 24, 32, 48, 64, 80, 96, 128, 256, 384],
// domains: ['assets.vercel.com'],
},
};
module.exports = withPlugins([withTM, withBundleAnalyzer], baseConfig);