Alternative to html-webpack-plugin ✅ Renders Eta, EJS, Handlebars, Nunjucks, Pug, Twig templates "out of the box" ✅ Resolves source files of scripts, styles, images in HTML ✅ Uses a template as entry point
ISC License
Bot releases are hidden (Show)
Published by webdiscus about 1 year ago
v2.0.0
- v2.5.0
eta
to next major version 3.0
.v3
syntax.data
in the plugin options.new HtmlBundlerPlugin({
entry: {
index: './src/views/home.ejs',
},
// new reference to the loaderOptions.data
data: {...},
}),
The old syntax is still valid:
new HtmlBundlerPlugin({
entry: {
index: './src/views/home.ejs',
},
loaderOptions: {
// original option is under loaderOptions
data: {...},
},
}),
preprocessor
and preprocessorOptions
in the plugin options.new HtmlBundlerPlugin({
entry: {
index: './src/views/home.ejs',
},
// new references to options in the loaderOptions
preprocessor: 'ejs',
preprocessorOptions: {...},
}),
The old syntax is still valid:
new HtmlBundlerPlugin({
entry: {
index: './src/views/home.ejs',
},
loaderOptions: {
// original options are under loaderOptions
preprocessor: 'ejs',
preprocessorOptions: {...},
},
}),
TS
Published by webdiscus about 1 year ago
v1.0.0
- v1.18.0
js.chunkFilename
optiondata
loader option as a filename for dynamically loading global template variablesdata
entry-point option as a filename for dynamically loading page template variablesjs.verbose
option, because it makes no sense with new verbose output (no breaking change)css.verbose
option, because it makes no sense with new verbose output (no breaking change)views
option for the nunjucks
preprocessornunjucks
preprocessorroot
views
partials
root
loader option to allow use the /
as root path to source directory for asset filespreload
option to auto generate preload tags for resources such as font, image, video, audio, script, style, etc.preload
option to auto generate preload tags for resources such as font, image, video, audio, script, style, etc.minifyOptions
to customize minification when the minify
options is auto
, FR #5helpers
value as array of a relative or absolute path to helper directories for the handlebars
preprocessordata
loader option to pass global data into all templates.njk
preprocessor
value as string nunjucks
to use the preconfigured Nunjucks compiler (nunjucks
package needs to be installed)preprocessorOptions
to the loader option to define a custom config for the default preprocessor.hbs
and .handlebars
preprocessor
value as string ejs
to use the preconfigured EJS compiler (ejs
package needs to be installed)preprocessor
value as string handlebars
to use the preconfigured Handlebars compiler (handlebars
package needs to be installed)asset/source
support for SVG to inline it in HTMLcss.inline
option, replaces the functionality of style-loader
js.inline
option to inline extracted JS into HTML?inline
query parameter for JS and CSS files the values: false
, true
, 'auto'
loaderOptions
to the plugin option to allow defining loader options with the pluginauto
value for the verbose
optionwatchFiles
option to configure paths and files to watch file changesroot
of the Eta preprocessor as current working dir by defaultsasync
and sync
preprocessor, the preprocessor should return a string or a promisehref
attribute in the SVG <image>
and <use>
tags, by defaultsas
property of the preload option in the attributes?enable&size=100
.css
extension, e.g. @import 'npm-module/styles.css'
removeRedundantAttributes: false
minify option to prevent styling bug when input "type=text" is removedpartials
values to be relative paths for the handlebars
preprocessorlink
tag with the attribute as="style"
.html
, e.g. [name].php
, #4HtmlBundlerPlugin
is not initialized in Webpack plugins optionauto
value for verbose
optionPublished by webdiscus about 1 year ago
<input>
<audio>
<video>
<track>
tagstest
plugin option to process entry files that pass test assertionentry
plugin option, this option is identical to Webpack entry plus additional data
propertyjs
plugin option to extract JavaScript files from source scripts loaded in HTML via a <script>
tag and generates a separate file for itcss
plugin option to extract CSS files from source styles loaded in HTML via a <link>
tag and generates a separate file for itpreprocessor
loader option to allow pre-processing of content before handlingpostprocess
plugin optionsources
loader option to define custom tags and attributes for resolving source filesextractComments
plugin option to enable/disable saving comments in *.LICENSE.txt filedata
attribute of object
tagresponsive-loader
module.rule
<link>
, <img>
or <source>
tags and generates a separate file for iturl()
in a style (css, scss)publicPath