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

How append push notification separate file to service worker? #223

Open
hmz22 opened this issue Feb 26, 2020 · 1 comment
Open

How append push notification separate file to service worker? #223

hmz22 opened this issue Feb 26, 2020 · 1 comment

Comments

@hmz22
Copy link

hmz22 commented Feb 26, 2020

Hi dears.
How can append separate file service worker with push notification code in workboxOpt, next.config.js when build.
please please.

@hmz22
Copy link
Author

hmz22 commented Feb 27, 2020

i solved this.
my next.config.js:

const path = require("path");
const nextOffline = require("next-offline");

module.exports = nextOffline({
  workboxOpts: {
    importScripts: ["./sw.js"],
    mode: "production",
    swDest: path.join(__dirname, "public/service-worker.js")
  }
});

and i create sw.js in public folder

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

1 participant