Skip to content

Conversation

@jacobheun
Copy link
Contributor

Resolves #95 and #96

This is a trivial change, but avoids the need for more in depth code change and could be made more verbose to better support es module loading in browser and node, with the addition of browser specific esm files:

"module": "big.mjs",
"browser": {
  "./big.js":     "./big.browser.js",
  "./big.mjs": "./big.browser.mjs"
}

The goal of this PR is just to get the loading working again for default packager configuration.
For example webpack loads for browser in the following order by default: ["browser", "module", "main"] and default for node is: ["module", "main"].

If anyone wants to use the module version, they should be able to do an override. This would help maintain backwards compatibility while leaving the module field still available.

@jacobheun jacobheun mentioned this pull request May 23, 2018
@jacobheun
Copy link
Contributor Author

I've run this locally against failing builds of libp2p/libp2p-switch to verify the fix.

@MikeMcl MikeMcl merged commit 551af02 into MikeMcl:master May 24, 2018
@MikeMcl
Copy link
Owner

MikeMcl commented May 24, 2018

Thanks, Jacob.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants