From 099dccd2ed042d631513dc604eec48134d168f0f Mon Sep 17 00:00:00 2001 From: Ryan Trinkle Date: Mon, 3 Jul 2023 16:02:30 -0400 Subject: [PATCH] Avoid errors resolving dependencies in GHCJS output --- src/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/index.js b/src/index.js index 7314a91..d173fc2 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,16 @@ module.exports = (nextConfig = {}) => { const { dir, dev, isServer } = options; + //TODO: We need this because all.js includes conditional `require` + //commands for these modules; even though it does not use them in + //practice, webpack wants to find them statically. Instead, we should + //deal with this in haskell-loader, e.g. by asking GHCJS not to produce + //these `require` invocations. + config.resolve.fallback = { + ...config.resolve.fallback, + fs: false, + child_process: false + }; config.module.rules.push({ test: /\.(cabal)$/, use: [