From e234fe5cb64f0cd57ab2c542a429e00ff5d8abed Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 24 May 2018 09:49:43 +0100 Subject: [PATCH] fix: configure webpack to not use esmodules in dependencies Big.js just released an update that added esmodule support by adding a "module" field to their package.json. By default, webpack will use this field when requiring a module. Since esmodules aren't fully supported in the browser and we don't do any transpiling this PR configures webpack to not consider the esmodule field. [Webpack `mainFields` docs](https://webpack.js.org/configuration/resolve/#resolve-mainfields) [Why `require('big.js')` is broken for us](https://github.com/webpack/webpack/issues/4742) Fixes https://github.com/ipfs/js-ipfs/issues/1363 License: MIT Signed-off-by: Alan Shaw --- .aegir.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.aegir.js b/.aegir.js index 8fe6f90d9d..979ffde3df 100644 --- a/.aegir.js +++ b/.aegir.js @@ -5,6 +5,11 @@ const createServer = require('ipfsd-ctl').createServer const server = createServer() module.exports = { + webpack: { + resolve: { + mainFields: ['browser', 'main'] + } + }, karma: { files: [{ pattern: 'node_modules/interface-ipfs-core/js/test/fixtures/**/*',