@@ -145,23 +145,23 @@ module.exports = class HotModuleReplacementPlugin {
145145
146146 const mainTemplate = compilation . mainTemplate ;
147147
148- mainTemplate . plugin ( "hash ", hash => {
148+ mainTemplate . hooks . hash . tap ( "HotModuleReplacementPlugin ", hash => {
149149 hash . update ( "HotMainTemplateDecorator" ) ;
150150 } ) ;
151151
152- mainTemplate . plugin ( "module-require ", ( _ , chunk , hash , varModuleId ) => {
152+ mainTemplate . hooks . moduleRequire . tap ( "HotModuleReplacementPlugin ", ( _ , chunk , hash , varModuleId ) => {
153153 return `hotCreateRequire(${ varModuleId } )` ;
154154 } ) ;
155155
156- mainTemplate . plugin ( "require-extensions ", source => {
156+ mainTemplate . hooks . requireExtensions . tap ( "HotModuleReplacementPlugin ", source => {
157157 const buf = [ source ] ;
158158 buf . push ( "" ) ;
159159 buf . push ( "// __webpack_hash__" ) ;
160160 buf . push ( mainTemplate . requireFn + ".h = function() { return hotCurrentHash; };" ) ;
161161 return Template . asString ( buf ) ;
162162 } ) ;
163163
164- mainTemplate . plugin ( "bootstrap ", ( source , chunk , hash ) => {
164+ mainTemplate . hooks . bootstrap . tap ( "HotModuleReplacementPlugin ", ( source , chunk , hash ) => {
165165 source = mainTemplate . hooks . hotBootstrap . call ( source , chunk , hash ) ;
166166 return Template . asString ( [
167167 source ,
@@ -174,16 +174,16 @@ module.exports = class HotModuleReplacementPlugin {
174174 ] ) ;
175175 } ) ;
176176
177- mainTemplate . plugin ( "global-hash ", ( ) => true ) ;
177+ mainTemplate . hooks . globalHash . tap ( "HotModuleReplacementPlugin ", ( ) => true ) ;
178178
179- mainTemplate . plugin ( "current-hash ", ( _ , length ) => {
179+ mainTemplate . hooks . currentHash . tap ( "HotModuleReplacementPlugin ", ( _ , length ) => {
180180 if ( isFinite ( length ) )
181181 return `hotCurrentHash.substr(0, ${ length } )` ;
182182 else
183183 return "hotCurrentHash" ;
184184 } ) ;
185185
186- mainTemplate . plugin ( "module-obj ", ( source , chunk , hash , varModuleId ) => {
186+ mainTemplate . hooks . moduleObj . tap ( "HotModuleReplacementPlugin ", ( source , chunk , hash , varModuleId ) => {
187187 return Template . asString ( [
188188 `${ source } ,` ,
189189 `hot: hotCreateModule(${ varModuleId } ),` ,
0 commit comments