File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
test/configCases/plugins/progress-plugin Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ module . exports = [ ] ;
Original file line number Diff line number Diff line change 1+ it ( "should contain the custom progres messages" , function ( ) {
2+ var data = require ( __dirname + "/data" ) ;
3+ data . should . containEql ( "optimizing" ) ;
4+ data . should . containEql ( "optimizing|CustomPlugin" ) ;
5+ data . should . containEql ( "optimizing|CustomPlugin|custom category|custom message" ) ;
6+ } ) ;
Original file line number Diff line number Diff line change 1+ var webpack = require ( "../../../../" ) ;
2+ var data = require ( "./data" ) ;
3+ module . exports = {
4+ externals : {
5+ [ __dirname + "/data" ] : "commonjs " + __dirname + "/data"
6+ } ,
7+ plugins : [
8+ new webpack . ProgressPlugin ( ( value , ...messages ) => {
9+ data . push ( messages . join ( "|" ) ) ;
10+ } ) ,
11+ {
12+ apply : ( compiler ) => {
13+ compiler . hooks . compilation . tap ( "CustomPlugin" , compilation => {
14+ compilation . hooks . optimize . tap ( {
15+ name : "CustomPlugin" ,
16+ context : true
17+ } , ( context ) => {
18+ context . reportProgress ( 0 , "custom category" , "custom message" ) ;
19+ } ) ;
20+ } ) ;
21+ }
22+ }
23+ ]
24+ } ;
You can’t perform that action at this time.
0 commit comments