-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
40 lines (35 loc) · 982 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
39
40
import withPWA from '@ducanh2912/next-pwa';
/** @type {import('next').NextConfig} */
const nextConfig = {
pwa: {
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
disable: false,
swcMinify: true,
workboxOptions: {
disableDevLogs: true,
},
},
webpack: (config, { isServer }) => {
// WebAssembly configuration
config.experiments = { ...config.experiments, asyncWebAssembly: true };
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm';
// Optionally, add a rule for .wasm files if needed
config.module.rules.push({
test: /\.wasm$/,
type: 'webassembly/async',
});
// If it's the client-side bundle, add the WASM path
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
};
}
return config;
},
};
export default withPWA(nextConfig);