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

feat: use baseUrl and paths for imports #894

Closed
shobhitic opened this issue Nov 29, 2022 · 1 comment
Closed

feat: use baseUrl and paths for imports #894

shobhitic opened this issue Nov 29, 2022 · 1 comment
Labels
🌟 enhancement New feature or request

Comments

@shobhitic
Copy link

Is your feature request related to a problem? Please describe.

Not a problem, but the imports like

import { prisma } from "../../../server/db/client";

feel a little disorienting. Other frameworks like Redwood have moved to using typescript paths to solve them.

Describe the solution you'd like to see

Paths are a typescript compilation option (see here) in the tsconfig file with which we can use something like

import { prisma } from "src/server/db/client";

in place of

import { prisma } from "../../../server/db/client";

To do this, we need to define baseUrl and paths object in tsconfig file, and then change the imports.

Describe alternate solutions

Alternate would be to go forward with what is available right now and don't change it.

Additional information

Happy to work on a PR for this.

@shobhitic shobhitic added the 🌟 enhancement New feature or request label Nov 29, 2022
@nexxeln
Copy link
Member

nexxeln commented Nov 29, 2022

Please search for existing issues before making one. Duplicate of #51, #85, #144, #188.

@nexxeln nexxeln closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants