JRJurman / rollup-plugin-polyfill

Rollup Plugin to Include a Polyfill
7 stars 6 forks source link

Implement new polyfilling technique #9

Closed lukastaegert closed 2 years ago

lukastaegert commented 2 years ago

resolves #8

(I would also assume it resolves #4, but that would need verification I guess)

As promised, this PR implements the new polyfill approach I discussed. I also updated dependencies and implemented a comprehensive test suite.

The test setup may look slightly involved, I mostly copied and adapted it from the commonjs plugin. One may consider moving it to a separate file.

Other things to consider:

In any case, even though the plugin is now noticeably more complicated, it is now also noticeably simpler to use:

Feel free to modify as you see fit.

JRJurman commented 2 years ago

@lukastaegert I did a final check, and everything looks good - one final request, if you could update the minimum version in the /example/package.json of rollup to whatever is required, then I think this will be perfect, and I can merge and publish this :+1:

lukastaegert commented 2 years ago

Done

perrin4869 commented 2 years ago

@lukastaegert just one question, will sourcemaps still work with v4?

lukastaegert commented 2 years ago

Sure, as we are not transforming anything, there is nothing to mess up.