aswi2020vldc-gitlab/templetes/node_modules/babel-loader/lib/utils/relative.js @ 3a515b92
1 |
"use strict"; |
---|---|
2 |
|
3 |
var path = require("path"); |
4 |
|
5 |
module.exports = function relative(sourceRoot, filename) { |
6 |
var rootPath = sourceRoot.replace(/\\/g, "/").split("/")[1]; |
7 |
var fileRootPath = filename.replace(/\\/g, "/").split("/")[1]; |
8 |
|
9 |
// If the file is in a completely different root folder use the absolute path of file.
|
10 |
if (rootPath && rootPath !== fileRootPath) { |
11 |
return filename; |
12 |
}
|
13 |
|
14 |
return path.relative(sourceRoot, filename); |
15 |
};
|
- « Předchozí
- 1
- 2
- 3
- Další »