-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
55 lines (49 loc) · 1.26 KB
/
next.config.js
File metadata and controls
55 lines (49 loc) · 1.26 KB
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
/* eslint-disable import/no-extraneous-dependencies */
const path = require('path')
const withPlugins = require('next-compose-plugins')
const withOptimizedImages = require('next-optimized-images')
const withVideos = require('next-videos')
const sharp = require('responsive-loader/sharp')
const nextConfig = {
// assetPrefix can differ based on NODE_ENV in case its not served from domain root
assetPrefix: '',
webpack: (config) => {
const enrichedConfig = config
enrichedConfig.resolve.alias.static = path.join(__dirname, 'static')
enrichedConfig.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack?+titleProp'],
})
return enrichedConfig
},
}
const optimizedImagesConfig = {
inlineImageLimit: 0,
handleImages: ['jpeg', 'png', 'webp', 'gif'],
responsive: {
adapter: sharp,
sizes: [400, 800, 1200, 1440],
},
removeOriginalExtension: false,
optimizeImages: true,
optimizeImagesInDev: false,
mozjpeg: {
quality: 80,
},
optipng: {
optimizationLevel: 3,
},
pngquant: false,
gifsicle: {
interlaced: true,
optimizationLevel: 3,
},
webp: {
preset: 'default',
quality: 75,
},
}
module.exports = withPlugins(
[[withOptimizedImages, optimizedImagesConfig], withVideos],
nextConfig,
)