Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascripts under app/serviveworkers not added to generated service worker #50

Open
hronik1 opened this issue Apr 26, 2017 · 1 comment

Comments

@hronik1
Copy link

hronik1 commented Apr 26, 2017

Per the README, "If you wish to add your own logic to the generated service worker, you can place that code in .js files in app/serviceworkers."

I have the following as the last entry in my Brocfile.js:

module.exports = Merge([tree, writeServiceWorker(tree, {
  enabled: true,
  debug: true,
  serviceWorkerFile: "browser-push-service-worker.js",
  includeRegistration: false
})]);

As well as the following under app/serviceworkers/browser-push-service-worker.js:

self.addEventListener('pushsubscriptionchange',
  function() {
    console.log('pushsubscriptionchanged');
  }
);

The documentation would suggest that after I perform an ember build, I should see the event listener added to the generated service worker at dist/browser-push-service-worker.js, however it just appears to be a renamed version of the default service-worker.js.

@jkleinsc
Copy link
Owner

@hronik1 is this for an Ember app or some other kind of app? You shouldn't need to specify broccoli-serviceworker options in a Brocfile for an Ember app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants