`.applySourceMap()` requires a URL as its third argument; a Windows-style path does not work. `originalMap.sourcesRelativeTo` is guaranteed to be a URL, regardless of operating system. Using `path.dirname()` on it would change it to a Windows-style path when on Windows. Which would require us to change it back to a URL (source maps should contain URLs since they are used in the browser). So I simply chose between two different regexes :)

But you are right: We should probably use standard `path` operations, and normalize _all_ paths added to the source map to URLs—also in `exports.emit`. I’d recommend [urix](https://github.com/lydell/urix).