-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add ability to seamlessly transpile non-es6 formatted modules #768
Comments
Yeah, so the issue, as you pointed out, is that Steal only transpiles modules with import/export statements. The plan is to release #671 which will allow creating more robust plugins. From there I hope to create a babel plugin that allows you to set options like "transpile everything" or "transpile everything, except what's in node_modules", etc. |
Thanks for letting me know, @matthewp. Any idea when in could be available (roughly)? |
I would say ~1 month before a beta-ish version is ready. |
I see. Should I closwe this issue then? |
No, need the reminder to create this plugin. |
The plugins issue has gone cold for a variety of issues (I will update that issue with explanation). However, we are working on improving our Babel integration in #1040 so I think we can provide a way to do this. I can see a couple of ways of doing this, neither of which feel great. Adding here for discussion. transpileFilesThis is a new configuration object that lets you optionally transpile certain files. {
"steal": {
"transpileFiles": "*.js"
}
} Then a translate hook looks for pluginsAnother option is to utilize plugins. We could have a "steal-babel" plugin that adds the translate hook. However, how would it add the translate hook? I think it would have to be done in configDependencies. However configDependencies currently doesn't run on dependency packages. And it would likely break things badly if we changed that. An option could be for a new type of config that is like configDependencies but runs on dependency packages. |
For a possible path towards the "plugins" API from above, see this comment. |
I have a firmer proposal on this now: #1276 |
We have modules in CJS format contained ES6 statements (arrow functions, etc). These are library modules, which could be used both with NodeJS and inside the browser (via Steal). I don't see how it possible to transpile them while loading into browser in dev mode or building with StealTools.
Please point me to an option if such exists. If not, probably mixed module formats should be supported (like "format": "es6+cjs"), which tells the steal to eanspile the module first.
The text was updated successfully, but these errors were encountered: