Skip to content

Instantly share code, notes, and snippets.

@ezzabuzaid
Created March 26, 2021 22:10
Show Gist options
  • Save ezzabuzaid/67bfaee0f648015b0a2eb86f164a1910 to your computer and use it in GitHub Desktop.
Save ezzabuzaid/67bfaee0f648015b0a2eb86f164a1910 to your computer and use it in GitHub Desktop.
Node.js TypeScript path alias resolver
const tsConfig = require('../tsconfig.json');
const tsConfigPaths = require('tsconfig-paths');
tsConfigPaths.register({
baseUrl: __dirname,
paths: tsConfig.compilerOptions.paths,
});
@ezzabuzaid
Copy link
Author

Put that snippet at the top of the entry point of execution (main.ts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment