From 81d7b2c0069efcc666ee52345d775f522532ce2a Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 4 Jan 2021 18:00:48 +0100 Subject: [PATCH] feat: add typings for options and version --- lib/child-compiler.js | 2 +- typings.d.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/child-compiler.js b/lib/child-compiler.js index 3fa49522..664e0068 100644 --- a/lib/child-compiler.js +++ b/lib/child-compiler.js @@ -178,7 +178,7 @@ class HtmlWebpackChildCompiler { // Therefore the array index of this.templates should be the as entryIndex. result[this.templates[entryIndex]] = { content: templateSource, - hash: childCompilation.hash, + hash: childCompilation.hash || 'XXXX', entry: entries[entryIndex] }; }); diff --git a/typings.d.ts b/typings.d.ts index 60e1145a..ff982069 100644 --- a/typings.d.ts +++ b/typings.d.ts @@ -7,6 +7,16 @@ export = HtmlWebpackPlugin; declare class HtmlWebpackPlugin { constructor(options?: HtmlWebpackPlugin.Options); + userOptions: HtmlWebpackPlugin.Options; + + /** Current HtmlWebpackPlugin Major */ + version: number; + + /** + * Options after html-webpack-plugin has been initialized with defaults + */ + options?: HtmlWebpackPlugin.ProcessedOptions; + apply(compiler: Compiler): void; static getHooks(compilation: Compilation): HtmlWebpackPlugin.Hooks;