Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

@AntonioVentilii AntonioVentilii commented Oct 21, 2025

Motivation

This change removes the 'index' fallback in the Vite manualChunks configuration. Returning undefined lets Rollup handle chunk splitting automatically, allowing dynamic imports (like i18n JSON files) to be bundled separately instead of being merged into a single large index chunk.

Before --> 2 chunks (biggest 5.4 MB)

Screenshot 2025-10-22 at 10 39 36

After --> 168 chunks (biggest 2.1 MB)

Screenshot 2025-10-22 at 10 38 56

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner October 21, 2025 15:43
Copilot AI review requested due to automatic review settings October 21, 2025 15:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the Vite build configuration to enable proper dynamic chunking by removing the default 'index' fallback in the manualChunks function. By returning undefined instead of 'index', Rollup can automatically handle chunk splitting, allowing dynamically imported resources (such as i18n JSON files) to be bundled into separate chunks rather than being combined into a single large index chunk.

Key Changes:

  • Removed the 'index' fallback return value in the manualChunks configuration, replacing it with an implicit undefined return

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@AntonioVentilii
Copy link
Collaborator Author

@AntonioVentilii AntonioVentilii deleted the feat-build/Remove-index-fallback-to-enable-proper-dynamic-chunking branch October 21, 2025 17:43
@AntonioVentilii AntonioVentilii restored the feat-build/Remove-index-fallback-to-enable-proper-dynamic-chunking branch October 22, 2025 08:33
@AntonioVentilii
Copy link
Collaborator Author

Reopening this PR, since we require smarter chunks

}

return 'index';
return undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? I would have expected an exception for the languages, hasn't this for side effect to chunks the entire OISY code base?

@AntonioVentilii AntonioVentilii marked this pull request as draft October 22, 2025 10:05
auto-merge was automatically disabled October 22, 2025 10:05

Pull request was converted to draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants