File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 5656 strategy :
5757 matrix :
5858 os : [ubuntu-latest, windows-latest, macos-latest]
59- node-version : [12.x, 14.x, 16.x]
59+ node-version : [12.x, 14.x, 16.x, 17.x ]
6060 webpack-version : [latest]
6161
6262 runs-on : ${{ matrix.os }}
Original file line number Diff line number Diff line change 11import path from "path" ;
2- import crypto from "crypto" ;
32
43import { validate } from "schema-utils" ;
54import pLimit from "p-limit" ;
@@ -476,14 +475,20 @@ class CopyPlugin {
476475 const buffer = result . source . buffer ( ) ;
477476
478477 if ( transform . cache ) {
478+ // TODO: remove in the next major release
479+ const hasher =
480+ compiler . webpack &&
481+ compiler . webpack . util &&
482+ compiler . webpack . util . createHash
483+ ? compiler . webpack . util . createHash ( "xxhash64" )
484+ : // eslint-disable-next-line global-require
485+ require ( "crypto" ) . createHash ( "md4" ) ;
486+
479487 const defaultCacheKeys = {
480488 version,
481489 sourceFilename,
482490 transform : transform . transformer ,
483- contentHash : crypto
484- . createHash ( "md4" )
485- . update ( buffer )
486- . digest ( "hex" ) ,
491+ contentHash : hasher . update ( buffer ) . digest ( "hex" ) ,
487492 index,
488493 } ;
489494 const cacheKeys = `transform|${ serialize (
You can’t perform that action at this time.
0 commit comments