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
@@ -180,6 +167,10 @@ If you have discovered a bug or have a feature suggestion, feel free to create a
180
167
-[Use a HTML file as an entry point?](https://github.com/webpack/webpack/issues/536) (Webpack issue, #536)
181
168
-[Comparison and Benchmarks of Node.js libraries to colorize text in terminal](https://dev.to/webdiscus/comparison-of-nodejs-libraries-to-colorize-text-in-terminal-4j3a) (_offtopic_)
182
169
170
+
## 🔆 What's New in v4
171
+
172
+
-**NEW** added supports the [multiple configurations](https://webpack.js.org/configuration/configuration-types/#exporting-multiple-configurations)
173
+
183
174
## 🔆 What's New in v3
184
175
185
176
-**NEW** added supports the [template function](#template-in-js) in JS runtime on the client-side.
@@ -206,20 +197,6 @@ For full release notes see the [changelog](https://github.com/webdiscus/html-bun
206
197
The current version works stable with `cache.type` as `'memory'` (Webpack's default setting).\
207
198
Support for the `'filesystem'` cache type is experimental.
208
199
209
-
### Multiple config files
210
-
211
-
The multiple config files are not supported, because in some special use cases the Webpack API works not properly (all previous configurations are overridden by the latest configuration).
212
-
213
-
Instead of this:
214
-
```
215
-
npx webpack -c app1.config.js app2.config.js
216
-
```
217
-
you can use following:
218
-
```
219
-
npx webpack -c app1.config.js
220
-
npx webpack -c app2.config.js
221
-
```
222
-
223
200
---
224
201
225
202
<aid="install"name="install"></a>
@@ -267,7 +244,7 @@ For example, there is the template _./src/views/home.html_:
267
244
```
268
245
269
246
All source filenames should be relative to the entrypoint template, or you can use [Webpack alias](https://webpack.js.org/configuration/resolve/#resolvealias).
270
-
The references are rewritten in the generated HTML so that they link to the correct output files.
247
+
The references are rewritten in the generated HTML so that they point to the correct output files.
271
248
272
249
The generated HTML contains URLs of the output filenames:
273
250
@@ -2563,7 +2540,7 @@ or an array to specify multiple hash functions for compatibility with many brows
2563
2540
> - The [`output.crossOriginLoading`](https://webpack.js.org/configuration/output/#outputcrossoriginloading) Webpack option must be specified as `'use-credentials'` or `'anonymous'`.
2564
2541
> The bundler plugin adds the `crossorigin` attribute with the value defined in the `crossOriginLoading`.
2565
2542
> The `crossorigin` attribute tells the browser to request the script with CORS enabled, which is necessary because the integrity check fails without CORS.
2566
-
> - The [`optimization.realContentHash`](https://webpack.js.org/configuration/optimization/#optimizationrealcontenthash) Webpack option must be enabled, is enabled by default in production mode only.
2543
+
> - The [`optimization.realContentHash`](https://webpack.js.org/configuration/optimization/#optimizationrealcontenthash) Webpack option must be enabled, by default is enabled in production mode only.
2567
2544
>
2568
2545
> This requirement is necessary to avoid the case where the browser tries to load a contents of a file from the local cache since the filename has not changed, but the `integrity` value has changed on the server.
2569
2546
> In this case, the browser will not load the file because the `integrity` of the cached file computed by the browser will not match the `integrity` attribute computed on the server.
@@ -2651,8 +2628,8 @@ Type:
2651
2628
```ts
2652
2629
type WatchFiles = {
2653
2630
paths?:Array<string>;
2654
-
files?:Array<RegExp>;
2655
-
ignore?:Array<RegExp>;
2631
+
includes?:Array<RegExp>;
2632
+
excludes?:Array<RegExp>;
2656
2633
};
2657
2634
```
2658
2635
@@ -2661,13 +2638,13 @@ Default:
2661
2638
```js
2662
2639
watchFiles: {
2663
2640
paths: ['./src'],
2664
-
files: [/\.(html|ejs|eta)$/],
2665
-
ignore: [
2641
+
includes: [/\.(html|ejs|eta)$/],
2642
+
excludes: [
2666
2643
/[\\/](node_modules|dist|test)$/, // ignore standard project dirs
2667
2644
/[\\/]\..+$/, // ignore hidden dirs and files, e.g.: .git, .idea, .gitignore, etc.
@@ -2681,14 +2658,16 @@ Allows to configure paths and files to watch file changes for rebuild in `watch`
2681
2658
2682
2659
#### Properties:
2683
2660
2684
-
- `paths` - A list of relative or absolute paths to directories where should be watched `files`.\
2661
+
- `paths` - A list of relative or absolute paths to directories where should be watched `includes`.\
2685
2662
The watching path for each template defined in the entry will be autodetect as the first level subdirectory of the template relative to the project's root path.
2686
2663
E.g., the template `./src/views/index.html` has the watching path of `./src`.
2687
2664
2688
-
- `files` - Watch the files specified in `paths`, except `ignore`, that match the regular expressions.
2665
+
- `includes` - Watch the files specified in `paths`, except `excludes`, that match the regular expressions.
2689
2666
Defaults, are watched only files that match the [`test`](#option-test) plugin option.
2690
2667
2691
-
- `ignore` - Ignore the specified paths or files, that match the regular expressions.
2668
+
- `excludes` - Exclude the specified paths or files, that match the regular expressions.
2669
+
2670
+
This options does not override the default values, but extends them.
2692
2671
2693
2672
For example, all source files are in the `./src` directory,
2694
2673
while some partials included in a template are in `./vendor/` directory, then add it to the `paths`:
@@ -2700,19 +2679,19 @@ watchFiles: {
2700
2679
```
2701
2680
2702
2681
If you want watch changes in some special files used in your template that are only loaded through the template engine,
2703
-
add them to the `files` property:
2682
+
add them to the `includes` property:
2704
2683
2705
2684
```js
2706
2685
watchFiles: {
2707
2686
paths: ['vendor'],
2708
-
files: [
2687
+
includes: [
2709
2688
/data\.(js|json)$/,
2710
2689
],
2711
2690
},
2712
2691
```
2713
2692
2714
-
To exclude watching of files defined in `paths` and `files`, you can use the `ignore` property.
2715
-
This option has the prio over paths and files.
2693
+
To exclude watching of files defined in `paths` and `includes`, you can use the `excludes` option.
2694
+
This option has the priority over paths and files.
0 commit comments