From dfd02175b560ed540b09b40528cffab814e460cd Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Tue, 3 May 2016 18:06:03 -0700 Subject: [PATCH] feat(babel6): Remove support for @babel header --- src/compile-cache.js | 1 - src/compile-support/babel.js | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/compile-cache.js b/src/compile-cache.js index 186d98b40..71c790386 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -9,7 +9,6 @@ var typescriptCompiler = require('./compile-support/typescript') var CSON = null var COMPILERS = { - '.js': babelCompiler, '.jsx': babelCompiler, '.es6': babelCompiler, '.ts': typescriptCompiler, diff --git a/src/compile-support/babel.js b/src/compile-support/babel.js index df03b5e11..406818dad 100644 --- a/src/compile-support/babel.js +++ b/src/compile-support/babel.js @@ -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) {