top | item 32282257

(no title)

jeshin | 3 years ago

on the note of babel, I don't usually do front end stuff but the other day I wanted to transpile one single javascript file to support older browsers, one time and then never again. I tried for like an hour and I could not figure out how to do it, without setting up like a whole environment/pipeline for it. My expectation going into it was "surely there's some sort of command that just lets you do input file -> output file", but i struggled until I just gave up and used their web demo thing to do it (which tbh I should have just done to begin with, but I had not anticipated it would be so difficult).

I mean I'm sure it's possible somehow, but it sure isn't obvious. And I get that this is not at all the usual use case for it, but still

discuss

order

mccorrinall|3 years ago

Babel transpiles js to browsers which are older than me. You should give it a try.

cercatrova|3 years ago

If it's only one file, you could just go to the Babel website where they have a playground and paste it in, voilĂ , converted for older browsers. Now place the output file wherever you want.

saghm|3 years ago

Not sure if they edited their comment (although it seems unlikely given that your comment was four hours later), but that sounds exactly like what they said they did. Maybe I'm old-fashioned, but the idea that I need to upload a plaintext file to have it converted to another plaintext file so I can download it instead of just having a command to run locally seems almost surreal.