From b1c1989e60561d3311962fa1643c95cd1e4a9004 Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Mon, 2 Dec 2024 17:22:39 +0300 Subject: [PATCH] fix: wasm warning message, try optimizePackageImports on reaflow --- next.config.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/next.config.js b/next.config.js index afca1c6..c7becdf 100644 --- a/next.config.js +++ b/next.config.js @@ -10,13 +10,20 @@ const config = { output: "export", reactStrictMode: false, productionBrowserSourceMaps: true, + experimental: { + optimizePackageImports: ["reaflow"], + }, compiler: { styledComponents: true, }, - webpack: config => { + webpack: (config, { isServer }) => { config.resolve.fallback = { fs: false }; config.output.webassemblyModuleFilename = "static/wasm/[modulehash].wasm"; - config.experiments = { asyncWebAssembly: true }; + config.experiments = { asyncWebAssembly: true, layers: true }; + + if (!isServer) { + config.output.environment = { ...config.output.environment, asyncFunction: true }; + } return config; },