File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1+ const AdvancedGroup = require ( '../lib/groups/AdvancedGroup' ) ;
2+
3+ describe ( 'AdvancedGroup' , function ( ) {
4+ it ( 'should load the HMR Plugin' , ( ) => {
5+ const group = new AdvancedGroup ( [
6+ {
7+ hot : true ,
8+ } ,
9+ ] ) ;
10+
11+ const result = group . run ( ) ;
12+ expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'HotModuleReplacementPlugin' ) ;
13+ } ) ;
14+
15+ it ( 'should load the Prefetch Plugin' , ( ) => {
16+ const group = new AdvancedGroup ( [
17+ {
18+ prefetch : 'url' ,
19+ } ,
20+ ] ) ;
21+
22+ const result = group . run ( ) ;
23+ expect ( result . options . plugins [ 0 ] . constructor . name ) . toEqual ( 'PrefetchPlugin' ) ;
24+ } ) ;
25+ } ) ;
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ class AdvancedGroup extends GroupHelper {
2525 if ( options && options . plugins ) {
2626 options . plugins . unshift ( prefetchVal ) ;
2727 } else {
28- // Currently the Plugin function is not functional -> https://github.com/webpack/webpack-cli/pull/1140#discussion_r376761359
29- // options.plugins = [prefetchVal];
28+ options . plugins = [ prefetchVal ] ;
3029 }
3130 }
3231 if ( args . target ) {
You can’t perform that action at this time.
0 commit comments