Skip to content

Commit 197ddd8

Browse files
committed
feat: add typings for options and version
1 parent f691f5b commit 197ddd8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/child-compiler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class HtmlWebpackChildCompiler {
178178
// Therefore the array index of this.templates should be the as entryIndex.
179179
result[this.templates[entryIndex]] = {
180180
content: templateSource,
181-
hash: childCompilation.hash,
181+
hash: childCompilation.hash || 'XXXX',
182182
entry: entries[entryIndex]
183183
};
184184
});

typings.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ export = HtmlWebpackPlugin;
77
declare class HtmlWebpackPlugin {
88
constructor(options?: HtmlWebpackPlugin.Options);
99

10+
userOptions: HtmlWebpackPlugin.Options;
11+
12+
/** Current HtmlWebpackPlugin Major */
13+
version: number;
14+
15+
/**
16+
* Options after html-webpack-plugin has been initialized with defaults
17+
*/
18+
options?: HtmlWebpackPlugin.ProcessedOptions;
19+
1020
apply(compiler: Compiler): void;
1121

1222
static getHooks(compilation: Compilation): HtmlWebpackPlugin.Hooks;

0 commit comments

Comments
 (0)