Merge pull request #24286 from jambonsw/add_hash_options_to_webpack

webpack: Add hash options to config
This commit is contained in:
Arthur Ozga
2018-03-15 12:24:41 -07:00
committed by GitHub
3 changed files with 20 additions and 4 deletions
+7 -1
View File
@@ -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;
}
+10 -2
View File
@@ -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 {
+3 -1
View File
@@ -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,
}
};