-
Notifications
You must be signed in to change notification settings - Fork 101
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
Modify exports for use with commonjs/es6 modules #107
Comments
Sure! PR? |
i think, that actually rollup might be a better tool for packaging it:
|
Making Bliss load as a ES6/CommonJS module is a side-effect of something else. My concern is not how we load it, because we can always use It depends how and where Bliss will run. Only in a browser with an anonymous |
Is there a way to use it in an ES6, babel, webpack env right now ? :) |
Does this article help? |
@tracker1 Agreed! Pull request? |
I don't know how to solve this "correctly", but here's what I'm doing: First, Then, once:
Afterwards, in all files where you want to use Bliss, do this:
The |
FWIW, I'm currently doing a rewrite of Bliss to use ESM. Should I close this as a duplicate of #226, since once that's complete, this will be resolved too? |
@LeaVerou Closing as a duplicate makes sense to me. |
I'm really sorry for not responding sooner, usually try to check GH notices a few times a week, but the past couple months have been abnormally busy... @LeaVerou cool beans on the rewrite. Honestly should have done a PR much sooner. |
It would be nice if you exported (test for module/module.exports as well as self) then exports against$, $ $ so that they can be imported directly...
This way it can be used via cjs modules built via browserify/webpack or via es6 imports via babel as such.
Alternatively, if
module.exports
exists,module.exports = Bliss
and assume "shy" mode.The text was updated successfully, but these errors were encountered: