Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es module distribution #446

Closed
LarsDenBakker opened this issue Aug 25, 2019 · 2 comments
Closed

es module distribution #446

LarsDenBakker opened this issue Aug 25, 2019 · 2 comments
Labels

Comments

@LarsDenBakker
Copy link

@LarsDenBakker LarsDenBakker commented Aug 25, 2019

The code published to NPM is commonjs and a proprietary webpack bundle, both of which can't be run in the browser without transformations.

Browsers use standard es modules as the module format. It would be great if fetch-mock can provide an es module distribution too so that it can be imported in the browser directly. As an example, sinon uses rollup to do this: (https://github.com/sinonjs/sinon).

I'd be happy to create a PR for this if this is something you're interested in.

@wheresrhys

This comment has been minimized.

Copy link
Owner

@wheresrhys wheresrhys commented Oct 23, 2019

Some notes on how this could be implemented https://2ality.com/2019/10/hybrid-npm-packages.html

@wheresrhys

This comment has been minimized.

Copy link
Owner

@wheresrhys wheresrhys commented Oct 26, 2019

v8.0.0-alpha.2 attempts to address this issue. Please leave a 👍 on the pull request #457 if your problem is solved, or alternatively leave a comment @LarsDenBakker @tomalec @sbryan @MathieuPuech

@wheresrhys wheresrhys closed this Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.