-
Notifications
You must be signed in to change notification settings - Fork 47
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
Webpack: Resolve assets watch
not recompiling
#166
base: master
Are you sure you want to change the base?
Conversation
97184ba
to
d51eea7
Compare
assets watch
not recompiling
d51eea7
to
badad5a
Compare
Thank you! Works like a charm locally (though it will take some time (42s in my case)) |
Good to hear @rekt-hard, In my experience, the process was somewhat slow, taking up to ~15 - 20 seconds, but not excessively so. |
@jrcastro2 you also experienced this issue. How did you solve it? |
I remember experiencing this but I don't remember fixing it ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you comment in the isuse ("While debugging, I found that CleanWebpackPlugin plugin, becomes redundant after upgrading to webpack V5"), have you tried to use the ouptut.clean
?
I think that the CleanWebpackPlugin
might not be working anymore.
@@ -252,6 +253,7 @@ var webpackConfig = { | |||
watchOptions: { | |||
followSymlinks: true, | |||
}, | |||
cache: process.env.NODE_ENV === "production", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major: Based on the docs this is by default false in production
, I guess we should keep the same behaviour, unless I am missing something.
cache: process.env.NODE_ENV === "production", | |
cache: false, |
Here the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood @jrcastro2 , but the caching seems to default to true after first compile despite what the docs say (it's why we have the issue in the first place). but If setting it explicitly to false is preferred, I'm on board with that change.
badad5a
to
c873d95
Compare
c873d95
to
44113ab
Compare
I inquired because, despite seeing no differences when I replaced the plugin with the |
Did you test the |
After conducting a test by eliminating the plugin and setting cache: {
type: 'memory',
}, However, this did not resolve the recompiling issue either. |
Hmm, can you explain what issues do you still have after using the |
A video might explain it better than words, so I'll share a screen recording with you, notice that only the first change is been picked up @jrcastro2 |
23a3b39
to
59a85dc
Compare
@jrcastro2, in a separate commit after looking once again into it, I've removed several potentially outdated configs related to years-old issues (see gh links e.g. comparisons: false, or ascii_only: true from 2017 ) or webpack-livereload-plugin that last activity was more than 2 years ago. I know digging into these configs may not be pleasant while they don't affect caching directly. However, while we're on it, I need you to review and advise if we should eliminate more legacy options or reinstate any so I don't unintentionally impact the application due to unknown historical context or dependencies. |
Ah okay, thanks for sharing this, looks like it's only affecting the updates on the instance folder, I think this is a "known issue" - if I am not mistaken. Thanks a lot for all the updates! I will have a look as soon as I am back (I am on holidays until April 3th). And sorry for being so picky with the cache thing but I would like to avoid it if possible, to not slow it down, however I haven't found yet an alternative to it ... I will have a look as soon as I am back. |
I totally agree @jrcastro2 I, too, would favor an alternative solution than disabling the cache that allows for quicker recompiling. However, this is currently the only solution I've managed to make it work for development so far. |
59a85dc
to
749ae46
Compare
After spending a bit of time exploring the options around the cache and trying to understand the issue better I couldn't find a better solution for the moment. It looks like the changes of js files are correclty picked up and only the changes on the less files ( Disabling the cache fixes the issue but it would slow down the development in general (there are some changes on js files that thake 1 second, while if we disable the cache any change will take +15 seconds, depending on how powerfull your local machine is). Ideally, I would like understand how the cache is working in webpack and figure out why the bundle looks like is being incorrectly cached, but due to time constraints I cannot do this right now ... However, this is something we will have to address in the near future so it will happen, just on hold for now. Regarding the other changes they look okay to me, I just would like to test the changes on the Please, keep this PR open and we will resume the work from here as soon as possible, thank you for your contribution, it's very much appreciated! |
❤️ Thank you for your contribution!
Description
This PR:
Question
While debugging, I found that
CleanWebpackPlugin
plugin, becomes redundant after upgrading to webpack V5invenio-assets/invenio_assets/assets/build/webpack.config.js
Lines 210 to 216 in f562914
by adding
clean: true
tooutput
, see cleaning-up-the-dist-folderDid I overlooked another purpose for the CleanWebpackPlugin? 🤔
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Third-party code
If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: