@@ -3,8 +3,8 @@ var runGitCommand = require('./helpers/run-git-command')
33module . exports = function buildFile ( compiler , gitWorkTree , command , replacePattern , asset ) {
44 var data = ''
55
6- compiler . plugin ( 'compilation' , function ( compilation ) {
7- compilation . plugin ( 'optimize-tree' , function ( chunks , modules , callback ) {
6+ compiler . hooks . compilation . tap ( 'compilation' , ( compilation ) => {
7+ compilation . hooks . optimizeTree . tapAsync ( 'optimize-tree' , ( chunks , modules , callback ) => {
88 runGitCommand ( gitWorkTree , command , function ( err , res ) {
99 if ( err ) { return callback ( err ) }
1010 data = res
@@ -13,12 +13,12 @@ module.exports = function buildFile (compiler, gitWorkTree, command, replacePatt
1313 } )
1414 } )
1515
16- compilation . mainTemplate . plugin ( 'asset-path' , function ( path ) {
16+ compilation . mainTemplate . hooks . assetPath . tap ( 'asset-path' , ( path ) => {
1717 return path . replace ( replacePattern , data )
1818 } )
1919 } )
2020
21- compiler . plugin ( 'emit' , function ( compilation , callback ) {
21+ compiler . hooks . emit . tapAsync ( 'emit' , ( compilation , callback ) => {
2222 compilation . assets [ asset ] = {
2323 source : function ( ) {
2424 return data
0 commit comments