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

Vite unplugin doesn't support project-absolute paths #774

Closed
edemaine opened this issue Oct 11, 2023 · 3 comments · Fixed by #786
Closed

Vite unplugin doesn't support project-absolute paths #774

edemaine opened this issue Oct 11, 2023 · 3 comments · Fixed by #786
Labels
bug Something isn't working plugin/integration Integrating Civet with other tools

Comments

@edemaine
Copy link
Collaborator

The paths also seem to be resolved differently if I'm building it, but only if it's a civet file. By default the script looks like this in index.html: /src/main.ts, note the starting /, which works normally with Vite and even works with .ts file even if I use the civet plugin. But if I use /src/main.civet it seems to try to resolve it from the machine's root, not the project root and doesn't find the file. Only in build. Changing it to ./src/main.civet works but it is different from normal Vite though.

Stackblitz Reproduction

@edemaine edemaine added bug Something isn't working plugin/integration Integrating Civet with other tools labels Oct 11, 2023
@STRd6
Copy link
Contributor

STRd6 commented Oct 13, 2023

What's the proper way to define project-absolute paths so the TS LSP picks it up?

In my testing it (surprisingly) worked with the Civet LSP in .ts files but the TS LSP thinks they are actual absolute paths and I don't know any config option to set to make TS understand this pattern.

Any thoughts?

@edemaine
Copy link
Collaborator Author

I think you can use baseUrl (unclear if it works with leading slash though). paths is also a common solution.

@STRd6
Copy link
Contributor

STRd6 commented Oct 14, 2023

The Stackblitz web based editor seems to pick it up fine but the same project and same configuration don't work locally on VSCode 🙀

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin/integration Integrating Civet with other tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants