Repository navigation
fix(pwa): precache the files of injectManifestConfig.globPatterns - #13019
Conversation
The plugin read the globPatterns property of the Workbox injectManifest function, always undefined, instead of the user option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
Motivation
The
injectManifestConfigdocs say that we precache the regular static assets, and that you can add more files withglobPatterns:This never worked: the user
globPatternswere ignored, and these files were never available offline.Since the plugin was created in #2205, the code merged
injectManifest.globPatterns(a property of the WorkboxinjectManifest()function, alwaysundefined) instead ofinjectManifestConfig.globPatterns. The TypeScript migration in #5941 then hid the type error with// @ts-expect-error: internal API?.This PR moves the glob patterns to a small
getGlobPatterns()function, merging the user option, with unit tests.Test Plan
Unit tests for
getGlobPatterns().Test links
Deploy preview: https://deploy-preview-13019--docusaurus-2.netlify.app/
Related issues/PRs
🤖 Generated with Claude Code
Summary by CodeRabbit