Sublime Forum

Adding babel support in script tags?

#1

I’ve already installed the packages needed to have babel support in .js files but I need the same for script tag in other file types. Right now, type=“text/babel” just has a block of white text. Temporarily changing the file type in Sublime to javascript(babel) works but it won’t recognize comments in the script tag.

I’ve also already tried editing the html.tmLanguage as described here (https://gist.github.com/iamntz/5070840) and that’s not doing anything different. I did change their text/template to text/babel.

So the question is either:

  1. Is there a way to edit the babel package so that it will recognize script tags in other file types? or

  2. Is there a way to edit html package to recognize the type in the script tag?

Note: My install of ST3 seems to be pulling many of the default files and/or packages from the ST2 install in case that’s a problem.

1 Like

How do I get proper react syntax highlight in text/babel scripts?
#2

Screenshot showing babel when file type is html and in script tag.

Screenshot showing file type babel and in script tag.

Showing file type babel and not in script tag

0 Likes

#3

Have the same problem, does anyone provide a solution in ST3?

1 Like