-
Notifications
You must be signed in to change notification settings - Fork 55
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
Watching __dirname
and not what I set path
to
#61
Comments
I don't know what you mean by "it doesn't seem to work". It would be best to provide a generic "how to reproduce" instruction instead of pointing to an external project. Nonetheless, I suppose that you have problems with hard resets and don't require https://github.com/yan-foto/electron-reload/blob/master/main.js#L12 But this is just a wild guess, it might be something else. It might the case that you transpile your JSX to JS in some other folder and watch the sources instead of the transpiled files. I cannot debug your project. |
That is exactly what's going on
Thank you so much for taking the time ... I will continue to debug and update you on what I find! |
Yes please let me know 🙏 . In the last release we made the assumption that the main file requires |
You should ... I believe that would fix my problem here! |
Easier said than done! There was a reason why we did it (see #58 ) and I'd need a good reason to make new changes. Why don't you require |
Now you just need to find out what goes wrong! |
I think what is going wrong is that When I put the code in |
Do me a favor, change the source code of
|
You are talking about two different things: hard and soft resets. Soft resets happen when files are changed in the directory that you passed to |
Done ... but nothing prints:
The way you described it, I want to reload all FYI, |
Does the structure of transpiled files reflect the structure of your current source (i.e. before and after babel) |
Where would I look for this exactly? |
FYI, when I add the code to But it doesn't print anything for |
I am really sorry, but I think this ping-pong debugging is not going to help us. You are using a number of tools (babel, yarn, etc.) which transform your sources and probably restructure your project after building it. I suggest that you take a step back and try to figure out what is happening in the background. For soft resets the path that you pass to |
Thanks for all the help @yan-foto! I think I've made some progress! When I put require('electron-reload')(path.join(__dirname, '..', 'src'), {
electron: path.join(__dirname, '..', 'node_modules', '.bin', 'electron')
}) into Is that a little bit more meaningful? Is that a better lead? |
Yes! I know what happens! We should've known it earlier. When you start with |
Please leave this open. I'll use it as a cue for implementing the events. |
I know this is kind of late, and maybe it should be its' own feature request, but have you really thought through the usefulness of that feature? Shouldn't the process be watching for changes in the main file, but also any dependencies of the main file? If I import a module in to my main file, I would likely want my electron app restarted then as well. That's the scenario I find myself in. Just a thought. |
@dough654 that makes perfect sense. Could you please open a new issue for discussions? |
This release fixes the following issues: fixes: yan-foto#65 fixes: yan-foto#61
This release fixes: fixes: yan-foto#65 & fixes: yan-foto#61
Also reversed args for hard reset handler - allows file-argument to be passed to electron in the correct order - usecase: opening file in electron app from cli fixes: yan-foto#65 & fixes: yan-foto#61
This version fixes the following issues: fixes: yan-foto#65 & fixes: yan-foto#61
This suppresses ts errors about the declaration file. This release fixes: fixes: yan-foto#65 & fixes: yan-foto#61
fixes: yan-foto#65 & fixes: yan-foto#61
fixes: yan-foto#65 & fixes: yan-foto#61
fixes: yan-foto#65 & fixes: yan-foto#61
What is the problem
When I set the path to watch as a different path other than
__dirname
, it doesn't seem to work ... what I mean is that it seems to watch changes only in__dirname
, and not the path that I specifiedHow to reproduce
yarn
yarn add -D electron-reload
main/index.js
:yarn start
src/index.js
to:<- Back
and not as<- Testing
! For example:Additional information
OS: macOS 10.14.4 (18E226) ... Mojave
node: 10.15.2
yarn: 1.15.2
electron: 5.0.7
The text was updated successfully, but these errors were encountered: