Files
ASHEBShop-h5/node_modules/babel-loader/lib/utils/relative.js
T
2017-05-10 16:33:00 +08:00

14 lines
353 B
JavaScript

"use strict";
var path = require("path");
module.exports = function relative(sourceRoot, filename) {
var rootPath = sourceRoot.replace(/\\/g, "/").split("/")[1];
var fileRootPath = filename.replace(/\\/g, "/").split("/")[1];
if (rootPath && rootPath !== fileRootPath) {
return filename;
}
return path.relative(sourceRoot, filename);
};