Skip to content

Commit

Permalink
fix: prevent generated pwa icons to be added to manifest (#20639)
Browse files Browse the repository at this point in the history
Generated PWA icons are served at runtime by PwaHandler, that also takes care
of adding a subset of them to the web manifest for caching.
However, the Vite inject-manifest-to-sw plugin adds all generated icons to the
manifest with /pwa-icons path prefix making them pre-cached by the browser and
potentially breaking pre-defined security rules.
This change prevents generated icons to be added to the manifest, preserving
the previous behavior.
  • Loading branch information
mcollovati authored Dec 9, 2024
1 parent c194e71 commit 28f60d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flow-server/src/main/resources/vite.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function injectManifestToSWPlugin(): rollup.Plugin {
const { manifestEntries } = await getManifest({
globDirectory: buildOutputFolder,
globPatterns: ['**/*'],
globIgnores: ['**/*.br'],
globIgnores: ['**/*.br', 'pwa-icons/**'],
manifestTransforms: [rewriteManifestIndexHtmlUrl],
maximumFileSizeToCacheInBytes: 100 * 1024 * 1024 // 100mb,
});
Expand Down

0 comments on commit 28f60d3

Please # to comment.