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

Full Working Example? #133

Open
shellscape opened this issue Jan 21, 2024 · 3 comments
Open

Full Working Example? #133

shellscape opened this issue Jan 21, 2024 · 3 comments

Comments

@shellscape
Copy link

Any chance we can get a Stackblitz full working example posted in the docs for this?

I'm unable to get a very basic project working with this plugin, so there must be nuance to how this has to be setup. Specifically, the import-analysis keeps nuking my build, and I've tried every combination of settings. Would love to have a baseline reference of a working project to go off of for both Vite 4 and Vite 5

@shellscape
Copy link
Author

(FWIW my issue was related to an expectation that vite-tsconfig-paths was using the findUp functionality of tsconfk. However, it is not, and won't search parent directories for tsconig.json. I had to wire up that functionality myself to tell the plugin where to look. It would still be good of the project to put together a baseline Stackblitz, which could then be used as a reproduction template for forking)

@aleclarson
Copy link
Owner

aleclarson commented Jan 23, 2024

There is the ./demo folder within this repository that you could play with. PR welcome to anyone who wants to set up a StackBlitz for the README.

FWIW my issue was related to an expectation that vite-tsconfig-paths was using the findUp functionality of tsconfk. However, it is not, and won't search parent directories for tsconig.json.

This plugin uses tsconfck.findAll as long as the projects option isn't used.

: await tsconfck.findAll(workspaceRoot, {
configNames: opts.configNames || ['tsconfig.json', 'jsconfig.json'],
skip(dir) {
return dir == 'node_modules' || dir == '.git'
},
})

@shellscape
Copy link
Author

Good to know. Will run with this and try to setup a repro stackblitz for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants