Skip to content

Releases: webdiscus/html-bundler-webpack-plugin

v2.9.0

27 Aug 19:01
Compare
Choose a tag to compare

Cumulative Release v2.7.0 - v2.9.0

Features

  • Added experimental support the Webpack cache.type as filesystem. This is yet an alpha version.
    You can try it, but if that doesn't work, just use the default cache.type as memory.
  • 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 and js.inline.source options to inline only js chunks matching regular expressions.
  • Changed the default value of the hotUpdate option to false. This is not breaking change.
    If you already have a js file, this setting should be false 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, like index.1.js, when used the same base filename for template and js files. For example, if source files with the same base name src/index.html and src/index.js were used, then dist/index.html and dist/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 2nd npm start when cache.type is 'filesystem'.

Chore

  • Updated the eta to the latest v3.1.0 version.

v2.6.1

10 Aug 09:49
Compare
Choose a tag to compare

Bug Fixes

  • when the Webpack output.path option is undefined , set the default path as CWD + /dist

v2.6.0

09 Aug 12:10
Compare
Choose a tag to compare

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 the hot-update.js into generating html files. For example, when you use a react-app generated with create-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

  • Added the "hello world" example.
    Open in StackBlitz
  • Added the simple-site example with automatically processing many HTML templates.
    Open in StackBlitz
  • Added the Handlebars example.
    Open in StackBlitz

v2.5.1

04 Aug 13:17
Compare
Choose a tag to compare

Bug Fixes

  • Fixed missing output html file after renaming template file in watch mode when using entry as a path.

Chore

  • Added an example using of Bootstrap with Webpack.
    Open in StackBlitz

  • Added an example using of Tailwind CSS with Webpack.
    Open in StackBlitz

v2.5.0

30 Jul 17:52
Compare
Choose a tag to compare

Cumulative Release v2.0.0 - v2.5.0

⚠ POTENTIAL BREAKING CHANGE (v2.0.0):

  • Upgraded the default preprocessor eta to next major version 3.0.
    Perhaps you may need to migrate your Eta templates to v3 syntax.

Features

  • Added the reference for data in the plugin options.
    The NEW syntactic "sugar":
    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: {...},
      },
    }),
  • Added the references for preprocessor and preprocessorOptions in the plugin options.
    The NEW syntactic "sugar":
    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: {...},
      },
    }),
  • 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

30 Jul 17:40
Compare
Choose a tag to compare

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 the nunjucks 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 the minify options is auto, FR #5
  • Added helpers value as array of a relative or absolute path to helper directories for the handlebars 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 string nunjucks 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 string ejs to use the preconfigured EJS compiler (ejs package needs to be installed)
  • Added preprocessor value as string handlebars 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 of style-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 the verbose 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 and sync 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 the handlebars 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 attribute as="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 for verbose 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

30 Jul 17:16
Compare
Choose a tag to compare

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 additional data 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 of object 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