0

I am having trouble getting an Angular stackblitz app to use the path aliases.

Using Angular 15.2.3

tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./src/",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2018", "dom"],
    "paths": {
      "@components/*": ["app/components/*"],
      "@pages/*": ["app/pages/*"]
    }
  },
  "angularCompilerOptions": {
    "strictTemplates": true,
    "strictInjectionParameters": true
  }
}

If you remove the "paths": entry it works fine, otherwise it forever loads.

My stackblitz example app - StackBlitz Example

Any help appreciated!

Scottish Smile
  • 455
  • 7
  • 22
  • I found a relevant thread on github, seems like this is a known issue. Maybe stackblitz still doesn't support custom paths? - https://github.com/stackblitz/core/issues/220 – Scottish Smile Mar 23 '23 at 01:21
  • Someone has it working here for an earlier version of Angular 15. I can't see the difference... - https://stackblitz.com/edit/angular-5tzu5g?file=tsconfig.json – Scottish Smile Mar 23 '23 at 01:33

0 Answers0