}`|`true`|Errors details will be written into the HTML page| |**`chunks`**|`{?}`|`?`|Allows you to add only some chunks (e.g only the unit-test chunk)| |**`chunksSortMode`**|`{String\|Function}`|`auto`|Allows to control how chunks should be sorted before they are included to the HTML. Allowed values are `'none' \| 'auto' \| 'manual' \| {Function}`| |**`excludeChunks`**|`{Array.}`|``|Allows you to skip some chunks (e.g don't add the unit-test chunk)| |**`xhtml`**|`{Boolean}`|`false`|If `true` render the `link` tags as self-closing (XHTML compliant)| Here's an example webpack config illustrating how to use these options **webpack.config.js** ```js { entry: 'index.js', output: { path: __dirname + '/dist', filename: 'index_bundle.js' }, plugins: [ new HtmlWebpackPlugin({ title: 'My App', filename: 'assets/admin.html' }) ] } ``` ### Generating Multiple HTML Files To generate more than one HTML file, declare the plugin more than once in your plugins array **webpack.config.js** ```js { entry: 'index.js', output: { path: __dirname + '/dist', filename: 'index_bundle.js' }, plugins: [ new HtmlWebpackPlugin(), // Generates default index.html new HtmlWebpackPlugin({ // Also generate a test.html filename: 'test.html', template: 'src/assets/test.html' }) ] } ``` ### Writing Your Own Templates If the default generated HTML doesn't meet your needs you can supply your own template. The easiest way is to use the `template` option and pass a custom HTML file. The html-webpack-plugin will automatically inject all necessary CSS, JS, manifest and favicon files into the markup. Details of other template loaders are [documented here](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md). ```js plugins: [ new HtmlWebpackPlugin({ title: 'Custom template', // Load a custom template (lodash by default) template: 'index.html' }) ] ``` **index.html** ```html <%= htmlWebpackPlugin.options.title %>