microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.23k stars 12.39k forks source link

/// <reference path="typings/angular2/angular2.d.ts" /> is considered relative external module #3313

Closed neermitt closed 9 years ago

neermitt commented 9 years ago

As per spec of tyepscript 1.5

External module names may be relative or top-level. An external module name is relative if the first term is "." or ".."

but current implementation interprets "typings/angular2/angular2.d.ts" as external because its not rooted (absolute)

function processReferencedFiles(file: SourceFile, basePath: string) {
            forEach(file.referencedFiles, ref => {
                let referencedFileName = isRootedDiskPath(ref.fileName) ? ref.fileName : combinePaths(basePath, ref.fileName);
                processSourceFile(normalizePath(referencedFileName), /* isDefaultLib */ false, file, ref.pos, ref.end);
            });
        }
mhegazy commented 9 years ago

@neermitt can you provide some code samples of the issue you are running into?

neermitt commented 9 years ago

@mhegazy sorry my mistake in understanding typescript compiler module system