doesdev / rollup-plugin-analyzer

Mad metrics for your rollup bundles, know all the things
http://rollup-plugin-analyzer.doesdev.com
MIT License
242 stars 4 forks source link

Imports changed in 3.2.0 #13

Closed wldcordeiro closed 5 years ago

wldcordeiro commented 5 years ago

Might be worth noting in require() style the prior version would need a .default but now you can remove the .default to import the plugin.

doesdev commented 5 years ago

Ah, dang. Was hoping 3.2.0 was non-breaking. I made a mess of how things were exported a long time ago. Tried to clean it up in 3.0.0 but seemingly failed there. 3.2.0 was a hopeful fix to it, but as I'd been doing a destructured require in my usage and tests I hadn't previously caught the need for .default.

I'm going to add more explicit CJS and ESM require/import documentation to the README, push a rolled back 3.2.1 (because semver), and do a 4.0.0 release (because semver).

Thanks so much for bringing that to my attention.

doesdev commented 5 years ago

Actually, no. I hate to do a major version bump for that. I'm going to add a plugin in the build chain to append an export of default to the CJS output. 3.2.1 will handle that, making the change (hopefully) non-breaking.

doesdev commented 5 years ago

Okay, 3.2.1 is published, default should again work. Even though it's obviously not desirable to use default this should at least prevent breakage from the upgrade, and still allow using it directly. Also added import and require usage to the docs. Thanks again for bringing this up.

wldcordeiro commented 5 years ago

Thanks @doesdev for the awesome plugin! This was a very minor bump for me and I only opened the issue to raise awareness for you and other users. I was happy to remove the .default 😄 and with this config being shared I did it once and applied to 20 projects!