-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
62 lines (60 loc) · 1.75 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
59
60
61
62
const withSass = require('@zeit/next-sass')
const withCSS = require('@zeit/next-css');
const withFonts = require('next-fonts');
const withPlugins = require('next-compose-plugins');
const optimizedImages = require('next-optimized-images');
const withVideos = require('next-videos');
require('dotenv').config()
const nextJsConfig = {
webpack: (config, {dev, isServer}) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
console: true,
fs: 'empty',
net: 'empty',
tls: 'empty'
}
}
return config
},
env: {
SENDGRID_API_KEY: process.env.SENDGRID_API_KEY
},
exportTrailingSlash: true,
exportPathMap: function() {
return {
'/': { page: '/' },
'/blog2': { page: '/blog2' },
'/blog-details': { page: '/blog-details' },
'/error': { page: '/error' },
}
}
}
module.exports = withPlugins([
nextJsConfig,
[optimizedImages, {
inlineImageLimit: 8192,
imagesFolder: 'images',
imagesName: '[name]-[hash].[ext]',
handleImages: ['jpeg', 'jpg', 'png', 'svg', 'webp', 'gif', 'ico', 'mp4'],
optimizeImages: true,
optimizeImagesInDev: false,
mozjpeg: {
quality: 80,
},
optipng: {
optimizationLevel: 3,
},
pngquant: false,
gifsicle: {
interlaced: true,
optimizationLevel: 3,
},
webp: {
preset: 'default',
quality: 75,
},
}],
[withCSS],[withFonts],[withSass],[withVideos]
]);