instead of using only `cwd`, why not try something like this to consider `baseUrl`:
```
var relPath = !cwd && !config.baseUrl ? cwd : path.join(cwd, config.baseUrl);
```
then use `relPath` instead of just `cwd`:
```
jspath = relPath ? path.relative(relPath, jsfile) : jsfile;
```