fix(compiler): treat absolute imports as package imports (#18912)

This is a corner case, and converting them is what
was expected in G3. This also fits the fact that
we already convert package paths into relative paths.


PR Close #18912
This commit is contained in:
Tobias Bosch
2017-08-30 16:08:55 -07:00
committed by Jason Aden
parent 4059a72710
commit fce7ae16f5
2 changed files with 8 additions and 5 deletions

View File

@ -142,7 +142,10 @@ class CompilerHostMixin {
resourceNameToFileName(resourceName: string, containingFile: string): string|null {
// Note: we convert package paths into relative paths to be compatible with the the
// previous implementation of UrlResolver.
if (resourceName && resourceName.charAt(0) !== '.' && !path.isAbsolute(resourceName)) {
const firstChar = resourceName[0];
if (firstChar === '/') {
resourceName = resourceName.slice(1);
} else if (firstChar !== '.') {
resourceName = `./${resourceName}`;
}
const filePathWithNgResource =