index.js
function resolve(val, i, isPath) {
			val = val.replace('~', '');
			return Promise.resolve(System.normalize(val))
					.then(function(normalized) {
						return System.locate({name: normalized, metadata: {}});
					})
					.then(function(address) {
						if (isPath) {
							options.includePaths.push(
									path.resolve(address.replace('file:', '').replace('.js', ''))
							);
						} else {
							var originalRelativePath      = path.relative(
									path.dirname(file.path),
									path.resolve(address.replace('file:', '').replace('.js', ''))
							);
							var originalRelativePathArray = originalRelativePath.split(path.sep);

							replacements[i] = path.posix?
									path.posix.join.apply(this, originalRelativePathArray):
									path.normalize(originalRelativePath).replace(/\\/g, '/').replace('//', '/');
						}
					});
		}
function resolve(val, i, isPath) {
			val = val.replace('~', '');
			return Promise.resolve(System.normalize(val))
					.then(function(normalized) {
						return System.locate({name: normalized, metadata: {}});
					})
					.then(function(address) {
						if (isPath) {
							options.includePaths.push(
									path.resolve(address.replace('file:', '').replace('.js', ''))
							);
						} else {
							var originalRelativePath      = path.relative(
									path.dirname(file.path),
									path.resolve(address.replace('file:', '').replace('.js', ''))
							);
							var originalRelativePathArray = originalRelativePath.split(path.sep);

							replacements[i] = path.posix?
									path.posix.join.apply(this, originalRelativePathArray):
									path.normalize(originalRelativePath).replace(/\\/g, '/').replace('//', '/');
						}
					});
		}
function resolve ( val , i , isPath ) { val = val . replace ( '~' , '' ) ; return Promise . resolve ( System . normalize ( val ) ) . then ( function ( normalized ) { return System . locate ( { name : normalized , metadata : { } } ) ; } ) . then ( function ( address ) { if ( isPath ) { options . includePaths . push ( path . resolve ( address . replace ( 'file:' , '' ) . replace ( '.js' , '' ) ) ) ; } else { var originalRelativePath = path . relative ( path . dirname ( file . path ) , path . resolve ( address . replace ( 'file:' , '' ) . replace ( '.js' , '' ) ) ) ; var originalRelativePathArray = originalRelativePath . split ( path . sep ) ; replacements [ i ] = path . posix ? path . posix . join . apply ( this , originalRelativePathArray ) : path . normalize ( originalRelativePath ) . replace ( / \\ / g , '/' ) . replace ( '//' , '/' ) ; } } ) ; }
Use systemjs to resolve include files
@param val
@param i
@param {Boolean} isPath
@returns {*}
Use systemjs to resolve include files