Closed
Description
Hello,
It's a copy of issue #5031, it was closed as already implemented but I couldn't manage to make it work.
Steps to reproduce:
I've added this to my tsconfig.json:
"compilerOptions": {
"baseUrl": "src",
"paths": {
"shared/*": ["app/shared/*"]
}
}
Path to the constants file: src/app/shared/constants/index.ts
When I import it as usual import { testConst } from './shared/constants/index';
, it works fine:
But when I use absolute path, it crashes:
import { testConst } from 'shared/constants/index';
Webpack error:
ERROR in C:/Projects/myProject/UI/src/app/app.component.ts (2,27): Cannot find module 'shared/constants/index'.)
ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve 'shared/constants/index' in 'C:\Projects\myProject\UI\src\app'
Could someone confirm that this feature works? Does it need additional config?
Metadata
Metadata
Assignees
Labels
No labels