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
Transcrypt 3.7 for IE11 - Convert with rollup.js or with babel? #751
Comments
Ok, I got more details from the rollup.js guys (thanks Frank Lemanschik!). Rollup on its own cannot do the job because it does not take out things like So Babel seems to be the way to go... |
It's worth noting that Transcrypt uses Google's Closure for minification (-n switch, requires java), which could be another option for transpiling down to a lower ES level using the --language_out flag. See https://github.com/QQuick/Transcrypt/blob/master/transcrypt/modules/org/transcrypt/minify/__init__.py (it's statically set to ECMASCRIPT6_STRICT atm, but it used to be ECMASCRIPT5_STRICT). |
Interesting idea! However I tried it and it doesn't seem to work: In
and compile with
but the resulting main.js is then empty (it only conatins teh lines:
My hunch is that the Closure compiler cannot handle module constructs when compiling to ECMASCRIPT5_STRICT... |
Looks like it, thanks for the update. Some workarounds. I've not tried any of this yet, just adding notes here as i hope to cross this bridge myself some time. |
Closing since no further comments. |
I need to make Transcrypt output available on IE11 - which does not understand JS modules. :-( What's the best tool for this? rollup.js? Babel?
Following issue #634 I tried to convert the modules via rollup.js to scripts, but I encountered the following problem: In the original Transcrypt output calls to
document.getElementsByTag
work as expected returning the elements on teh page the module is imported from, howeverin the rolled-up code this call gives me always an empty list. So the document object exists but it doesn't have the elements from the page on it.Do I do something wrong when feeding the Transcrypt JS code to rollup.js? Anybody been sucessful with rolling up Transcrypt code for browsers?
Or is Babel the way to go to make Transcrypt available under IE? Anybody done this?
The text was updated successfully, but these errors were encountered: