Answer the question
In order to leave comments, you need to log in
How to compile ES6 on the fly?
Hello everyone, I am writing a small code editor on the site, for myself. And there is a task, when you click on the play button, you need to run the js code block, but before that run it through babel, well, or through something else that performs similar functionality. Do not tell me how this can be done on the client, or can be sent to the server, there is somehow compiled and sent back, for the beyble I find only console commands (
Answer the question
In order to leave comments, you need to log in
Babel has an online transpiler on offsite , if you open the console, you can see that no requests are sent to the server when transpiling. Next, we go to Beybel's github and find the source code of their site there, look for a function there that is called for transpilation. We find and rejoice)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question