-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
53 lines (45 loc) · 1.2 KB
/
next.config.ts
File metadata and controls
53 lines (45 loc) · 1.2 KB
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
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config: any) => {
// Add externals
config.externals.push("pino-pretty", "lokijs", "encoding");
// Handle source maps properly
config.module.rules.push({
test: /\.js\.map$/,
enforce: "pre",
use: ["source-map-loader"],
});
// Handle all declaration files and source maps
config.module.rules.push({
test: /\.(d\.ts|d\.ts\.map|js\.map)$/,
use: "null-loader",
type: "javascript/auto",
});
// Handle .mjs files
config.module.rules.push({
test: /\.m?js$/,
resolve: {
fullySpecified: false,
},
});
// Ignore specific problematic modules
config.resolve.alias = {
...config.resolve.alias,
"@metamask/sdk-communication-layer": false,
};
// Disable source maps in production
if (config.mode === "production") {
config.devtool = false;
}
return config;
},
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
};
export default nextConfig;