File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,26 @@ self.addEventListener('install', (event) => {
30
30
31
31
gulp . task ( "gen-service-worker-app-prod" , async ( ) => {
32
32
// Read bundled source file
33
- const bundleManifest = require ( path . resolve ( paths . output , "manifest.json" ) ) ;
33
+ const bundleManifestLatest = require ( path . resolve (
34
+ paths . output ,
35
+ "manifest.json"
36
+ ) ) ;
34
37
let serviceWorkerContent = fs . readFileSync (
35
- paths . root + bundleManifest [ "service_worker.js" ] ,
38
+ paths . root + bundleManifestLatest [ "service_worker.js" ] ,
36
39
"utf-8"
37
40
) ;
38
41
39
42
// Delete old file from frontend_latest so manifest won't pick it up
40
- fs . removeSync ( paths . root + bundleManifest [ "service_worker.js" ] ) ;
41
- fs . removeSync ( paths . root + bundleManifest [ "service_worker.js.map" ] ) ;
43
+ fs . removeSync ( paths . root + bundleManifestLatest [ "service_worker.js" ] ) ;
44
+ fs . removeSync ( paths . root + bundleManifestLatest [ "service_worker.js.map" ] ) ;
45
+
46
+ // Remove ES5
47
+ const bundleManifestES5 = require ( path . resolve (
48
+ paths . output_es5 ,
49
+ "manifest.json"
50
+ ) ) ;
51
+ fs . removeSync ( paths . root + bundleManifestES5 [ "service_worker.js" ] ) ;
52
+ fs . removeSync ( paths . root + bundleManifestES5 [ "service_worker.js.map" ] ) ;
42
53
43
54
const workboxManifest = await workboxBuild . getManifest ( {
44
55
// Files that mach this pattern will be considered unique and skip revision check
You can’t perform that action at this time.
0 commit comments