-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support for CommonJS? #1
Comments
@niksy I apologize for the late response, I am just seeing this now. I'm not against the change you are suggesting, however I am curious about what you are using this project for. The reason why I'm asking is because I was just recently planning on formally deprecating this project on npm as a lot has changed since this project was created and the primary motivation that lead to me creating this project was an bug in Chrome that was fixed. Thanks for your interest and contributing in open source 😄 |
@newoga it’s for the projects which don’t use ES imports and can benefit from not including same code in every file. Granted, there will be less and less projects over time like that, but it can be useful when publishing transpiled code for package and smaller output. I can create PR if you’re interested. |
@niksy Hey, sorry again for the late response. My email still gets overwhelmed from github emails relating to the material-ui project. If this change still has value for you, I'd be glad to accept a PR for it and release a new version. |
Fixes newoga#1. Also improves the fixuture expected outputs.
* Updates for Babel v7 compatability. - Updated dependencies. - New plugin implementation for Babel v7. - Use @babel/helper-module-imports so the output is either ESM or CJS depending if sourceType is module or script, fixing #1. - Added @babel/core peer dependency, as Babel does for official plugins. - Disabled and ignored package-lock.json. - Replaced lodash.assign in readme examples with object-assign to demo defaults. - New way to register Babel for Mocha tests. Huge thanks to @jaydenseric for implementing this!
Currently, transform expects that final code uses ES modules, but maybe there could be option to switch to CommonJS
require
?Code for
require
would look something like this:What do you think? I could create PR for this if you’re interested.
The text was updated successfully, but these errors were encountered: