feat: esm and cjs builds for node and browser#81
Conversation
| "import": "./lib/png-js.js", | ||
| "require": "./lib/png-js.cjs" | ||
| }, | ||
| "default": "./lib/png-js.browser.js" |
There was a problem hiding this comment.
Will this need a "browser" path? If I understood node docs correctly node takes precedence over default, but it also mentions community conditions definitions which I guess are supported but not part of the standard
|
Thanks for the review @blikblum ! when can we expect to have this merged? |
|
Need one more review |
|
@devongovett @blikblum do you think we can move forward with this? I'd love to remove react-pdf's fork. Would be beneficial for everyone. |
|
@blikblum @devongovett who has npm rights for this lib? Can I become a maintainer? |
devongovet |
|
@devongovett would be possible to merge and release this please? |
| @@ -1,5 +1,5 @@ | |||
| const PNGNode = require('../png-node'); | |||
| const fs = require('fs'); | |||
| const { default: PNGNode } = require('../lib/png-js.cjs'); | |||
There was a problem hiding this comment.
Fixed cjs build so it's not breaking anymore
|
@devongovett kind ping here :) |
|
@diegomura I invited you as a maintainer on npm |
|
Thanks a lot! |
Hi @devongovett ! Hope you are doing good.
I'd like to start using foliojs packages again in react-pdf. I gradually moved away from them due to several reasons, among them because node deps in foliojs repos. This includes pdfkit and png-js.
Here's my fork. This is the same node entrypoint here but bundled with rollup to generate node and browser entrypoints. Node ones are just like the existing ones. For browser though, we remove
fsdependency and ignore methods that use it, and replacezlibwithbrowserify-zlib.Not sure who's responsible of reviewing and publishing (I have merge rights here, but not publishing to npm) but this first step would be very helpful towards start unifying foliojs with react-pdf 😄