-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnext.config.js
46 lines (41 loc) · 1.11 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
/* eslint-disable @typescript-eslint/no-var-requires */
const withPlugins = require('next-compose-plugins');
const withPWA = require('next-pwa');
// const withBundleStats = require('next-plugin-bundle-stats');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const prod = process.env.NODE_ENV === 'production';
module.exports = withPlugins([withPWA, withBundleAnalyzer], {
pwa: {
disable: prod ? false : true,
dest: 'public',
},
async redirects() {
return [
{
source: '/notes',
destination: '/notes/home',
permanent: true,
},
];
},
webpack: (
config
// { dev, isServer }
) => {
// // Replace React with PReact only in client production build
// if (!dev && !isServer) {
// Object.assign(config.resolve.alias, {
// react: 'preact/compat',
// 'react-dom/test-utils': 'preact/test-utils',
// 'react-dom': 'preact/compat',
// });
// }
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
return config;
},
});