Skip to content

Commit

Permalink
fix: service worker plugin updated
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmichalina committed Jul 29, 2018
1 parent 7a48679 commit f9331d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fusebox/ng.sw.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ const defaults = {}
export interface NgSwPluginOptions {}

export class NgSwPluginClass {
public test: RegExp = new RegExp('fusing-angular/browser.js')
public test: RegExp = new RegExp('browser')

constructor(public opts: NgSwPluginOptions = defaults) {}

transform(file: File) {
const regex = new RegExp(/enabled: false/, 'g')
file.contents = file.contents.replace(regex, 'enabled: true')
if (regex.test(file.contents)) {
file.contents = file.contents.replace(regex, 'enabled: true')
}
}
}

Expand Down

0 comments on commit f9331d3

Please sign in to comment.