From 2324782d0e755da532e0c0723e67171fc3ae462e Mon Sep 17 00:00:00 2001 From: Rodrigo Luglio Date: Thu, 10 Oct 2024 09:30:42 -0300 Subject: [PATCH] test wasm turbo --- next.config.mjs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 90dc9da..163dabc 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -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', },