19.
Babel: Transpiling to Old JavaScript
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
7 Comments
Hey folks,
I've had a lot trouble trying to run command for creating
RepLogApp.jsin dist folder on Windows. Updated node to8.9.4(so far latest recommended) trying to fixSyntaxError: missing ) after argument list, googled and googled and din't find what it is. So after a while found some similar problem on some other topic and found the solution: run:Hey Radoje,
Hm, so you're using the different "bin" path. I think, you can also use "./node_modules/.bin/babel" but prefix it with "node", like:
I.e. run this JS file through node, it's a known issue on Windows OS.
Anyway, thanks for sharing it with others!
Cheers!
Hey Viktor,
Tried it, didn't work in my PHPStorm console or CMD. Except when using bash. Maybe there's something wrong with my OS, heads up for Win users anyway :).
Cheers!
The last 2 vidoes I was not able to follow, I had different versions of npm, babel & yarn installed than you and also console was throwing many errors.
I couldnt create RepLogApp.js in disc folder but anyway even if I would be able to follow. The video was a rocket science for me and my brain of 5yrs old wouldnt get it anyway what was happening but I've got an idea/understand thoery what babel should do.
It seems that the purpose of Babel is just to take new javascript and make it compliant with older browsers.... so now All I need is actually some statement in the footer saying Optimized for Chrome 2018+ and all this will be irrelevant :D lol :D
Hey Peter,
Hm, sad to hear, probably your new version have some BC breaks, or maybe you just need to specify babel version to the one we use in this screencast.
> the purpose of Babel is just to take new javascript and make it compliant with older browsers
Exactly! So you write new JS code and keep calm knowing that your code works in old browsers :)
Hahaha, adding a note in the footer may work ;)
Cheers!
Was finally able to transpile an app I built a while ago. Thank you!
Yes! Good work ;)
Cheers!
"Houston: no signs of life"
Start the conversation!