@@ -510,7 +510,8 @@ class Compilation {
510
510
* @returns {FakeHook<Pick<AsyncSeriesHook<T>, "tap" | "tapAsync" | "tapPromise" | "name">> } fake hook which redirects
511
511
*/
512
512
const createProcessAssetsHook = ( name , stage , getArgs , code ) => {
513
- const errorMessage = reason => `Can't automatically convert plugin using Compilation.hooks.${ name } to Compilation.hooks.processAssets because ${ reason } .
513
+ const errorMessage =
514
+ reason => `Can't automatically convert plugin using Compilation.hooks.${ name } to Compilation.hooks.processAssets because ${ reason } .
514
515
BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a single Compilation.hooks.processAssets hook.` ;
515
516
const getOptions = options => {
516
517
if ( typeof options === "string" ) options = { name : options } ;
@@ -1615,9 +1616,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1615
1616
let creatingModuleDuringBuildSet = undefined ;
1616
1617
if ( ! recursive && this . buildQueue . isProcessing ( originModule ) ) {
1617
1618
// Track build dependency
1618
- creatingModuleDuringBuildSet = this . creatingModuleDuringBuild . get (
1619
- originModule
1620
- ) ;
1619
+ creatingModuleDuringBuildSet =
1620
+ this . creatingModuleDuringBuild . get ( originModule ) ;
1621
1621
if ( creatingModuleDuringBuildSet === undefined ) {
1622
1622
creatingModuleDuringBuildSet = new Set ( ) ;
1623
1623
this . creatingModuleDuringBuild . set (
@@ -1746,11 +1746,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1746
1746
module : result
1747
1747
} ;
1748
1748
}
1749
- const {
1750
- fileDependencies,
1751
- contextDependencies,
1752
- missingDependencies
1753
- } = result ;
1749
+ const { fileDependencies, contextDependencies, missingDependencies } =
1750
+ result ;
1754
1751
if ( fileDependencies ) {
1755
1752
this . fileDependencies . addAll ( fileDependencies ) ;
1756
1753
}
@@ -2316,7 +2313,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2316
2313
}
2317
2314
] of this . entries ) {
2318
2315
if ( dependOn && runtime ) {
2319
- const err = new WebpackError ( `Entrypoint '${ name } ' has 'dependOn' and 'runtime' specified. This is not valid.
2316
+ const err =
2317
+ new WebpackError ( `Entrypoint '${ name } ' has 'dependOn' and 'runtime' specified. This is not valid.
2320
2318
Entrypoints that depend on other entrypoints do not have their own runtime.
2321
2319
They will use the runtime(s) from referenced entrypoints instead.
2322
2320
Remove the 'runtime' option from the entrypoint.` ) ;
@@ -2357,11 +2355,12 @@ Remove the 'runtime' option from the entrypoint.`);
2357
2355
let chunk = this . namedChunks . get ( runtime ) ;
2358
2356
if ( chunk ) {
2359
2357
if ( ! runtimeChunks . has ( chunk ) ) {
2360
- const err = new WebpackError ( `Entrypoint '${ name } ' has a 'runtime' option which points to another entrypoint named '${ runtime } '.
2358
+ const err =
2359
+ new WebpackError ( `Entrypoint '${ name } ' has a 'runtime' option which points to another entrypoint named '${ runtime } '.
2361
2360
It's not valid to use other entrypoints as runtime chunk.
2362
2361
Did you mean to use 'dependOn: ${ JSON . stringify (
2363
- runtime
2364
- ) } ' instead to allow using entrypoint '${ name } ' within the runtime of entrypoint '${ runtime } '? For this '${ runtime } ' must always be loaded when '${ name } ' is used.
2362
+ runtime
2363
+ ) } ' instead to allow using entrypoint '${ name } ' within the runtime of entrypoint '${ runtime } '? For this '${ runtime } ' must always be loaded when '${ name } ' is used.
2365
2364
Or do you want to use the entrypoints '${ name } ' and '${ runtime } ' independently on the same page with a shared runtime? In this case give them both the same value for the 'runtime' option. It must be a name not already used by an entrypoint.` ) ;
2366
2365
const entryChunk = entry . getEntrypointChunk ( ) ;
2367
2366
err . chunk = entryChunk ;
@@ -2621,12 +2620,8 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
2621
2620
_runCodeGenerationJobs ( jobs , callback ) {
2622
2621
let statModulesFromCache = 0 ;
2623
2622
let statModulesGenerated = 0 ;
2624
- const {
2625
- chunkGraph,
2626
- moduleGraph,
2627
- dependencyTemplates,
2628
- runtimeTemplate
2629
- } = this ;
2623
+ const { chunkGraph, moduleGraph, dependencyTemplates, runtimeTemplate } =
2624
+ this ;
2630
2625
const results = this . codeGenerationResults ;
2631
2626
const errors = [ ] ;
2632
2627
asyncLib . eachLimit (
@@ -2773,17 +2768,15 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
2773
2768
chunkGraphEntries = this . _getChunkGraphEntries ( )
2774
2769
} = { } ) {
2775
2770
const context = { chunkGraph, codeGenerationResults } ;
2776
- const additionalModuleRuntimeRequirements = this . hooks
2777
- . additionalModuleRuntimeRequirements ;
2771
+ const additionalModuleRuntimeRequirements =
2772
+ this . hooks . additionalModuleRuntimeRequirements ;
2778
2773
const runtimeRequirementInModule = this . hooks . runtimeRequirementInModule ;
2779
2774
for ( const module of modules ) {
2780
2775
if ( chunkGraph . getNumberOfModuleChunks ( module ) > 0 ) {
2781
2776
for ( const runtime of chunkGraph . getModuleRuntimes ( module ) ) {
2782
2777
let set ;
2783
- const runtimeRequirements = codeGenerationResults . getRuntimeRequirements (
2784
- module ,
2785
- runtime
2786
- ) ;
2778
+ const runtimeRequirements =
2779
+ codeGenerationResults . getRuntimeRequirements ( module , runtime ) ;
2787
2780
if ( runtimeRequirements && runtimeRequirements . size > 0 ) {
2788
2781
set = new Set ( runtimeRequirements ) ;
2789
2782
} else if ( additionalModuleRuntimeRequirements . isUsed ( ) ) {
@@ -2823,9 +2816,8 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
2823
2816
for ( const treeEntry of chunkGraphEntries ) {
2824
2817
const set = new Set ( ) ;
2825
2818
for ( const chunk of treeEntry . getAllReferencedChunks ( ) ) {
2826
- const runtimeRequirements = chunkGraph . getChunkRuntimeRequirements (
2827
- chunk
2828
- ) ;
2819
+ const runtimeRequirements =
2820
+ chunkGraph . getChunkRuntimeRequirements ( chunk ) ;
2829
2821
for ( const r of runtimeRequirements ) set . add ( r ) ;
2830
2822
}
2831
2823
@@ -3223,9 +3215,9 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3223
3215
runtime,
3224
3216
runtimeTemplate
3225
3217
} ) ;
3226
- const moduleHashDigest = /** @type {string } */ ( moduleHash . digest (
3227
- hashDigest
3228
- ) ) ;
3218
+ const moduleHashDigest = /** @type {string } */ (
3219
+ moduleHash . digest ( hashDigest )
3220
+ ) ;
3229
3221
chunkGraph . setModuleHashes (
3230
3222
module ,
3231
3223
runtime ,
@@ -3354,10 +3346,11 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3354
3346
}
3355
3347
}
3356
3348
circularRuntimeChunkInfo . sort ( compareSelect ( i => i . chunk , byId ) ) ;
3357
- const err = new WebpackError ( `Circular dependency between chunks with runtime (${ Array . from (
3358
- circularRuntimeChunkInfo ,
3359
- c => c . chunk . name || c . chunk . id
3360
- ) . join ( ", " ) } )
3349
+ const err =
3350
+ new WebpackError ( `Circular dependency between chunks with runtime (${ Array . from (
3351
+ circularRuntimeChunkInfo ,
3352
+ c => c . chunk . name || c . chunk . id
3353
+ ) . join ( ", " ) } )
3361
3354
This prevents using hashes of each other and should be avoided.` ) ;
3362
3355
err . chunk = circularRuntimeChunkInfo [ 0 ] . chunk ;
3363
3356
this . warnings . push ( err ) ;
@@ -3420,15 +3413,14 @@ This prevents using hashes of each other and should be avoided.`);
3420
3413
moduleGraph : this . moduleGraph ,
3421
3414
runtimeTemplate : this . runtimeTemplate
3422
3415
} ) ;
3423
- const chunkHashDigest = /** @type {string } */ ( chunkHash . digest (
3424
- hashDigest
3425
- ) ) ;
3416
+ const chunkHashDigest = /** @type {string } */ (
3417
+ chunkHash . digest ( hashDigest )
3418
+ ) ;
3426
3419
hash . update ( chunkHashDigest ) ;
3427
3420
chunk . hash = chunkHashDigest ;
3428
3421
chunk . renderedHash = chunk . hash . substr ( 0 , hashDigestLength ) ;
3429
- const fullHashModules = chunkGraph . getChunkFullHashModulesIterable (
3430
- chunk
3431
- ) ;
3422
+ const fullHashModules =
3423
+ chunkGraph . getChunkFullHashModulesIterable ( chunk ) ;
3432
3424
if ( fullHashModules ) {
3433
3425
fullHashChunks . add ( chunk ) ;
3434
3426
} else {
@@ -3459,9 +3451,9 @@ This prevents using hashes of each other and should be avoided.`);
3459
3451
runtime : chunk . runtime ,
3460
3452
runtimeTemplate
3461
3453
} ) ;
3462
- const moduleHashDigest = /** @type {string } */ ( moduleHash . digest (
3463
- hashDigest
3464
- ) ) ;
3454
+ const moduleHashDigest = /** @type {string } */ (
3455
+ moduleHash . digest ( hashDigest )
3456
+ ) ;
3465
3457
const oldHash = chunkGraph . getModuleHash ( module , chunk . runtime ) ;
3466
3458
chunkGraph . setModuleHashes (
3467
3459
module ,
@@ -3474,9 +3466,9 @@ This prevents using hashes of each other and should be avoided.`);
3474
3466
const chunkHash = createHash ( hashFunction ) ;
3475
3467
chunkHash . update ( chunk . hash ) ;
3476
3468
chunkHash . update ( this . hash ) ;
3477
- const chunkHashDigest = /** @type {string } */ ( chunkHash . digest (
3478
- hashDigest
3479
- ) ) ;
3469
+ const chunkHashDigest = /** @type {string } */ (
3470
+ chunkHash . digest ( hashDigest )
3471
+ ) ;
3480
3472
chunk . hash = chunkHashDigest ;
3481
3473
chunk . renderedHash = chunk . hash . substr ( 0 , hashDigestLength ) ;
3482
3474
this . hooks . contentHash . call ( chunk ) ;
@@ -4051,11 +4043,8 @@ This prevents using hashes of each other and should be avoided.`);
4051
4043
// Create new chunk graph, chunk and entrypoint for the build time execution
4052
4044
const chunkGraph = new ChunkGraph ( this . moduleGraph ) ;
4053
4045
const runtime = "build time" ;
4054
- const {
4055
- hashFunction,
4056
- hashDigest,
4057
- hashDigestLength
4058
- } = this . outputOptions ;
4046
+ const { hashFunction, hashDigest, hashDigestLength } =
4047
+ this . outputOptions ;
4059
4048
const runtimeTemplate = this . runtimeTemplate ;
4060
4049
4061
4050
const chunk = new Chunk ( "build time chunk" ) ;
@@ -4151,9 +4140,8 @@ This prevents using hashes of each other and should be avoided.`);
4151
4140
} ) ;
4152
4141
this . chunkGraph = old ;
4153
4142
4154
- const runtimeModules = chunkGraph . getChunkRuntimeModulesIterable (
4155
- chunk
4156
- ) ;
4143
+ const runtimeModules =
4144
+ chunkGraph . getChunkRuntimeModulesIterable ( chunk ) ;
4157
4145
4158
4146
// Hash runtime modules
4159
4147
for ( const module of runtimeModules ) {
0 commit comments