The plugin options after adding default values

Hierarchy

Properties

cache: boolean

Emit the file only if it was changed.

Default

true
chunks: string[] | "all"

List all entries which should be injected

chunksSortMode: "auto" | "manual" | ((entryNameA, entryNameB) => number)

Allows to control how chunks should be sorted before they are included to the html.

Type declaration

    • (entryNameA, entryNameB): number
    • Parameters

      • entryNameA: string
      • entryNameB: string

      Returns number

Default

'auto'
excludeChunks: string[]

List all entries which should not be injected

favicon: string | false

Path to the favicon icon

filename: string
hash: boolean

If true then append a unique webpack compilation hash to all included scripts and CSS files. This is useful for cache busting

inject: boolean | "head" | "body"

Inject all assets into the given template or templateContent.

meta: false | {
    [name: string]: string | false | {
        [attributeName: string]: string | boolean;
    };
}

Inject meta tags

Type declaration

  • [name: string]: string | false | {
        [attributeName: string]: string | boolean;
    }
minify: boolean | Options | "auto"

HTML Minification options accepts the following values:

publicPath: string

By default the public path is set to auto - that way the html-webpack-plugin will try to set the publicPath according to the current filename and the webpack publicPath setting

scriptLoading: "module" | "blocking" | "defer"

Set up script loading blocking will result in defer will result in

Default

'defer'
showErrors: boolean

Render errors into the HTML page

template: string

The webpack require path to the template.

templateContent: string | false | ((templateParameters) => string | Promise<string>) | Promise<string>

Allow to use a html string instead of reading from a file

Type declaration

    • (templateParameters): string | Promise<string>
    • Parameters

      • templateParameters: {
            [option: string]: any;
        }
        • [option: string]: any

      Returns string | Promise<string>

templateParameters: false | ((compilation, assets, assetTags, options) => {
    [option: string]: any;
} | Promise<{
    [option: string]: any;
}>) | {
    [option: string]: any;
}

Allows to overwrite the parameters used in the template

Type declaration

    • (compilation, assets, assetTags, options): {
          [option: string]: any;
      } | Promise<{
          [option: string]: any;
      }>
    • Parameters

      • compilation: any
      • assets: {
            css: string[];
            favicon?: string;
            js: string[];
            manifest?: string;
            publicPath: string;
        }
        • css: string[]
        • Optional favicon?: string
        • js: string[]
        • Optional manifest?: string
        • publicPath: string
      • assetTags: {
            bodyTags: HtmlTagObject[];
            headTags: HtmlTagObject[];
        }
      • options: ProcessedOptions

      Returns {
          [option: string]: any;
      } | Promise<{
          [option: string]: any;
      }>

Type declaration

  • [option: string]: any
title: string

The title to use for the generated HTML document

xhtml: boolean

Enforce self closing tags e.g.

Generated using TypeDoc