-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
43 lines (39 loc) · 1.02 KB
/
next.config.js
File metadata and controls
43 lines (39 loc) · 1.02 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
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
net: false,
tls: false,
fs: false,
dgram: false,
'node-datachannel': false
};
}
// Add rules for handling Streamr SDK
config.module.rules.push({
test: /node_modules\/@streamr\/sdk/,
exclude: /\.json$/, // Exclude JSON files from babel-loader
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-runtime'
]
}
}
});
// Add specific rule for JSON files
config.module.rules.push({
test: /\.json$/,
type: 'json'
});
return config;
},
transpilePackages: ['@streamr/sdk']
};
module.exports = nextConfig;