fex-team / fis3-hook-relative

让 fis3 产出能够支持相对路径。
BSD 2-Clause "Simplified" License
30 stars 8 forks source link

在script里__uri('../img/a.png')报错 #6

Closed jincdream closed 8 years ago

jincdream commented 8 years ago
[ERROR] Path must be a string. Received false in [/page/index.html]

在外链的 js 和 html 的script标签都有这样的问题。 另外问下,如何开启 debug ?

oxUnd commented 8 years ago
fis3 release --verbose
jincdream commented 8 years ago

https://github.com/fex-team/fis3-hook-relative/blob/master/index.js#L28

  var relativeFrom = typeof host.relative === 'string' ? host.relative : host.release;
  if (rFile.test(relativeFrom)) {
    relativeFrom = path.dirname(relativeFrom);
  }

  url = path.relative(relativeFrom, url);

这里报错了。relativeFrom 是false。详细情况可以看这里:https://github.com/fex-team/fis3/issues/432