Enable Offline Support for SVG and PNG Assets in PWA #474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@walterbender
_Take a look on this and tell me how should I proceed with issue
Functionalites:
Added globPatterns and included hashed SVG/PNG assets in the Vite PWA configuration to ensure offline support. Previously, these assets were missing when offline.
Changes Made:
Updated vite.config.ts to include globPatterns: ['**/*.{js,css,html,svg,png,wav}'].
Added hashed assets (e.g 'build-53e87ed8.svg',
'close-444dc9a6.svg',
'code-74870b2e.svg',
'exportDrawing-aee43b5d.svg',
'help-a0383ce2.svg',
'logo-3080f493.png',
'mouse-46cf41ce.svg',
'pin-8515e01d.svg',
'reset-a8de2102.svg',
'run-123f2282.svg',
'saveProjectHTML-e442bff6.svg',
'startRecording-5dec9e0d.svg',
'stop-aa193098.svg',
'stopRecording-48f9a011.svg',
'unpin-427cfcc6.svg')
to includeAssets.
Issue:
Offline mode did not load certain SVG/PNG assets.
Resolution:
Workbox now precaches all matching assets, including hashed files, ensuring proper offline functionality.
Testing Preview:
=> Checked that all SVG and PNG assets appear in the browser’s cache storage.
=> Tested the app offline to ensure all images render correctly.
=> Case Closed