Skip to content

Commit

Permalink
test wasm turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoLuglio committed Oct 10, 2024
1 parent aff8225 commit 2324782
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ const nextConfig = {
images: {
unoptimized: true,
},
webpack(config, { isServer, dev }) {
// Use the client static directory in the server bundle and prod mode
// Fixes `Error occurred prerendering page "/"`
config.output.webassemblyModuleFilename =
isServer && !dev ? '../public/onigasm.wasm' : 'public/onigasm.wasm'

// Since Webpack 5 doesn't enable WebAssembly by default, we should do it manually
config.experiments = { ...config.experiments, asyncWebAssembly: true }

return config
},
experimental: {
turbo: {
asyncWebAssembly: true,
rules: {
webassemblyModuleFilename: [
process.env.NODE_ENV === 'production'
? '../public/onigasm.wasm'
: 'onigasm.wasm',
],
},
resolveAlias: {
'monaco-editor': 'monaco-editor/esm/vs/editor/editor.api',
},
Expand Down

0 comments on commit 2324782

Please sign in to comment.