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:
@ -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 =
|
||||
|
Reference in New Issue
Block a user