Skip to content

Instantly share code, notes, and snippets.

@navix
Created February 11, 2019 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navix/1d65bccb42ce2d23ed955e1312a61329 to your computer and use it in GitHub Desktop.
Save navix/1d65bccb42ce2d23ed955e1312a61329 to your computer and use it in GitHub Desktop.
Typescript Paths

Typescript Paths

Setup an alternative path to directories.

tsconfig.json

{
  "compilerOptions": {
    ...
    "paths": {
      "ui": ["./packages/ui"],
      "security": ["./modules/security"]
    }
  ...

Use in typescript files:

import { UiComponent } from 'ui';
// instead
import { UiComponent } from '../../../packages/ui';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment