Skip to content

Instantly share code, notes, and snippets.

@kerren
Created March 22, 2021 18:52
Show Gist options
  • Save kerren/d8ba057dfc1d22390c54d818e61781a9 to your computer and use it in GitHub Desktop.
Save kerren/d8ba057dfc1d22390c54d818e61781a9 to your computer and use it in GitHub Desktop.
[TSConfig Paths Import Example] How to use these paths in code #tsconfig #paths #typescript
// Before the "@config" path
import * as config from '../../config';
import { Config } from '../../config';
// After the "@config" path
import * as config from '@config';
import { Config } from '@config';
// Before the "@logger" path
import { LoggerService } from '../../shared/logger/logger.service';
// After the "@logger" path
import { LoggerService } from '@logger';
// Before the "@modules" path
import { SharedModule } from '../../../modules/shared/shared.module';
// After the "@modules" path
import { SharedModule } from '@modules/shared/shared.module';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment