Additional Assets emitted via processAssets
hook do not invalidate the build
#5173
Labels
processAssets
hook do not invalidate the build
#5173
Bug report
I have a custom plugin that emits CSS modules
compilation.hooks.processAssets
, and these are derived from source code processed by Webpack. The loader returns a JS object containing the classnames used. If I add new CSS rules, these classnames do not change, but the emitted CSS does change.If additional assets assets change during an incremental compile, Webpack Dev Sever sends a
still-ok
message to the client, and nothing reloads. I believe this is because additional assets are not included in the compilation hash, so it remains the sameCan we make webpack dev server take into account additional assets as well?
Actual Behavior
Change a source file that affects the output of additional assets. See that webpack dev server reports nothing has changed
Expected Behavior
Webpack dev server should see that additional assets have changed, and reload the page
How Do We Reproduce?
Create a plugin that emits additional assets based on input modules. Change one of the input modules. See that webpack dev server does not refresh the page
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationwebpack dev server 5.0.4
webpack 5.91.0
Is there another way I should be emitting assets like this? I've resorted to adding a hash in comments of the returned JS file
The text was updated successfully, but these errors were encountered: