-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnext.config.mjs
67 lines (66 loc) · 1.79 KB
/
next.config.mjs
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
57
58
59
60
61
62
63
64
65
66
67
import withBundleAnalyzer from '@next/bundle-analyzer';
import mdx from '@next/mdx'
import remarkGfm from 'remark-gfm'
/**
* Don't be scared of the generics here.
* All they do is to give us autocompletion when using this.
*
* @template {import('next').NextConfig} T
* @param {T} config - A generic parameter that flows through to the return type
* @constraint {{import('next').NextConfig}}
*/
function defineNextConfig(config) {
return config;
}
const withBundleAnalyzerWrapper = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
const withMDX = mdx({
extension: /\.(md|mdx)$/,
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [],
},
})
export default withMDX(withBundleAnalyzerWrapper(
defineNextConfig({
reactStrictMode: false,
swcMinify: false,
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: process.env.IS_GH_ACTION === "true",
},
compiler: {
styledComponents: true,
},
transpilePackages: ['@mui/material', '@thebadge/ui-library', '@web3-onboard/*'],
images: {
unoptimized: true,
domains: [
"tokens.1inch.io",
"ethereum-optimism.github.io",
"assets.coingecko.com"
]
},
webpack: (config) => {
// load worker files as a urls by using Asset Modules
// https://webpack.js.org/guides/asset-modules/
config.module.rules.unshift({
test: /pdf\.worker\.(min\.)?js/,
type: "asset/resource",
generator: {
filename: "static/worker/[hash][ext][query]"
}
});
config.externals.push(
"pino-pretty",
"lokijs",
"encoding"
);
return config;
}
}),
));