diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 9c9239e5ea..2277ec2867 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -134,7 +134,7 @@ declare namespace webpack { } interface Output { - /** The output directory as absolute path (required). */ + /** The output directory as absolute path. */ path?: string; /** The filename of the entry chunk as relative path inside the output.path directory. */ filename?: string; @@ -190,8 +190,14 @@ declare namespace webpack { sourcePrefix?: string; /** This option enables cross-origin loading of chunks. */ crossOriginLoading?: string | boolean; + /** The encoding to use when generating the hash, defaults to 'hex' */ + hashDigest?: 'hex' | 'latin1' | 'base64'; + /** The prefix length of the hash digest to use, defaults to 20. */ + hashDigestLength?: number; /** Algorithm used for generation the hash (see node.js crypto package) */ hashFunction?: string | ((algorithm: string, options?: any) => any); + /** An optional salt to update the hash via Node.JS' hash.update. */ + hashSalt?: string; /** An expression which is used to address the global object/scope in runtime code. */ globalObject?: string; } diff --git a/types/webpack/v3/index.d.ts b/types/webpack/v3/index.d.ts index d6102808b6..7f943d4151 100644 --- a/types/webpack/v3/index.d.ts +++ b/types/webpack/v3/index.d.ts @@ -126,9 +126,9 @@ declare namespace webpack { } interface Output { - /** The output directory as absolute path (required). */ + /** The output directory as absolute path */ path?: string; - /** The filename of the entry chunk as relative path inside the output.path directory. */ + /** (Required) The filename of the entry chunk as relative path inside the output.path directory. */ filename?: string; /** The filename of non-entry chunks as relative path inside the output.path directory. */ chunkFilename?: string; @@ -182,6 +182,14 @@ declare namespace webpack { sourcePrefix?: string; /** This option enables cross-origin loading of chunks. */ crossOriginLoading?: string | boolean; + /** The encoding to use when generating the hash, defaults to 'hex' */ + hashDigest?: 'hex' | 'latin1' | 'base64'; + /** The prefix length of the hash digest to use, defaults to 20. */ + hashDigestLength?: number; + /** Algorithm used for generation the hash (see node.js crypto package) */ + hashFunction?: string | ((algorithm: string, options?: any) => any); + /** An optional salt to update the hash via Node.JS' hash.update. */ + hashSalt?: string; } interface BaseModule { diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index d6bd908357..8fe0ab1e4d 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -100,7 +100,9 @@ configuration = { path: path.join(__dirname, "assets", "[hash]"), publicPath: "assets/[hash]/", filename: "output.[hash].bundle.js", - chunkFilename: "[id].[hash].bundle.js" + chunkFilename: "[id].[hash].bundle.js", + hashFunction: 'sha256', + hashDigestLength: 64, } };