question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InjectManifest globPatterns issue

See original GitHub issue

Welcome! Please use this template for reporting bugs or requesting features. For questions about using Workbox, the best place to ask is Stack Overflow, tagged with [workbox]: https://stackoverflow.com/questions/ask?tags=workbox

Library Affected: workbox-build

Browser & Platform: “all browsers”.*

Issue or Feature Request Description: I am developping an app based on the open-wc set-up. Build tool is rollup and workbox settings are overriden using this setup:Overriding the workbox config.

Workbox.config.js: `const path = require(‘path’);

module.exports = { swDest: path.join(__dirname, ‘dist’, ‘sw.js’), swSrc: path.join(__dirname, ‘sw.js’), globDirectory: path.join(__dirname, ‘dist’), globPatterns: [‘**/*.{html,js,json,jpeg, png}’], };`

sw.js file: `import{precacheAndRoute} from ‘workbox-precaching’

/* This is a placeholder file to avoid generating an error when the app is served before being built */ console.info(‘Service worker disabled for development, will be generated at build time.’);

workbox.precaching.precacheAndRoute(self.__WB_MANIFEST) `

Issue: Only html and js files are precached. Json and any other additional extention are ignored.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
thepasslecommented, Mar 2, 2020

Ah okay, thats different than the Rollup issue yeah, its probably best to create a new issue for that on the webpack workbox plugin repo. I did run into a problem with webpack where files that werent handled by webpack werent precached, but using the webpack copy plugin solved that for me, so im afraid i cant help you there

0reactions
jeffposnickcommented, Mar 2, 2020

Thanks for investigating. I’m going to close this issue. Feel free to open a new issue with details related to the different scenario as needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the workbox-build.injectManifest function in ... - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately. gulp. task('service-worker', () => {...
Read more >
API Reference - Chrome Developers
Reference for Workbox types.
Read more >
workbox-webpack-plugin's InjectManifest only works with ...
As Jeff Posnick explained the problem is missing replacement of the placeholder string [name] . A solution / workaround is to set the...
Read more >
How to Generate Service Workers Automatically
Inject Manifest Plugin ... new InjectManifest({ swSrc: '. ... Thus Workbox not only solves this issue but is also more configurable.
Read more >
Passle on Twitter: "@lukastaegert @RollupJS @jaffathecake I was ...
InjectManifest globPatterns issue · Issue #2384 · GoogleChrome/workbox. Welcome! Please use this template for reporting bugs or requesting features.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found