Skip to content

Commit

Permalink
docs: Update template-option documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Jan 2, 2020
1 parent 40b410e commit a195c34
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/template-option.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## History

The version 2.x which was introduced last year (Sep, 2015) changed the way the template is processed.
The version 2.x which was introduced 2015 changed the way the template is processed.
Instead of forcing all users to use the [blueimp](https://github.com/blueimp/JavaScript-Templates) template engine it allowed to use any webpack loader:

* [pug](https://github.com/pugjs/pug-loader)
Expand All @@ -19,7 +19,8 @@ There are three ways to set the loader:

## 1) Don't set any loader

By default (if you don't specify any loader in any way) a [fallback lodash loader](https://github.com/ampedandwired/html-webpack-plugin/blob/master/lib/loader.js) kicks in.
By default (if you don't specify any loader in any way) a [fallback ejs loader](https://github.com/jantimon/html-webpack-plugin/blob/master/lib/loader.js) kicks in.
Please note that this loader does not support the full ejs syntax as it is based of [lodash template](https://lodash.com/docs/#template).

```js
{
Expand All @@ -37,8 +38,8 @@ Be aware, using `.html` as your template extention may unexpectedly trigger anot

```js
new HtmlWebpackPlugin({
// For details on `!!` see https://webpack.github.io/docs/loaders.html#loader-order
template: '!!handlebars!src/index.hbs'
// For details on `!!` see https://webpack.js.org/concepts/loaders/#inline
template: '!!handlebars-loader!src/index.hbs'
})
```

Expand All @@ -63,7 +64,7 @@ new HtmlWebpackPlugin({
```

However this also means that in the following example webpack will use the [html loader for your template](https://webpack.js.org/loaders/html-loader/).
This will **cause html minification** and it will also **disable the ejs fallback** loader.
This will **cause html minification** and it will also **disable the ejs/lodash fallback** loader.

```js
{
Expand Down

0 comments on commit a195c34

Please sign in to comment.