Honor /** use babel */ in addition to 'use babel'

This commit is contained in:
Max Brunsfeld
2015-08-18 15:49:34 -07:00
parent ca58687c88
commit e4b1d512cd
3 changed files with 10 additions and 1 deletions

View File

@@ -142,7 +142,7 @@ transpile = (sourceCode, filePath, cachePath) ->
# either generated on the fly or pulled from cache.
loadFile = (module, filePath) ->
sourceCode = fs.readFileSync(filePath, 'utf8')
if sourceCode.startsWith('"use babel"') or sourceCode.startsWith("'use babel'")
if sourceCode.startsWith('"use babel"') or sourceCode.startsWith("'use babel'") or sourceCode.startsWith('/** use babel */')
# Continue.
else if sourceCode.startsWith('"use 6to5"') or sourceCode.startsWith("'use 6to5'")
# Create a manual deprecation since the stack is too deep to use Grim