Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

fix: configure webpack to not use esmodules in dependencies #777

Merged
merged 1 commit into from
May 29, 2018

Conversation

alanshaw
Copy link
Contributor

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

Why require('big.js') is broken for us

Refs ipfs/js-ipfs#1363

Note that this solves the issue for big.js, but also for any other modules in the future that decide to define a module field in their package.json or any that already do and we just haven't realised it yet!

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)

Refs ipfs/js-ipfs#1363

Note that this solves the issue for `big.js`, but also for any other modules in the future that decide to define a `module` field in their `package.json` or any that already do and we just haven't realised it yet!

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
@ghost ghost assigned alanshaw May 24, 2018
@ghost ghost added the in progress label May 24, 2018
@alanshaw alanshaw requested a review from daviddias May 29, 2018 11:18
@daviddias daviddias merged commit dc14333 into master May 29, 2018
@ghost ghost removed the in progress label May 29, 2018
@daviddias daviddias deleted the fix/big-is-not-a-fun branch May 29, 2018 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants