Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,26 @@ export default createAppConfig({
},
includeSourceMaps: true,
},
config: {
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
// By default, Vite stores __vitePreload in the entrypoint
// Then chunks import entrypoint to get the _vitePreload function
// Which results not only in cyclic import but also duplicated module in production
// Because in production entrypoints must be imported with ?v=hash cache busting
// See: https://github.com/nextcloud/notifications/issues/2164
//
// To avoid it - explicitly exclude the preload helper to a separate chunk
//
// TODO: add to @nextcloud/vite-config
if (id.startsWith('\0vite/preload-helper')) {
return 'vite-preload-helper'
}
},
},
},
},
},
})