Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: configure webpack to not use esmodules in dependencies
Browse files Browse the repository at this point in the history
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](webpack/webpack#4742)

Fixes #1363

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed May 24, 2018
1 parent 2e40fb8 commit e234fe5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*',
Expand Down

0 comments on commit e234fe5

Please sign in to comment.