The utility function fromFileURL seem to have an inconsistent behavior, where it removes the leading / from the path when running on Windows, but not when running on a non-Windows system.
This inconsistency caused the issue reported in https://github.com/jspm/jspm-cli/issues/2361#issuecomment-350192381, where the source paths were only made relative to the outPath when building on a Windows system, thus resulting in full file system paths in source maps built on non-Windows systems.
This pull request fixes this bug.
Note that this fix is specifically to restore the correct behavior for source paths - it makes no attempt to fix the inconsistent behavior in the fromFileURL function, as the consequences of doing so are unclear.
The utility function
fromFileURL
seem to have an inconsistent behavior, where it removes the leading/
from the path when running on Windows, but not when running on a non-Windows system.This inconsistency caused the issue reported in https://github.com/jspm/jspm-cli/issues/2361#issuecomment-350192381, where the source paths were only made relative to the
outPath
when building on a Windows system, thus resulting in full file system paths in source maps built on non-Windows systems.This pull request fixes this bug.
Note that this fix is specifically to restore the correct behavior for source paths - it makes no attempt to fix the inconsistent behavior in the
fromFileURL
function, as the consequences of doing so are unclear.