mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 15:15:12 +08:00
feat(babel6): Remove support for @babel header
This commit is contained in:
parent
9230078ffe
commit
dfd02175b5
2 changed files with 1 additions and 18 deletions
|
@ -9,7 +9,6 @@ var typescriptCompiler = require('./compile-support/typescript')
|
|||
var CSON = null
|
||||
|
||||
var COMPILERS = {
|
||||
'.js': babelCompiler,
|
||||
'.jsx': babelCompiler,
|
||||
'.es6': babelCompiler,
|
||||
'.ts': typescriptCompiler,
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue