feat(agentflow): Build without sourcemaps for production#5787
feat(agentflow): Build without sourcemaps for production#5787ginna-baker merged 2 commits intomainfrom
Conversation
ginna-baker
commented
Feb 19, 2026
- Bring the Agentflow bundle size down from 2.4MB to 1.0MB by building without JS sourcemaps
Summary of ChangesHello @ginna-baker, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly optimizes the production build of the Agentflow package by disabling JavaScript sourcemap generation. This change directly addresses bundle size concerns, leading to a substantial reduction in the final output, which improves loading performance for users. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| name: 'FlowiseAgentflow', | ||
| formats: ['es', 'umd'], | ||
| fileName: (format) => `index.${format === 'es' ? 'js' : 'umd.js'}`, | ||
| plugins: [ |
There was a problem hiding this comment.
Looks like the husky pre-commit hook modified all the spacing here
| sourcemap: true, | ||
| }, | ||
| cssCodeSplit: false, | ||
| sourcemap: isDev ? true : false |
There was a problem hiding this comment.
this line is the main change
There was a problem hiding this comment.
do we want to simplify this to just isDev ? #5787 (comment)
There was a problem hiding this comment.
I'm going to leave it for now, but won't be offended if you / someone changes it later
There was a problem hiding this comment.
Code Review
This pull request successfully reduces the production bundle size by disabling sourcemaps. The changes in package.json to set NODE_ENV and the conditional logic in vite.config.ts are correctly implemented. I've added one minor suggestion to simplify the boolean logic in the Vite configuration for better readability. The change is effective and achieves its goal.