webdiscus / pug-plugin

Renders Pug template to HTML or template function. Resolves source files of scripts, styles, images in Pug . Uses Pug template as entry point.
https://webdiscus.github.io/pug-plugin/hello-world
ISC License
74 stars 8 forks source link

Fixed resolver using outdated asset names after live reloading #42

Closed glektarssza closed 2 years ago

glektarssza commented 2 years ago

When using hot reloading/live reloading (or even just recompiling while using the Webpack dev server), the Resolver was holding on to the old asset names. This would cause the page to fail to reload properly if the asset name had changed, for example when the asset name uses [contenthash].

Alternatively, this could be fixed by changing the logic in resolveAsset, specifically around when an item is retrieved from the issuer.

webdiscus commented 2 years ago

Hi,

thanks for bug report. Yes, I can reproduce the issue if a style file is changed. Before merge PR I must very thoroughly test many complex cases, because this is very sensible code place.

webdiscus commented 2 years ago

Thank you!

This fix is ready for next release.

webdiscus commented 2 years ago

@glektarssza new version v4.3.0 is released in NPM

glektarssza commented 2 years ago

@glektarssza new version v4.3.0 is released in NPM

Awesome! I'll give it a look!

glektarssza commented 2 years ago

Looks good in NPM! Thank you!