-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnext.config.js
40 lines (36 loc) · 1 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
/* eslint-disable @typescript-eslint/no-var-requires */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const withImages = require('next-images')
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
transpilePackages: ['jotai-devtools'],
images: {disableStaticImages: true},
eslint: {
ignoreDuringBuilds: true,
dirs: ['pages', 'components', 'lib', 'hooks', 'store', 'types'],
},
reactStrictMode: true,
webpack(config) {
for (const rule of config.module.rules) {
if (rule.test instanceof RegExp && rule.test.test('.svg')) {
rule.resourceQuery = {not: /react/}
}
}
config.module.rules.push({
test: /\.svg$/i,
resourceQuery: /react/,
issuer: /\.[jt]sx?$/,
use: [
{
loader: '@svgr/webpack',
options: {dimensions: false},
},
],
})
return config
},
}
module.exports = withBundleAnalyzer(withImages(nextConfig))