Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support tsconfig paths option in type stripping mode #57113

Closed
alexsch01 opened this issue Feb 18, 2025 · 1 comment
Closed

support tsconfig paths option in type stripping mode #57113

alexsch01 opened this issue Feb 18, 2025 · 1 comment
Labels
feature request Issues that request new features to be added to Node.js.

Comments

@alexsch01
Copy link
Contributor

What is the problem this feature will solve?

If you do

import abc from "@/abc.ts"

with the tsconfig option paths, it doesn't find the file

What is the feature you are proposing to solve the problem?

It would be nice if tsconfig's paths option was supported in the new type stripping mode
https://www.typescriptlang.org/tsconfig/#paths

What alternatives have you considered?

Please close this if it's not something possible with how the typescript-nodejs setup works

@alexsch01 alexsch01 added the feature request Issues that request new features to be added to Node.js. label Feb 18, 2025
@github-project-automation github-project-automation bot moved this to Awaiting Triage in Node.js feature requests Feb 18, 2025
@alexsch01
Copy link
Contributor Author

alexsch01 commented Feb 18, 2025

[package.json]

{
    "type": "module",
    "imports": {
        "#controllers/*": "./src/controllers/*",
        "#routes/*": "./src/routes/*"
    }
}

[index.ts]

import controller1 from '#controllers/controller1.ts'
import route1 from '#routes/route1.ts'

This code works which replicates the functionality of tsconfig paths option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js.
Projects
Archived in project
Development

No branches or pull requests

1 participant