项目原始demo,不改动
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。
 
 
 
 

15 行
442 B

  1. "use strict";
  2. var path = require("path");
  3. module.exports = function relative(sourceRoot, filename) {
  4. var rootPath = sourceRoot.replace(/\\/g, "/").split("/")[1];
  5. var fileRootPath = filename.replace(/\\/g, "/").split("/")[1];
  6. // If the file is in a completely different root folder use the absolute path of file.
  7. if (rootPath && rootPath !== fileRootPath) {
  8. return filename;
  9. }
  10. return path.relative(sourceRoot, filename);
  11. };