[BUG] Empty object when adding runtimeCaching custom plugins with workbox-webpack-plugin #1597
Labels
Bug
An issue with our existing, production codebase.
Developer Experience
Related to ease of use for developers.
workbox-build
Library Affected:
workbox-webpack-plugin and workbox-build
Browser & Platform:
not browser-related
Issue or Feature Request Description:
When adding custom plugins to runtimeCaching option on workbox-webpack-plugin, the output sw comes with an empty object instead of the object with functions to be executed.
I think this is happening because of this line once JSON.stringify removes functions. I've managed to fix the issue on a fork with this commit parsing the object to string instead (I think it's the desired behavior and it works).
My solution doesn't parse comments and once the populate-sw-template puts the plugin content inline, single-line comments can break everything. I can work on a solution for this either but I'd like to know if you guys would accept a PR and what would be the desired behavior when dealing with comments. Should them be removed or transformed into to multi-line comments?
Code to reproduce:
The text was updated successfully, but these errors were encountered: