zoton2/nodecg-vue-ts-template

Running browser watch command not fully working because of custom tsconfig paths

Opened this issue · 1 comments

For some reason I guess I never noticed this when making the template before (it doesn't happen in build mode), but when you run the watch command for the browser, you get "The following dependencies are imported but could not be resolved" and it lists some "dependencies" which are just pointing to local files but using a custom path set in tsconfig.browser.json. This is actually an issue, as the browser pages don't actually load after this. My best guess to why this doesn't effect building is because the current paths being used in code only point to type files.

I tried putting in the vite-tsconfig-paths plugin but no luck, even though it can find the tsconfig.browser.json file just fine.

I also found a person mentioning it may be a rollup issue, but the way to fix it may have to be done in vite-plugin-nodecg. That fix can be found here.

It was suggested in the NodeCG Discord to just use the resolve.alias configuration in the vite.cconfig.mjs file and from what I can see, that seems to work. I thought I would've tried that before but I guess not? Shall do some more checks and close this if that does fix the issue.