Skip to content

Commit aff8225

Browse files
committed
test onigasm next config
1 parent 1c7deef commit aff8225

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: next.config.mjs

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ const nextConfig = {
88
images: {
99
unoptimized: true,
1010
},
11-
webpack: function (config, options) {
12-
config.options = { ...options, asyncWebAssembly: true }
11+
webpack(config, { isServer, dev }) {
12+
// Use the client static directory in the server bundle and prod mode
13+
// Fixes `Error occurred prerendering page "/"`
14+
config.output.webassemblyModuleFilename =
15+
isServer && !dev ? '../public/onigasm.wasm' : 'public/onigasm.wasm'
16+
17+
// Since Webpack 5 doesn't enable WebAssembly by default, we should do it manually
18+
config.experiments = { ...config.experiments, asyncWebAssembly: true }
19+
1320
return config
1421
},
1522
experimental: {

0 commit comments

Comments
 (0)