问题
I'm playing around with workbox but I am getting the following error:
Skipping file 'app.js' due to size. [Max size supported is 2097152, this file is 4760833]
I understand why it would do this in production, and this isn't a problem in production as my app.js file is minified and is well under that limit.
But how can I generate a service worker I can use in development including these larger files?
回答1:
The maximumFileSizeToCacheInBytes
configuration parameter, described in more detail in the docs, can be used to increase the limit.
E.g.:
{
maximumFileSizeToCacheInBytes: 5000000,
// ...other Workbox build configuration options...
}
来源:https://stackoverflow.com/questions/46795409/how-to-cache-larger-files-for-development