Releases: webdiscus/html-bundler-webpack-plugin
Releases · webdiscus/html-bundler-webpack-plugin
v2.9.0
Cumulative Release v2.7.0
- v2.9.0
Features
- Added
experimental
support the Webpackcache.type
asfilesystem
. This is yet an alpha version.
You can try it, but if that doesn't work, just use the defaultcache.type
asmemory
. - Removes the
json5
dependency, take only the parser code from this package, remove unused code from it and optimize it for use with the plugin. - Added watching for changes (add/remove/rename) in handlebars helpers without restarting Webpack.
- Added
js.inline.chunk
andjs.inline.source
options to inline only js chunks matching regular expressions. - Changed the default value of the
hotUpdate
option tofalse
. This is not breaking change.
If you already have a js file, this setting should befalse
as Webpack automatically injects the hot update code into the compiled js file. Enable this option only if you don't have a referenced source file of a script in a html template.
Bug Fixes
- Fixed resolving output asset filenames without the needless index
.1
, likeindex.1.js
, when used the same base filename for template and js files. For example, if source files with the same base namesrc/index.html
andsrc/index.js
were used, thendist/index.html
anddist/index.1.js
were created, because the entry name used for compilation must be unique. This case is fixed. - If the html outputPath is a relative path, it is relative to
output.path
, not to CWD - Fixed resolving
asset
module by 2ndnpm start
whencache.type
is'filesystem'
.
Chore
- Updated the
eta
to the latestv3.1.0
version.
v2.6.1
v2.6.0
Features
- Added the
css.chunkFilename
option for output filename of non-initial chunk files, e.g., a style file imported in JavaScript. - Added the
hotUpdate
option to enable/disable live reload in serve/watch mode. For some use cases you can disable auto injecting thehot-update.js
into generating html files. For example, when you use a react-app generated withcreate-react-app
, then this option must be disabled to avoid a react error.
Bug Fixes
- Fixed missing output css file when the same style source file is imported in js and linked in html.
Chore
v2.5.1
v2.5.0
Cumulative Release v2.0.0
- v2.5.0
⚠ POTENTIAL BREAKING CHANGE (v2.0.0):
- Upgraded the default preprocessor
eta
to next major version3.0
.
Perhaps you may need to migrate your Eta templates tov3
syntax.
Features
- Added the reference for
data
in the plugin options.
The NEW syntactic "sugar":The old syntax is still valid:new HtmlBundlerPlugin({ entry: { index: './src/views/home.ejs', }, // new reference to the loaderOptions.data data: {...}, }),
new HtmlBundlerPlugin({ entry: { index: './src/views/home.ejs', }, loaderOptions: { // original option is under loaderOptions data: {...}, }, }),
- Added the references for
preprocessor
andpreprocessorOptions
in the plugin options.
The NEW syntactic "sugar":The old syntax is still valid:new HtmlBundlerPlugin({ entry: { index: './src/views/home.ejs', }, // new references to options in the loaderOptions preprocessor: 'ejs', preprocessorOptions: {...}, }),
new HtmlBundlerPlugin({ entry: { index: './src/views/home.ejs', }, loaderOptions: { // original options are under loaderOptions preprocessor: 'ejs', preprocessorOptions: {...}, }, }),
- Added support for Webpack CSS optimization
- Added support for
TS
- Added watching for create/rename/delete files in the entry path, without restarting Webpack
- Improved performance when used the same style file in many templates
- Added support for importing style files in JavaScript
Bug Fixes
- Resolving the same resources used in imported styles on different pages
- Correct importing styles in JS when used serve mode
- Importing the raw content of the html file in js
- Load the handlebars's partials with allowed extensions only, #24
- Correct order of styles when the same style is imported in many nested JS files
- Watching for create/rename/delete JS files
- Watching for create/rename Handlebars partials
- Add to watching only parent directories, ignore all subdirectories
- Generate correct output filenames for assets in deep nested pages after changes in serve mode
- Fixed in some cases is missing the hot-update.js file after changes in serve mode
- Added missing slash in output filename when publicPath is an url without finishing slash
v1.18.0
Cumulative Release v1.0.0
- v1.18.0
Features
- Added the
js.chunkFilename
option - Allow the
data
loader option as a filename for dynamically loading global template variables - Allow the
data
entry-point option as a filename for dynamically loading page template variables - New compact verbose output, all resources are grouped by their issuers
- Removed
js.verbose
option, because it makes no sense with new verbose output (no breaking change) - Removed
css.verbose
option, because it makes no sense with new verbose output (no breaking change) - Added the
views
option for thenunjucks
preprocessor - Allow to pass the configuration options for the
nunjucks
preprocessor - Automatically add to watching directories defined in the preprocessor options
root
views
partials
- Added
root
loader option to allow use the/
as root path to source directory for asset files - Added
preload
option to auto generate preload tags for resources such as font, image, video, audio, script, style, etc. - Allow resolving all duplicate scripts and styles in the template so that they can be preloaded with a link tag
- Removed warnings for duplicate script and styles in the template
- Added
preload
option to auto generate preload tags for resources such as font, image, video, audio, script, style, etc. - Allow resolving all duplicate scripts and styles in the template so that they can be preloaded with a link tag
- Removed warnings for duplicate script and styles in the template
- Added
minifyOptions
to customize minification when theminify
options isauto
, FR #5 - Added
helpers
value as array of a relative or absolute path to helper directories for thehandlebars
preprocessor - Added the entry option value as a relative or absolute path to pages
- Added the
data
loader option to pass global data into all templates - Added default template extensions:
.njk
- Added
preprocessor
value as stringnunjucks
to use the preconfigured Nunjucks compiler (nunjucks
package needs to be installed) - Added
preprocessorOptions
to the loader option to define a custom config for the default preprocessor - Added resolving a template partial relative to template
- Added default template extensions:
.hbs
and.handlebars
- Added
preprocessor
value as stringejs
to use the preconfigured EJS compiler (ejs
package needs to be installed) - Added
preprocessor
value as stringhandlebars
to use the preconfigured Handlebars compiler (handlebars
package needs to be installed) - Added
asset/source
support for SVG to inline it in HTML - Added hot update file to HTML in serv mode when there is no script in template, to reload page after changes
- Added
css.inline
option, replaces the functionality ofstyle-loader
- Added
js.inline
option to inline extracted JS into HTML - Added to the
?inline
query parameter for JS and CSS files the values:false
,true
,'auto'
- Added the
loaderOptions
to the plugin option to allow defining loader options with the plugin - Display watch files in watch/serv mode when verbose option is enabled
- Added
auto
value for theverbose
option - Added
watchFiles
option to configure paths and files to watch file changes - Set the config option
root
of the Eta preprocessor as current working dir by defaults - Added support for both
async
andsync
preprocessor, the preprocessor should return a string or a promise - Added resolving of
href
attribute in the SVG<image>
and<use>
tags, by defaults
Bug fixes
- Do not delete split chunks from compilation loading dynamically
- Allow to define the
as
property of the preload option in the attributes - Correct parsing of a query where the key does not contain a value, e.g.
?enable&size=100
- Live reload after changes if a template contains a commented out script
- Fixed issue if a CSS file is imported in SCSS with a filename, including the
.css
extension, e.g.@import 'npm-module/styles.css'
- Fixed issue if used the copy plugin which copies an HTML file
- Fixed pass data via query parameters into template imported in JS file
- Inject hot update js file after changes when the template has no scripts
- Display loader dependencies only once in the watch mode
- Correct inline CSS and JS when is used minify, #8
- Set the default
removeRedundantAttributes: false
minify option to prevent styling bug when input "type=text" is removed - Allow the
partials
values to be relative paths for thehandlebars
preprocessor - Display an original error stack by nested exceptions
- Handle unsupported value of the preprocessor option
- Fixed inline a style from the
link
tag with the attributeas="style"
- Keep output filename extension, different from
.html
, e.g.[name].php
, #4 - Fixed yarn when can't correctly install packages form standard npm peerDependencies.
- Added the enhanced-resolve to peerDependencies
- Correct rebuild the node modules specified in a template or imported in a script, after changes in the template of in the script
- Added missing node modules to compilation after rebuild
- Resolve resources in the entry file containing a query
- Correct inline JS when used split chunks
- Emit a loader exception as an instance of Error instead a string
- Throw exception when the loader is used but the
HtmlBundlerPlugin
is not initialized in Webpack plugins option - Correct loader export when template contain CRLF line separators
- Correct resolve
auto
value forverbose
option - After an error, restore watching without restarting
- Resolve correct output asset path when the publicPath is a URL
- Resolving of assets under Windows
- Handling an issue when used an async preprocessor
- Add only unique optional sources attribute
First Release
Features
- Handle HTML files from webpack entry
- Inline binary images, e.g. PNG
- Inline SVG images
- Added supports for the inline CSS in HTML
- Added supports for the inline JS in HTML
- Added support for
<input>
<audio>
<video>
<track>
tags - Added
test
plugin option to process entry files that pass test assertion - Added
entry
plugin option, this option is identical to Webpack entry plus additionaldata
property - Added
js
plugin option to extract JavaScript files from source scripts loaded in HTML via a<script>
tag and generates a separate file for it - Added
css
plugin option to extract CSS files from source styles loaded in HTML via a<link>
tag and generates a separate file for it - Added
preprocessor
loader option to allow pre-processing of content before handling - Added
postprocess
plugin option - Added
sources
loader option to define custom tags and attributes for resolving source files - Added
extractComments
plugin option to enable/disable saving comments in *.LICENSE.txt file - Added to default resolving the
data
attribute ofobject
tag - Added supports the
responsive-loader
- Added the default template loader in Webpack
module.rule
- Resolve the Webpack alias in the source file name
- Process the images, fonts from sources loaded via
<link>
,<img>
or<source>
tags and generates a separate file for it - Resolve and extracts images from sources loaded via
url()
in a style (css, scss) - Resolve auto
publicPath