From f33cd7184f2f9343e9b7cdf785b6bd4b4543f3ae Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 14 Jan 2015 15:09:15 +1100 Subject: [PATCH] add jsx to possible extensions --- lib/6to5/register.js | 2 +- lib/6to5/util.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/6to5/register.js b/lib/6to5/register.js index c5d51c833a..76cf325df7 100644 --- a/lib/6to5/register.js +++ b/lib/6to5/register.js @@ -127,7 +127,7 @@ var hookExtensions = function (_exts) { }); }; -hookExtensions([".es6", ".es", ".js"]); +hookExtensions(util.canCompile.EXTENSIONS); module.exports = function (opts) { // normalise options diff --git a/lib/6to5/util.js b/lib/6to5/util.js index 0affe7dab0..11301f16b4 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -12,11 +12,13 @@ var _ = require("lodash"); exports.inherits = util.inherits; exports.canCompile = function (filename, altExts) { - var exts = altExts || [".js", ".jsx", ".es6", ".es"]; + var exts = altExts || exports.canCompile.EXTENSIONS; var ext = path.extname(filename); return _.contains(exts, ext); }; +exports.canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"]; + exports.isInteger = function (i) { return _.isNumber(i) && i % 1 === 0; };