Skip to content

Commit 2324782

Browse files
committed
test wasm turbo
1 parent aff8225 commit 2324782

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

Diff for: next.config.mjs

+8-11
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ const nextConfig = {
88
images: {
99
unoptimized: true,
1010
},
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-
20-
return config
21-
},
2211
experimental: {
2312
turbo: {
13+
asyncWebAssembly: true,
14+
rules: {
15+
webassemblyModuleFilename: [
16+
process.env.NODE_ENV === 'production'
17+
? '../public/onigasm.wasm'
18+
: 'onigasm.wasm',
19+
],
20+
},
2421
resolveAlias: {
2522
'monaco-editor': 'monaco-editor/esm/vs/editor/editor.api',
2623
},

0 commit comments

Comments
 (0)