-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
39 lines (33 loc) · 1.02 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
/* eslint-disable @typescript-eslint/no-var-requires */
const withPlugins = require('next-compose-plugins');
const bundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const nextTranslate = require('next-translate');
const nextOptimizedImages = require('next-optimized-images');
const nextPwa = require('next-pwa');
const eslintOptions = {
extensions: ['js', 'jsx', 'tsx', 'ts'],
};
const pwaConfig = {
pwa: {
dest: 'public',
disable: process.env.NODE_ENV === 'development',
publicExcludes: ['!*.jpg', '!*.png', '!*.svg', '!svg', '!images'],
buildExcludes: [/chunks\/images\/.*$/, /static\/images\/.*$/],
},
};
const nextConfig = {
future: {
webpack5: true,
},
webpack: (config) => {
// Unset client-side javascript that only works server-side
config.resolve.fallback = { fs: false, module: false };
return config;
},
};
module.exports = withPlugins(
[bundleAnalyzer, nextOptimizedImages, [nextPwa, pwaConfig]],
nextTranslate(nextConfig)
);