JoviDeCroock / webpack-module-nomodule-plugin

Easily implement a module nomodule index.html
82 stars 6 forks source link

Add support for Webpack 5 #29

Closed thecontrarycat closed 3 years ago

thecontrarycat commented 3 years ago

Webpack 5 uses a technique called realContentHash that changes a file's hash after it has been processed by our plugin. To fix this we can emit the temporary json file as an asset so that it gets updated with the new hashes.

See #25 for more information.

thecontrarycat commented 3 years ago

Just a heads up, I've been using this in anger this week and found a few issues.

  1. This only works for webpack 5 and HtmlWebpackPlugin 5
  2. There are still race conditions present (in my case it isn't working when CompressionWebpackPlugin is present in a development build).

I'm working on a better approach that doesn't rely upon writing out files or emitting assets.