Extend Javascript Syntax Highlighting to "text/babel"


#1

When running Babel as a standalone script in the browser, it will automatically compile code within <script type="text/babel"> tags. However, Glitch’s syntax highlighting doesn’t apply to “text/babel” blocks:

28 AM

Can the syntax highlighting rules be changed to support “text/babel”?


#2

if you put your code in a separate .js file that you compile through node, then it should work (and will make your project code easier to maintain if it grows).

in a separate file, console.log would get parsed normally. (We might be missing highlighting for some of the fancier ES6 features in the editor though, but this example should definitely work)