File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
Expand file tree Collapse file tree 1 file changed +17
-13
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 FlagInitialModulesAsUsedPlugin ( ) { }
6- module . exports = FlagInitialModulesAsUsedPlugin ;
7- FlagInitialModulesAsUsedPlugin . prototype . apply = function ( compiler ) {
8- compiler . plugin ( "compilation" , function ( compilation ) {
9- compilation . plugin ( "after-optimize-chunks" , function ( chunks ) {
10- chunks . forEach ( function ( chunk ) {
11- if ( ! chunk . isInitial ( ) ) {
12- return ;
13- }
14- chunk . modules . forEach ( function ( module ) {
15- module . usedExports = true ;
5+ "use strict" ;
6+
7+ class FlagInitialModulesAsUsedPlugin {
8+ apply ( compiler ) {
9+ compiler . plugin ( "compilation" , ( compilation ) => {
10+ compilation . plugin ( "after-optimize-chunks" , ( chunks ) => {
11+ chunks . forEach ( ( chunk ) => {
12+ if ( ! chunk . isInitial ( ) ) {
13+ return ;
14+ }
15+ chunk . modules . forEach ( ( module ) => {
16+ module . usedExports = true ;
17+ } ) ;
1618 } ) ;
1719 } ) ;
1820 } ) ;
19- } ) ;
20- } ;
21+ }
22+ }
23+
24+ module . exports = FlagInitialModulesAsUsedPlugin ;
You can’t perform that action at this time.
0 commit comments