add jsx to possible extensions
This commit is contained in:
parent
59d6400eb9
commit
f33cd7184f
@ -127,7 +127,7 @@ var hookExtensions = function (_exts) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
hookExtensions([".es6", ".es", ".js"]);
|
hookExtensions(util.canCompile.EXTENSIONS);
|
||||||
|
|
||||||
module.exports = function (opts) {
|
module.exports = function (opts) {
|
||||||
// normalise options
|
// normalise options
|
||||||
|
|||||||
@ -12,11 +12,13 @@ var _ = require("lodash");
|
|||||||
exports.inherits = util.inherits;
|
exports.inherits = util.inherits;
|
||||||
|
|
||||||
exports.canCompile = function (filename, altExts) {
|
exports.canCompile = function (filename, altExts) {
|
||||||
var exts = altExts || [".js", ".jsx", ".es6", ".es"];
|
var exts = altExts || exports.canCompile.EXTENSIONS;
|
||||||
var ext = path.extname(filename);
|
var ext = path.extname(filename);
|
||||||
return _.contains(exts, ext);
|
return _.contains(exts, ext);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"];
|
||||||
|
|
||||||
exports.isInteger = function (i) {
|
exports.isInteger = function (i) {
|
||||||
return _.isNumber(i) && i % 1 === 0;
|
return _.isNumber(i) && i % 1 === 0;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user