You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, there is the HTML template _./src/views/index.html_:
46
+
For example, using source asset files is HTML template _./src/views/index.html_:
47
47
48
48
```html
49
49
<html>
@@ -84,7 +84,8 @@ src/
84
84
│ └── style.scss
85
85
└── assets/
86
86
└── images/
87
-
└── picture.png
87
+
└── picture1.png
88
+
└── picture2.png
88
89
```
89
90
-->
90
91
@@ -120,7 +121,7 @@ You can use a relative path or Webpack alias to a source file.
120
121
-**Inlines**[JS](#recipe-inline-js) and [CSS](#recipe-inline-css) into HTML.
121
122
-**Inlines**[images](#recipe-inline-image) into HTML and CSS.
122
123
- Supports **styles** used in `*.vue` files.
123
-
-**Renders** the [template engines](#template-engine) such as [Eta](#using-template-eta), [EJS](#using-template-ejs), [Handlebars](#using-template-handlebars), [Nunjucks](#using-template-nunjucks), [TwigJS](#using-template-twig), [LiquidJS](#using-template-liquidjs).
124
+
-**Renders** the [template engines](#template-engine) such as [Eta](#using-template-eta), [EJS](#using-template-ejs), [Handlebars](#using-template-handlebars), [Nunjucks](#using-template-nunjucks), [Pug](#using-template-pug), [TwigJS](#using-template-twig), [LiquidJS](#using-template-liquidjs).
124
125
-**Compile** a template into [template function](#template-in-js) for usage in JS on the client-side.
125
126
- Generates the [preload](#option-preload) tags for fonts, images, video, scripts, styles, etc.
126
127
- Generates the [integrity](#option-integrity) attribute in the `link` and `script` tags.
@@ -211,6 +212,7 @@ If you have discovered a bug or have a feature suggestion, feel free to create a
211
212
## 🔆 What's New in v3
212
213
213
214
-**NEW** added support for the [template function](#template-in-js) in JS runtime on the client-side.
-[custom](#loader-option-preprocessor-custom) (using any template engine)
462
465
-[data](#loader-option-data) (pass data into templates)
463
466
1.[Using template engines](#template-engine)
464
467
-[Eta](#using-template-eta)
465
468
-[EJS](#using-template-ejs)
466
469
-[Handlebars](#using-template-handlebars)
470
+
-[LiquidJS](#using-template-liquidjs)
467
471
-[Mustache](#using-template-mustache)
468
472
-[Nunjucks](#using-template-nunjucks)
473
+
-[Pug](#using-template-pug)
469
474
-[TwigJS](#using-template-twig)
470
-
-[LiquidJS](#using-template-liquidjs)
471
-
-[Pug](https://github.com/webdiscus/pug-plugin)
472
475
1.[Using template in JavaScript](#template-in-js)
473
476
1.[Setup Live Reload](#setup-live-reload)
474
477
1.[Recipes](#recipes)
@@ -528,7 +531,7 @@ See [boilerplate](https://github.com/webdiscus/webpack-html-scss-boilerplate)
528
531
- auto generation of `<link rel="preload">` to [preload assets](#option-preload)
529
532
- supports the `auto`[publicPath](#webpack-option-output-publicpath)
530
533
- enable/disable [extraction of comments](#option-extract-comments) to `*.LICENSE.txt` file
531
-
- supports template engines such as [Eta](https://eta.js.org), [EJS](https://ejs.co), [Handlebars](https://handlebarsjs.com), [Nunjucks](https://mozilla.github.io/nunjucks/), [TwigJS](https://github.com/twigjs/twig.js), [LiquidJS](https://github.com/harttle/liquidjs) and others
534
+
- supports template engines such as [Eta](https://eta.js.org), [EJS](https://ejs.co), [Handlebars](https://handlebarsjs.com), [Nunjucks](https://mozilla.github.io/nunjucks/), [Pug](https://pugjs.org/), [TwigJS](https://github.com/twigjs/twig.js), [LiquidJS](https://github.com/harttle/liquidjs) and others
532
535
- supports a [template function](#template-in-js) for usage in JS on the client-side
533
536
- supports both `async` and `sync`[preprocessor](#loader-option-preprocessor-custom)
534
537
- auto processing multiple HTML templates using the [entry path](#option-entry-path)
@@ -2974,6 +2977,7 @@ type Preprocessor =
2974
2977
|'ejs'
2975
2978
|'handlebars'
2976
2979
|'nunjucks'
2980
+
|'pug'
2977
2981
|'twig'
2978
2982
| ((
2979
2983
content: string,
@@ -2989,11 +2993,11 @@ or define your own preprocessor as a function to use any template engine.
2989
2993
#### Supported templating engines "out of the box"
2990
2994
2991
2995
```ts
2992
-
type Preprocessor ='eta'|'ejs'|'handlebars'|'nunjucks'|'twig';
2996
+
type Preprocessor ='eta'|'ejs'|'handlebars'|'nunjucks'|'pug'|'twig';
2993
2997
```
2994
2998
2995
2999
The preprocessor is ready to use the most popular templating engines:
0 commit comments