Skip to content

Commit

Permalink
default to the default hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 28, 2021
1 parent 205d3a0 commit a6bb3e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion declarations/LoaderContext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface NormalModuleLoaderContext<OptionsType> {
utils: {
absolutify: (context: string, request: string) => string;
contextify: (context: string, request: string) => string;
createHash: (algorithm: string) => Hash;
createHash: (algorithm?: string) => Hash;
};
rootContext: string;
fs: InputFileSystem;
Expand Down
4 changes: 3 additions & 1 deletion lib/NormalModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ class NormalModule extends Module {
? getContextifyInContext()(request)
: getContextify()(context, request);
},
createHash
createHash: type => {
return createHash(type || compilation.outputOptions.hashFunction);
}
};
const loaderContext = {
version: 2,
Expand Down
2 changes: 1 addition & 1 deletion types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7512,7 +7512,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
utils: {
absolutify: (context: string, request: string) => string;
contextify: (context: string, request: string) => string;
createHash: (algorithm: string) => Hash;
createHash: (algorithm?: string) => Hash;
};
rootContext: string;
fs: InputFileSystem;
Expand Down

0 comments on commit a6bb3e5

Please sign in to comment.