normalise opts.sourceRoot path - 6to5/karma-6to5-preprocessor#5
This commit is contained in:
@@ -123,7 +123,10 @@ File.prototype.normalizeOptions = function (opts) {
|
||||
});
|
||||
|
||||
// normalize windows path separators to unix
|
||||
opts.filename = opts.filename.replace(/\\/g, "/");
|
||||
opts.filename = util.normalisePathSeparator(opts.filename);
|
||||
if (opts.sourceRoot) {
|
||||
opts.sourceRoot = util.normalisePathSeparator(opts.sourceRoot);
|
||||
}
|
||||
|
||||
opts.basename = path.basename(opts.filename, path.extname(opts.filename));
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ exports.canCompile = function (filename, altExts) {
|
||||
|
||||
exports.canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"];
|
||||
|
||||
exports.normalisePathSeparator = function (filename) {
|
||||
return filename.replace(/\\/g, "/");
|
||||
};
|
||||
|
||||
exports.isInteger = function (i) {
|
||||
return isNumber(i) && i % 1 === 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user