-
Notifications
You must be signed in to change notification settings - Fork 10
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
Live reloading changes from a common directory when using tsconfig paths #26
Comments
Hey, I use electron-esbuild myself for a personal project (papyrus-compiler-app in my profile). |
Here's what I've got: https://github.com/lewisandrew/Vite-Electron-Test |
In which side the live reload does not refresh? In renderer? If yes, this could be the vite server configuration that do not listen to common |
It's working with renderer. It doesn't work with the main process. Starting dev you'll see the console log "hello main stuff..." that comes from the common function executed in main.ts. Editing the console log message and saving the file doesn't trigger a reload of the main process (the updated console log message doesn't get logged), but saving in the main.ts file does. |
I think I found the problem. I tested with common/logger. In your esbuild does not seem to know that the file as changed cause of the tsconfig paths. Maybe esbuild needs a plugin? I think this is not related to |
Thanks for looking into this. I also see it working if I use relative paths. I tried fooling around with an esbuild plugin that onResolve sets the new path correctly, however unfortunately that didn't work. It seems that whatever is causing it to work with relative paths is being determined separately (or maybe before) from how esbuild resolves it. Any ideas on what other configuration I may need to change? |
The problem comes from the tool that looks for your sources dependencies (local files and node_modules). It does not resolve paths aliases. I'm working on it. I'll maybe add a |
Just stumbled across this and I love the setup, thanks! I've used the create-app for react/ts/vite. I've added a src/common folder for shared code between main and renderer, but I've found that making changes to code in src/common doesn't trigger a reload of the main process.
I took a look through esbuilder package and I believe it may be these lines here that are only using
src
property from the config to determine a directory to watch. If I've understood correctly, I think we'd need another property to specify one or more "common" directories to additionally watch for.The text was updated successfully, but these errors were encountered: