forked from subhadeeproy3902/BloxAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
38 lines (33 loc) · 865 Bytes
/
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
import withPWA from 'next-pwa';
const pwaConfig = {
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development',
};
const withPWAConfig = withPWA(pwaConfig);
export default withPWAConfig({
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*',
}
]
},
webpack: (config, { isServer }) => {
// If it's a server build, exclude the `.node` file from bundling
if (isServer) {
config.externals = config.externals || [];
config.externals.push({
'@resvg/resvg-js-darwin-arm64/resvgjs.darwin-arm64.node': 'commonjs2 @resvg/resvg-js-darwin-arm64/resvgjs.darwin-arm64.node',
});
}
// Use node-loader for .node files
config.module.rules.push({
test: /\.node$/,
use: 'node-loader',
});
return config;
},
});