-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Finally Webpack 5 has been released! 👍
During the beta I tried to provide a html-webpack-plugin version which is compatible to webpack 4 and webpack 5.
As there have been some API and typing changes in webpack 5 this approach is limited.
To provide the best possible webpack 5 support I have started on a dedicated webpack 5 version of the html-webpack-plugin.
current progress:
-
drop webpack 4 support
-
drop node < 10 like webpack
-
make use of Compiler.hook.initialize to get the latest options
-
update typings for webpack 5
-
fix scriptLoading defer for inject false
-
make scriptLoading defer the default
-
add assets in Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL (see Guidance on porting a plugin to webpack v5? webpack/webpack#11425 (comment) )
-
add assets with new api
compilation.emitAsset
(Strange asset name when used with webpack v5.0.0-rc.3 #1522) -
use
new webpack.sources.RawSource(html)
to create assets -
add support for
[name]
-
provide options and output name in all hooks
-
allow filename to be a function
-
emitAssets even if they have been generated in a previous compilation (to fix index.html disappear with watch mode (HtmlWebpackPlugin) #1476 and html was not generated in watch mode, after changing one of the files #1432)
-
verify support for raw-loader (blocked by Webpack 5 - child compiler ignores library target / name options webpack/webpack#11909)
-
remove
@types/tapable
as it is included in tapable 2 -
provide a publicPath to the child compiler to add support for
publicPath: 'auto'
&'asset/resource'
(assets modules won't work for inline html <img> webpack/webpack#11968 (comment)) -
use the correct stage to allow sri and service worker generation (blocked by Extend Webpack Compilation Stages webpack/webpack#11822)
-
fix error reporting (which is currently breaking the travis build)
-
use the html-webpack-plugin
publicPath
option also for the template child compilation -
remove html-minification (if a separate plugin which covers the html minification is available)(postponed)
current blockers (help needed by the webpack team):
- webpack/issues/11822
- webpack/issues/11909
- Missing queryString for inline entries like data:text/javascript,console.log("demo") webpack/webpack#12214
current alpha playround:
CodeSandbox of the html-webpack-plugin 5.0.0-alpha.17
Most of the work is done just by me in my spare time for fun - so if this work helps you feel free to buy me a beer 🍺