I've found that I'm slowly digging my own grave, because the deeper my folder structure gets, the further back I must go each time I need to import a module from my root component:
import {ComponentsModule, SharedModule} from '../../../../../../shared'; Since that view also have child views then it will become even longer.
I looked at this question which suggests that this is not possible with Angular 2 as of now. Yet it seems so odd to me that there wouldn't be a way to achieve something like this instead:
import {ComponentsModule, SharedModule} from 'src/app/shared'; Is this a feature that will come in the future or is this already possible somehow?
EDIT: As per @Sasxa's suggestion I did this:
{ "compilerOptions": { "baseUrl": ".", "paths": { "*": [ "*" ] }, "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], "mapRoot": "./", "module": "es6", "moduleResolution": "node", "outDir": "../dist/out-tsc", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" ] } } But now when I try to start Angular CLI I get a whole bunch of errors, main ones being these: ERROR in Entry module not found: Error: Recursion in resolving and ERROR in multi main Module not found: Error: Recursion in resolving.
Is something missing?
tsconfig. I'll have to look into it too (;