If you look around you'll find quite a few people complaining that Angular CLI doesn't work "out of the box" with path aliases for the TypeScript compiler.
Fortunately the handy tool tsc-alias will run the rule over your compiled output and replace the still-present path aliases from your dev codebase with correctly resolved relative paths.
This tool mostly works correctly out of the box, but there are a couple of frustrating gotchas:
- Angular sets up custom
tsconfig.json
files everywhere (egtsconfig.lib.json
). Tools such as ESLint etc don't love this practice and the TypeScript compiler itself doesn't recognise these files or apply their "paths" aliases correctly.