-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
39 lines (33 loc) · 856 Bytes
/
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 withBundleAnalyzer = require('@next/bundle-analyzer')
const withPWA = require('next-pwa')
const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
const pwa = withPWA({
pwa: {
disable: process.env.NODE_ENV === 'development',
dest: 'public',
},
})
const plugins = [[bundleAnalyzer], pwa]
module.exports = withPlugins(plugins, {
poweredByHeader: false,
async redirects() {
return [
{
source: '/blog',
destination: '/',
permanent: true,
},
]
},
webpack: (config, { isServer }) => {
// Fixes packages that depend on fs/module module
if (!isServer) {
config.node = { fs: 'empty', module: 'empty' }
}
return config
},
})