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:
@ -117,10 +117,10 @@ describe('NgCompilerHost', () => {
|
||||
.toBe('/tmp/src/a/child.html');
|
||||
});
|
||||
|
||||
it('should resolve absolute paths', () => {
|
||||
const ngHost = createHost({files: {'tmp': {'src': {'a': {'child.html': '<div>'}}}}});
|
||||
expect(ngHost.resourceNameToFileName('/tmp/src/a/child.html', '/tmp/src/index.ts'))
|
||||
.toBe('/tmp/src/a/child.html');
|
||||
it('should resolve absolute paths as package paths', () => {
|
||||
const ngHost = createHost({files: {'tmp': {'node_modules': {'a': {'child.html': '<div>'}}}}});
|
||||
expect(ngHost.resourceNameToFileName('/a/child.html', ''))
|
||||
.toBe('/tmp/node_modules/a/child.html');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user