re: Path aliases with TypeScript in Node.js VIEW POST

FULL DISCUSSION
 

Thanks!

Also I find out that if we have webpack in project we just use resolve.alias option:


  resolve: {
    extensions: ['.js', '.ts', '.tsx', '.styl'],
    mainFields: ['module', 'browser', 'main'],
    alias: Object.keys(tsconfig.compilerOptions.paths).reduce((aliases, aliasName) => {

      aliases[aliasName] = path.resolve(__dirname, `src/${tsconfig.compilerOptions.paths[aliasName][0]}`)

      return aliases
    }, {})
  },
code of conduct - report abuse