Closed webdiscus closed 8 months ago
Seems to be good.
Going back to our last conversation about preload, do you think it might still be worth thinking about how scripts/styles could be captured through these settings? I thought about it to make the code more uniform. It looks strange when we specify preload for styles or scripts manually, and the plugin handles all our other assets
@ladown
The plugin does not capture scripts/styles, because they already must be manually specified in a template and not anywhere. This is the goal this plugin: manually specify source scripts/styles directly in a template. This plugin don't inject the link/script tags.
P.S. You are probably confusing with another html-webpack-plugin that catches styles/scripts defined in Webpack config and then inserts them into HTML.
Preloading of scripts and styles will also be implemented too.
@ladown
the new pug plugin v5.0.0
is based on the html-bundler-webpack-plugin and has all features, including the preload
Here is the modified FR #60.
Automatically preload assets resolved in HTML or in CSS:
For example, there is the style used a font:
style.css
The generated HTML:
The auto generated preload
link
tag should be injected before a firststyle
orscript
tag inhead
.The option name should be
preload
: