@@ -183,27 +183,31 @@ module.exports = class HtmlPwaPlugin {
183
183
} )
184
184
185
185
if ( ! isHrefAbsoluteUrl ( this . options . manifestPath ) ) {
186
- compiler . hooks . emit . tapAsync ( ID , ( data , cb ) => {
187
- const {
188
- name,
189
- themeColor,
190
- manifestPath,
191
- manifestOptions
192
- } = this . options
193
- const publicOptions = {
194
- name,
195
- short_name : name ,
196
- theme_color : themeColor
197
- }
198
- const outputManifest = JSON . stringify (
199
- Object . assign ( publicOptions , defaultManifest , manifestOptions )
200
- )
201
- data . assets [ manifestPath ] = {
202
- source : ( ) => outputManifest ,
203
- size : ( ) => outputManifest . length
204
- }
205
- cb ( null , data )
206
- } )
186
+ compiler . hooks . compilation . tap ( ID , compilation => {
187
+ compilation . hooks . processAssets . tap (
188
+ { name : ID , stage : 'PROCESS_ASSETS_STAGE_ADDITIONS' } ,
189
+ assets => {
190
+ const {
191
+ name,
192
+ themeColor,
193
+ manifestPath,
194
+ manifestOptions
195
+ } = this . options
196
+ const publicOptions = {
197
+ name,
198
+ short_name : name ,
199
+ theme_color : themeColor
200
+ }
201
+ const outputManifest = JSON . stringify (
202
+ Object . assign ( publicOptions , defaultManifest , manifestOptions )
203
+ )
204
+ assets [ manifestPath ] = {
205
+ source : ( ) => outputManifest ,
206
+ size : ( ) => outputManifest . length ,
207
+ } ;
208
+ } ,
209
+ ) ;
210
+ } ) ;
207
211
}
208
212
}
209
213
}
0 commit comments