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

Build service-worker.js to /static to work better with next export #47

Closed
mfix22 opened this issue Aug 23, 2018 · 3 comments
Closed

Build service-worker.js to /static to work better with next export #47

mfix22 opened this issue Aug 23, 2018 · 3 comments

Comments

@mfix22
Copy link
Contributor

mfix22 commented Aug 23, 2018

Since next export automatically copies files from /static into the build folder, if the service-worker.js was output to there, then users wouldn't have to manually copy it over to the public directory (like we do here)

@hanford
Copy link
Owner

hanford commented Aug 23, 2018

Would love a PR

Feel free to ping me if you have any questions!

@joaovieira
Copy link
Contributor

The sw output should be defined by the swDest option from workbox and everything else should work around it.

Is /static the right place? That's what next-workbox does, but it felt odd to me as well given it's not a generated folder and generating files into user folders may be unexpected. On the other side, .next/static is not automatically exported.

Ideas?

@mfix22
Copy link
Contributor Author

mfix22 commented Aug 23, 2018

It was actually working correctly! There was just a bug from using path.join instead of resolve (: PR mentioned above fixes it

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

3 participants