mirror of https://github.com/webpack/webpack.git
				
				
				
			remove "pass" from progress plugin
we will eventually replace the optimizing with a loop plugin
This commit is contained in:
		
							parent
							
								
									140cbaad21
								
							
						
					
					
						commit
						96d91631f6
					
				|  | @ -187,31 +187,23 @@ class ProgressPlugin { | ||||||
| 				}; | 				}; | ||||||
| 				const numberOfHooks = Object.keys(hooks).length; | 				const numberOfHooks = Object.keys(hooks).length; | ||||||
| 				Object.keys(hooks).forEach((name, idx) => { | 				Object.keys(hooks).forEach((name, idx) => { | ||||||
| 					let pass = 0; |  | ||||||
| 					const title = hooks[name]; | 					const title = hooks[name]; | ||||||
| 					const percentage = idx / numberOfHooks * 0.25 + 0.7; | 					const percentage = idx / numberOfHooks * 0.25 + 0.7; | ||||||
| 					compilation.hooks[name].intercept({ | 					compilation.hooks[name].intercept({ | ||||||
| 						name: "ProgressPlugin", | 						name: "ProgressPlugin", | ||||||
| 						context: true, | 						context: true, | ||||||
| 						call: () => { | 						call: () => { | ||||||
| 							if(pass++ > 0) | 							handler(percentage, title); | ||||||
| 								handler(percentage, title, `pass ${pass}`); |  | ||||||
| 							else |  | ||||||
| 								handler(percentage, title); |  | ||||||
| 						}, | 						}, | ||||||
| 						tap: (context, tap) => { | 						tap: (context, tap) => { | ||||||
| 							if(context) { | 							if(context) { | ||||||
| 								context.reportProgress = (...args) => { | 								// p is percentage from 0 to 1
 | ||||||
| 									if(pass > 1) | 								// args is any number of messages in a hierarchical matter
 | ||||||
| 										handler(percentage, title, `pass ${pass}`, tap.name, ...args); | 								context.reportProgress = (p, ...args) => { | ||||||
| 									else | 									handler(percentage, title, tap.name, ...args); | ||||||
| 										handler(percentage, title, tap.name, ...args); |  | ||||||
| 								}; | 								}; | ||||||
| 							} | 							} | ||||||
| 							if(pass > 1) | 							handler(percentage, title, tap.name); | ||||||
| 								handler(percentage, title, `pass ${pass}`, tap.name); |  | ||||||
| 							else |  | ||||||
| 								handler(percentage, title, tap.name); |  | ||||||
| 						} | 						} | ||||||
| 					}); | 					}); | ||||||
| 				}); | 				}); | ||||||
|  | @ -224,7 +216,7 @@ class ProgressPlugin { | ||||||
| 				}, | 				}, | ||||||
| 				tap: (context, tap) => { | 				tap: (context, tap) => { | ||||||
| 					if(context) { | 					if(context) { | ||||||
| 						context.reportProgress = (...args) => { | 						context.reportProgress = (p, ...args) => { | ||||||
| 							handler(0.95, "emitting", tap.name, ...args); | 							handler(0.95, "emitting", tap.name, ...args); | ||||||
| 						}; | 						}; | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue