-
Notifications
You must be signed in to change notification settings - Fork 20
/
next.config.js
50 lines (46 loc) · 1.05 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
const optimizedImages = require('next-optimized-images');
const withStyles = require('@webdeb/next-styles')
const withPlugins = require('next-compose-plugins');
const webpack = require('webpack');
const sassConfig = {
sass: true, // use .scss files
modules: true // style.(m|module).css & style.(m|module).scss for module files
}
const optimizedImagesConfig = {
inlineImageLimit: 8192,
imagesFolder: 'images',
imagesName: '[name]-[hash].[ext]',
optimizeImagesInDev: false,
mozjpeg: {
quality: 80
},
optipng: {
optimizationLevel: 3
},
pngquant: false,
gifsicle: {
interlaced: true,
optimizationLevel: 3
},
svgo: {
// enable/disable svgo plugins here
},
webp: {
preset: 'default',
quality: 75
}
};
const nextConfiguration = {
webpack: config => {
config.plugins.push(
new webpack.DefinePlugin({
PC: JSON.stringify('pc')
})
);
return config;
},
};
module.exports = withPlugins([
[withStyles, sassConfig],
[optimizedImages, optimizedImagesConfig],
], nextConfiguration);