feat(babel6): Remove support for @babel header

This commit is contained in:
Evan Morikawa 2016-05-03 18:06:03 -07:00
parent 9230078ffe
commit dfd02175b5
2 changed files with 1 additions and 18 deletions

View file

@ -9,7 +9,6 @@ var typescriptCompiler = require('./compile-support/typescript')
var CSON = null
var COMPILERS = {
'.js': babelCompiler,
'.jsx': babelCompiler,
'.es6': babelCompiler,
'.ts': typescriptCompiler,

View file

@ -7,24 +7,8 @@ var defaultOptions = require('../../static/babelrc.json')
var babel = null
var babelVersionDirectory = null
var PREFIXES = [
'/** @babel */',
'"use babel"',
'\'use babel\''
]
var PREFIX_LENGTH = Math.max.apply(Math, PREFIXES.map(function (prefix) {
return prefix.length
}))
exports.shouldCompile = function (sourceCode, filePath) {
if (filePath.endsWith('.es6') || filePath.endsWith('.jsx')) {
return true;
}
var start = sourceCode.substr(0, PREFIX_LENGTH)
return PREFIXES.some(function (prefix) {
return start.indexOf(prefix) === 0
});
return (filePath.endsWith('.es6') || filePath.endsWith('.jsx'))
}
exports.getCachePath = function (sourceCode) {