-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
56 lines (51 loc) · 1.18 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
const withTM = require('next-transpile-modules')([
'react-select',
'@radix-ui/react-checkbox',
'@radix-ui/react-collapsible',
'@radix-ui/react-accordion',
]);
const nextConfig = {
reactStrictMode: true,
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
scrollRestoration: true,
},
async redirects() {
return [
{
source: '/',
destination: '/dashboard',
permanent: false,
},
];
},
webpack(config) {
// Add a rule to ensure Babel loader processes JS and JSX files in node_modules/react-select
config.module.rules.push({
test: /\.(js|jsx|ts|tsx)$/,
include: /node_modules\/react-select\/src/,
use: {
loader: 'babel-loader',
options: {
presets: ['next/babel'],
plugins: ['@babel/plugin-transform-flow-strip-types'],
},
},
});
config.resolve.extensions.push('.js', '.jsx');
config.module.rules.push({
test: /\.graphql$/,
exclude: /node_modules/,
use: {
loader: 'graphql-tag/loader',
},
});
return config;
},
};
module.exports = withTM(nextConfig);