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

Unable to resolve path for swDest. #10

Closed
dsych opened this issue May 23, 2018 · 1 comment
Closed

Unable to resolve path for swDest. #10

dsych opened this issue May 23, 2018 · 1 comment

Comments

@dsych
Copy link
Contributor

dsych commented May 23, 2018

The swDest property of the config gets carried over between builds which means when we directly modify swDest from config here, the subsequent rebuild is going to fail since config.swDest already contains the old resolved path and we are adding additional path config.swDest.
We end up with something like:
'/pathToYourFile/file/pathToYourFile/file'

We can fix this by changing this line to

config.swDest = path.resolve(outDir, config.swDest);
@dsych
Copy link
Contributor Author

dsych commented May 23, 2018

While we are still on swDest topic, I find it useful to have an option that allows you to turn off the resolve.
The reason why you would want to do that is to trick workbox into thinking that swSrc and swDest are different files by providing relative path for swDest. This could be used to inject precached routes into the processed SW which contains a bunch of imports.

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