-
Notifications
You must be signed in to change notification settings - Fork 21
/
next.config.js
58 lines (56 loc) · 1.56 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 nodeExternals = require('webpack-node-externals');
const path = require('path');
const colors = require('tailwindcss/colors');
const nextConfig = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.resolve.fallback.fs = false;
}
config.module.rules.push({
test: /\.md$/,
use: 'raw-loader',
});
config.module.rules.push({
include: path.resolve(__dirname, 'node_modules/canvas'),
use: 'null-loader',
});
config.module.rules.push({
include: path.resolve(__dirname, 'node_modules/canvas'),
use: 'null-loader',
});
config.module.rules.push({
test: /\.svg$/i,
use: [{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [{
removeViewBox: false,
},
{ removeDimensions: true },
],
},
},
},
],
});
return config;
},
images: {
// limit of 25 deviceSizes values
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
// limit of 25 imageSizes values
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
// limit of 50 domains values
domains: [],
path: '/public',
// loader can be 'default', 'imgix', 'cloudinary', 'akamai', or 'custom'
loader: 'akamai',
// minimumCacheTTL is in seconds, must be integer 0 or more
minimumCacheTTL: 60,
},
// webpack5: true, available as default from v11
// externals: [nodeExternals()],
};
module.exports = nextConfig;