mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
windows paths fixes to use / over \
This commit is contained in:
parent
57f2b52612
commit
8a9d4f07e2
@ -70,6 +70,8 @@ function core(loader) {
|
||||
if (typeof window == 'undefined' &&
|
||||
typeof WorkerGlobalScope == 'undefined') {
|
||||
baseURI = 'file:' + process.cwd() + '/';
|
||||
if (isWindows)
|
||||
baseURI = baseURI.replace(/\\/g, '/');
|
||||
}
|
||||
// Inside of a Web Worker
|
||||
else if(typeof window == 'undefined') {
|
||||
|
||||
@ -11,6 +11,8 @@ $__global.upgradeSystemLoader = function() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var isWindows = typeof process != 'undefined' && !!process.platform.match(/^win/);
|
||||
|
||||
// Absolute URL parsing, from https://gist.github.com/Yaffle/1088850
|
||||
function parseURI(url) {
|
||||
var m = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
|
||||
@ -42,6 +44,9 @@ $__global.upgradeSystemLoader = function() {
|
||||
return output.join('').replace(/^\//, input.charAt(0) === '/' ? '/' : '');
|
||||
}
|
||||
|
||||
if (isWindows)
|
||||
href = href.replace(/\\/g, '/');
|
||||
|
||||
href = parseURI(href || '');
|
||||
base = parseURI(base || '');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user