You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
i had an issue with await and compiling to ES6. i used the new forceES5: false option to avoid compiling to ES5. it worked on stealjs (in the browser). But if i want to create a bundle, steal-tools will compile all my code to ES5, if treeshaking is on.
Here is my Slack issue: https://bitovi-community.slack.com/archives/CFDDX9MJS/p1582789198006000
And here is my demo: https://github.com/pYr0x/steal-es6
use npm run build to create a bundle. In the generated index.js i will find code like
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
which mean that that await is compiled to a es5 generator function
The text was updated successfully, but these errors were encountered:
pYr0x
changed the title
treeshaking ignores compiling to ES6
treeshaking force compiling to ES5
Feb 27, 2020
when you are working with es6 @pYr0x i can supply you a working rollup config with remove-steal and steal-resolve support at last for canjs it does not support the additional hackish steal imports like ~ or module/module while i am not really sure about the latest
but at last you could do a real es6+ build of canjs also using lebab to fix and clean the canjs source so that it is really working without double assignments to var names and all this object patching avoided.
it is not perfect as I still will need to do a complete independent fork of canjs to fix all the design issues. but it produces the best working es6 build of canjs that is possible today with that legacy code.
conclusion
if your modules are using real valid ECMAScript syntax for imports you can use rollup + myconfig to create awsome ESNext canjs bundels.
Hey,
i had an issue with
await
and compiling to ES6. i used the newforceES5: false
option to avoid compiling to ES5. it worked on stealjs (in the browser). But if i want to create a bundle, steal-tools will compile all my code to ES5, iftreeshaking
is on.Here is my Slack issue: https://bitovi-community.slack.com/archives/CFDDX9MJS/p1582789198006000
And here is my demo: https://github.com/pYr0x/steal-es6
use
npm run build
to create a bundle. In the generatedindex.js
i will find code likewhich mean that that
await
is compiled to a es5 generator functionThe text was updated successfully, but these errors were encountered: