File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change 22 MIT License http://www.opensource.org/licenses/mit-license.php
33 Author Tobias Koppers @sokra
44*/
5- function RemoveEmptyChunksPlugin ( ) { }
6- module . exports = RemoveEmptyChunksPlugin ;
5+ "use strict" ;
6+
7+ class RemoveEmptyChunksPlugin {
78
8- RemoveEmptyChunksPlugin . prototype . apply = function ( compiler ) {
9- compiler . plugin ( "compilation" , function ( compilation ) {
10- compilation . plugin ( [ "optimize-chunks-basic" , "optimize-extracted-chunks-basic" ] , function ( chunks ) {
11- chunks . filter ( function ( chunk ) {
12- return chunk . isEmpty ( ) && ! chunk . hasRuntime ( ) && ! chunk . hasEntryModule ( ) ;
13- } ) . forEach ( function ( chunk ) {
14- chunk . remove ( "empty" ) ;
15- chunks . splice ( chunks . indexOf ( chunk ) , 1 ) ;
9+ apply ( compiler ) {
10+ compiler . plugin ( "compilation" , ( compilation ) => {
11+ compilation . plugin ( [ "optimize-chunks-basic" , "optimize-extracted-chunks-basic" ] , ( chunks ) => {
12+ chunks . filter ( ( chunk ) => chunk . isEmpty ( ) && ! chunk . hasRuntime ( ) && ! chunk . hasEntryModule ( ) )
13+ . forEach ( ( chunk ) => {
14+ chunk . remove ( "empty" ) ;
15+ chunks . splice ( chunks . indexOf ( chunk ) , 1 ) ;
16+ } ) ;
1617 } ) ;
1718 } ) ;
18- } ) ;
19- } ;
19+ }
20+ }
21+ module . exports = RemoveEmptyChunksPlugin ;
You can’t perform that action at this time.
0 commit comments