Closed blikblum closed 4 years ago
This is great! thanks. I'll review and test it soon.
Hi, any updates?
Anything i can do?
@blikblum Sorry, I've been on holiday for a long while.
If I understand your comments correctly, this works both before and after your change:
import Bottle from 'bottlejs';
and this works before your change but not after:
const Bottle = require('bottlejs');
I'm fine bumping the major version number of bottle and leaving this the way you've described (I may have some additional breaking changes to make anyway). Let me know if I understand that correctly (I don't use webpack.)
If I understand your comments correctly,
Yes you are right
To use require would need to be:
const Bottle = require('bottlejs').default;
Hi, any news when a new release will be done, with ES modules support?
ES modules are required for tools like vite, pika and es-dev server
Let me know if i can help somehow
@blikblum https://github.com/young-steveo/bottlejs/releases/tag/v2.0.0 Thanks!
Many thanks
Fixes #129
Adds an ES module build along side existing one.
Code wise there's no change. I tested in a webpack project and is working fine.
Anyway is a breaking change because webpack users that import bottle with require will break:
This is far from ideal.
Solutions: 1) Avoid default export and use an named export. Would be consumed as below being consistent for both ES and CJS consumers
2) Do not use module entry in package. The users by default would still use the UMD build (no Breaking Change) and to use es module version would need to be explicit:
Personally i'm in favor of 1 since is a better solution long term but 2 is also doable.
Some context:
https://github.com/markedjs/marked/pull/1571#issuecomment-562891963 https://github.com/webpack/webpack/issues/4742#issuecomment-462789849