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

Generate a more minimal tsconfig paths output for default scenario #61

Open
crhistianramirez opened this issue Apr 25, 2023 · 6 comments
Labels
enhancement New feature or request question Further information is requested working on it Task in progress

Comments

@crhistianramirez
Copy link

crhistianramirez commented Apr 25, 2023

For each folder tsconfig.json is updated with a new paths entry. This can get a bit noisy to check in anytime a new folder is created. For the default config which is one level deep the following configuration can be used:

{
  "compilerOptions": {
    "paths":  {
      "@*": ["src/*"]
    }
  }
}

That single configuration can handle any number of folders one level deep

@Subwaytime
Copy link
Owner

Subwaytime commented Apr 25, 2023

This has been reported multiple times but its not part of the library scope.
vite-aliases is specifically build for bigger projects where organisation and management is key.

Also, please do not post non-related Issues to this Git repository, this is neither helpful nor it is a Bugreport.

@crhistianramirez
Copy link
Author

vite-aliases is specifically build for bigger projects where organisation and management is key

My suggestion was to reduce the amount of code output to tsconfig.json to a version that is more terse, to improve developer experience. I don't see how that suggestion runs counter to your stated goal.

As an aside, it is common to post enhancement or feature requests to repos. If you don't want that kind of feedback, it might be worth posting something in your readme.

Cheers

@Subwaytime
Copy link
Owner

Subwaytime commented Apr 26, 2023

Ah okay, sorry, must've misunderstood your issue then! Thought you were pointing out that using one alias is enough, which works for some projects and has been suggested a lot, but like i said isnt the scope of this library.

So are you suggesting if the user sets the option depth to 1, it wont generate any of the folders as aliases?

@Subwaytime Subwaytime reopened this Apr 26, 2023
@Subwaytime Subwaytime added the question Further information is requested label Apr 26, 2023
@crhistianramirez
Copy link
Author

Correct, that is my suggestion exactly. It's not a big deal, functionally they are equivalent but I think using this provides a slightly better developer experience because the tsconfig only needs to be updated once whereas with the current implementation adding or removing folders will change the file and require updates to be checked in.

If you think this is a good enhancement I'd be happy to make a pull request. If not, no worries, appreciate your consideration either way.

@Subwaytime Subwaytime added the enhancement New feature or request label Apr 28, 2023
@Subwaytime
Copy link
Owner

Subwaytime commented Apr 28, 2023

Hm, i think it might fit well into the current Changes that i am working on!
Will post something in this Thread, if i am gonna include it directly in the upcoming changes.

@Subwaytime
Copy link
Owner

Will be included in the next upcoming v0.12.0

@Subwaytime Subwaytime added the working on it Task in progress label Jan 8, 2024
@Subwaytime Subwaytime mentioned this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested working on it Task in progress
Projects
None yet
Development

No branches or pull requests

2 participants