Created
March 26, 2021 22:10
-
-
Save ezzabuzaid/67bfaee0f648015b0a2eb86f164a1910 to your computer and use it in GitHub Desktop.
Node.js TypeScript path alias resolver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tsConfig = require('../tsconfig.json'); | |
const tsConfigPaths = require('tsconfig-paths'); | |
tsConfigPaths.register({ | |
baseUrl: __dirname, | |
paths: tsConfig.compilerOptions.paths, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put that snippet at the top of the entry point of execution (main.ts)