-
Notifications
You must be signed in to change notification settings - Fork 103
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
Provide ES6 Module build #352
Comments
Yes. It is possible. Please, guide me through. Do I need to add |
Thanks!
It seems that currently, stampit uses node-compatible common.js-style |
Wow. Your know more than me! I heard this might be a good option to publish module like stampit https://github.com/developit/microbundle |
We accept PRs 😉 |
Before I cause a mess there – it seems that the code as been ES6 compatible, but was subsequently changed. This seems to have been part of minification, which I do not fully understand (was this for the code to be small itself or for being better minify-able?). |
Your understanding is correct.
Are you trying to rewrite to ES6? I would not recommend.
Instead, I'd recommend changing the exporting method only. Like, the last
(or more) line in the file.
Does that make sense?
…On Fri., 5 Jun. 2020, 03:31 jdittrich, ***@***.***> wrote:
Before I cause a mess there – it seems that the code as been ES6
compatible, but was subsequently changed
<b1086e7#diff-d3d1780d19f75055166112db1c679b84R486>.
This seems to have been part of minification, which I do not fully
understand (was this for the code to be small itself or for being better
minify-able?).
Another thing that is striking is the use of "var1", "var2"
<https://github.com/stampit-org/stampit/blob/master/src/stampit.js#L5>…
through the code, introduced in "further minification 7"
<c42ccad#diff-d3d1780d19f75055166112db1c679b84R5>
– why var var1 instead of var properties? (similar changes towards less
speaking variable names were also done before, e.g. in "further
minification 2")
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#352 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMMEL236GFHTF5AGNKOREDRU7K5LANCNFSM4NQA5SDQ>
.
|
Out of curiosity, what are the use cases for ES modules? One "silly" idea comes to my mind: have the source use ES Module syntax and use TypeScript compiler to compile the CommonJS version. If there is any other tool chain to transform CommonJS to ESM (or vice versa) I'd gladly give it a look. |
The modern tooling usually works fine with both - ES6 exporting and the CJS. However, they work slightly better with ES6 exporting version.
That's a good idea. I was thinking about it a lot myself. Can be done with Babel compiler too. Or Rollup. Or the above mentioned
Here is my typical approach. |
I would like to use stampit as ES6 module. However, it currently is only compatible with common.js or global variable use (If I understand correctly).
Is it possible to add an ES6 build of stampit?
The text was updated successfully, but these errors were encountered: