Setting up Subpath Import Aliases in a TypeScript Project

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • tsconfig-paths

    Load node modules according to tsconfig paths, in run-time or via API.

    In TypeScript, there is an older way for setting up aliases via paths option. Although it works fine for TypeScript itself, the problem is that Node.js is not aware of this config. You need to use third party packages to run compiled code (tsconfig-paths, tsc-alias).

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • vitest

    Next generation testing framework powered by Vite.

    vitest.config.mts for running unit tests with vitest

  • tsc-alias

    Replace alias paths with relative paths after typescript compilation

    In TypeScript, there is an older way for setting up aliases via paths option. Although it works fine for TypeScript itself, the problem is that Node.js is not aware of this config. You need to use third party packages to run compiled code (tsconfig-paths, tsc-alias).

  • subpath-imports-typescript

    Example of TypeScript project with Subpath Imports

    I've published a final working example on GitHub, you are welcome to check it out. Thanks for reading and happy coding! ❤️

  • tsx

    ⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js

    For other tools, you should check their documentation on custom conditions support. I've tried to run my project with tsx. As it supports all Node.js flags, I've just provided custom condition via -C flag:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • NPkill - Let's get rid of unused node_modules

    1 project | dev.to | 16 Sep 2024
  • Ask HN: What are you working on (August 2024)?

    132 projects | news.ycombinator.com | 24 Aug 2024
  • Release of Viddy v1.0.0: Migration from Go to Rust

    3 projects | dev.to | 22 Aug 2024
  • Building a Google Apps Script Workout Logger: Track and Visualize Your Fitness Progress with Spreadsheets and Looker Studio

    3 projects | dev.to | 27 Jul 2024
  • Web Crap Has Taken Control

    1 project | news.ycombinator.com | 22 Jul 2024