<commit_before>[swig](https://github.com/paularmstrong/swig)-[webpack](https://github.com/webpack/webpack)-plugin
===================

> **Note:** forked from [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin).

This is a [webpack](http://webpack.github.io/) plugin that simplifies creation of HTML files to serve your
webpack bundles. This is especially useful for webpack bundles that include
a hash in the filename which changes every compilation. You can either let the plugin generate an HTML file for you or supply
your own template (using [swig](https://github.com/paularmstrong/swig)).

Installation
------------
Install the plugin with npm:
```shell
$ npm install swig-webpack-plugin --save-dev
```


Basic Usage
-----------

The plugin will generate an HTML file for you that includes all your webpack
bundles in the body using `script` tags. Just add the plugin to your webpack
config as follows:

```javascript
var SwigWebpackPlugin = require('swig-webpack-plugin')
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: '[name].js'
  },
  plugins: [new SwigWebpackPlugin()]
}
```

This will generate a file `index.html` from the default template.


If you have multiple webpack entry points, they will all be included with `script`
tags in the generated HTML.


Configuration
-------------
You can pass a hash of configuration options to `HtmlWebpackPlugin`.
Allowed values are as follows:

- `beautify`: Beautify the HTML.
- `uglify`: Uglify the HTML.
- `filename`: The file to write the HTML to. Defaults to `index.html`.
   You can specify a subdirectory here too (eg: `src/admin.html`).

Here's an example webpack config illustrating how to use these options:
```javascript
{
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'bundle.js'
  },
  plugins: [
    new SwigWebpackPlugin({
      filename 'src/*.html',
      watch: 'src/**/*',
      beautify: true
    })
  ]
}
```

Generating Multiple HTML Files
------------------------------
To generate more than one HTML file, declare the plugin more than
once in your plugins array:
```javascript
{<commit_msg>fixed typo<commit_after>[swig](https://github.com/paularmstrong/swig)-[webpack](https://github.com/webpack/webpack)-plugin
===================

> **Note:** forked from [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin).

This is a [webpack](http://webpack.github.io/) plugin that simplifies creation of HTML files to serve your
webpack bundles. This is especially useful for webpack bundles that include
a hash in the filename which changes every compilation. You can either let the plugin generate an HTML file for you or supply
your own template (using [swig](https://github.com/paularmstrong/swig)).

Installation
------------
Install the plugin with npm:
```shell
$ npm install swig-webpack-plugin --save-dev
```


Basic Usage
-----------

The plugin will generate an HTML file for you that includes all your webpack
bundles in the body using `script` tags. Just add the plugin to your webpack
config as follows:

```javascript
var SwigWebpackPlugin = require('swig-webpack-plugin')
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: '[name].js'
  },
  plugins: [new SwigWebpackPlugin()]
}
```

This will generate a file `index.html` from the default template.


If you have multiple webpack entry points, they will all be included with `script`
tags in the generated HTML.


Configuration
-------------
You can pass a hash of configuration options to `HtmlWebpackPlugin`.
Allowed values are as follows:

- `beautify`: Beautify the HTML.
- `uglify`: Uglify the HTML.
- `filename`: The file to write the HTML to. Defaults to `index.html`.
   You can specify a subdirectory here too (eg: `src/admin.html`).

Here's an example webpack config illustrating how to use these options:
```javascript
{
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'bundle.js'
  },
  plugins: [
    new SwigWebpackPlugin({
      filename: 'src/*.html',
      watch: 'src/**/*',
      beautify: true
    })
  ]
}
```

Generating Multiple HTML Files
------------------------------
To generate more than one HTML file, declare the plugin more than
once in your plugins array:
```javascript
{
{'fraction_non_alphanumeric': 0.1436219739292365, 'fraction_numerical': 0.0, 'mean_word_length': 3.4947698744769875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '999873', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1205, 'n_words': 483}