File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ var NullFactory = require("./NullFactory");
1313function HotModuleReplacementPlugin ( options ) {
1414 options = options || { } ;
1515 this . multiStep = options . multiStep ;
16+ this . fullBuildTimeout = options . fullBuildTimeout || 200 ;
1617}
1718module . exports = HotModuleReplacementPlugin ;
1819
1920HotModuleReplacementPlugin . prototype . apply = function ( compiler ) {
2021 var multiStep = this . multiStep ;
22+ var fullBuildTimeout = this . fullBuildTimeout ;
2123 var hotUpdateChunkFilename = compiler . options . output . hotUpdateChunkFilename ;
2224 var hotUpdateMainFilename = compiler . options . output . hotUpdateMainFilename ;
2325 compiler . plugin ( "compilation" , function ( compilation , params ) {
@@ -85,6 +87,11 @@ HotModuleReplacementPlugin.prototype.apply = function(compiler) {
8587 if ( multiStep && ! recompilation && ! initialPass )
8688 return true ;
8789 } ) ;
90+ compiler . plugin ( "additional-pass" , function ( callback ) {
91+ if ( multiStep )
92+ return setTimeout ( callback , fullBuildTimeout ) ;
93+ return callback ( ) ;
94+ } ) ;
8895 compilation . plugin ( "additional-chunk-assets" , function ( ) {
8996 var records = this . records ;
9097 if ( records . hash === this . hash ) return ;
You can’t perform that action at this time.
0 commit comments