forked from cyrilwanner/next-optimized-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
34 lines (33 loc) 路 781 Bytes
/
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
/**
* Enriches the next.js configuration object with default config values for
* next-optimized-iamges and returns it
*
* @param {object} nextConfig - next.js configuration object
* @returns {object} enriched config
*/
const getConfig = nextConfig => ({
optimizeImages: true,
optimizeImagesInDev: false,
handleImages: ['jpeg', 'png', 'svg', 'webp', 'gif'],
imagesFolder: 'images',
imagesName: '[name]-[hash].[ext]',
removeOriginalExtension: false,
inlineImageLimit: 8192,
defaultImageLoader: 'img-loader',
mozjpeg: {},
optipng: {},
pngquant: {},
gifsicle: {
interlaced: true,
optimizationLevel: 3,
},
svgo: {},
svgSpriteLoader: {
symbolId: '[name]-[hash:8]',
},
webp: {},
...nextConfig,
});
module.exports = {
getConfig,
};