Skip to content

feat(agentflow): Build without sourcemaps for production#5787

Merged
ginna-baker merged 2 commits intomainfrom
feat/agentflow-prod-build
Feb 23, 2026
Merged

feat(agentflow): Build without sourcemaps for production#5787
ginna-baker merged 2 commits intomainfrom
feat/agentflow-prod-build

Conversation

@ginna-baker
Copy link
Copy Markdown
Collaborator

  • Bring the Agentflow bundle size down from 2.4MB to 1.0MB by building without JS sourcemaps

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Bundle Size Reduction: Reduced the Agentflow bundle size from 2.4MB to 1.0MB by preventing the generation of JavaScript sourcemaps for production builds.
  • Build Script Updates: Modified package.json scripts to explicitly set NODE_ENV=production for build commands and NODE_ENV=development for development commands.
  • Vite Configuration: Updated vite.config.ts to dynamically enable sourcemaps only during development, ensuring they are disabled for production builds.
Changelog
  • packages/agentflow/package.json
    • Updated the build script to include NODE_ENV=production.
    • Updated dev and dev:example scripts to include NODE_ENV=development.
  • packages/agentflow/vite.config.ts
    • Introduced an isDev constant based on process.env.NODE_ENV.
    • Modified the sourcemap option in the build configuration to be isDev ? true : false.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

name: 'FlowiseAgentflow',
formats: ['es', 'umd'],
fileName: (format) => `index.${format === 'es' ? 'js' : 'umd.js'}`,
plugins: [
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks like the husky pre-commit hook modified all the spacing here

sourcemap: true,
},
cssCodeSplit: false,
sourcemap: isDev ? true : false
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this line is the main change

Copy link
Copy Markdown
Contributor

@jocelynlin-wd jocelynlin-wd Feb 19, 2026

Choose a reason for hiding this comment

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

do we want to simplify this to just isDev ? #5787 (comment)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm going to leave it for now, but won't be offended if you / someone changes it later

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@ginna-baker ginna-baker changed the title Build without sourcemaps for production feat(agentflow): Build without sourcemaps for production Feb 19, 2026
@ginna-baker ginna-baker merged commit 94168c9 into main Feb 23, 2026
7 checks passed
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.

3 participants