[APPS] Use separate vite.build() for backend functions, drop Rollup backend support#292
Open
sdkennedy2 wants to merge 1 commit intomasterfrom
Open
[APPS] Use separate vite.build() for backend functions, drop Rollup backend support#292sdkennedy2 wants to merge 1 commit intomasterfrom
sdkennedy2 wants to merge 1 commit intomasterfrom
Conversation
…ackend support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
Backend functions were previously built by injecting virtual modules into the host bundler's build via
resolveId/loadhooks, with separate Rollup and Vite plugin implementations that duplicated logic. This approach was fragile — it coupled backend function bundling to the host build's configuration (plugins, aliases, output settings) and required maintaining two codepaths (Rollup + Vite).This PR switches to a standalone
vite.build()call that runs after the host build completes, giving full control over the backend build configuration. It also drops Rollup backend support entirely, simplifying to vite-only.Changes
Replaced the "inject into host build" approach with a dedicated
vite.build()for backend functions:Why a separate build? Backend functions need different build settings than the frontend — no minification, ES module format, preserved entry signatures, and no interference from the user's vite plugins. Running a standalone
vite.build()withconfigFile: falseprovides this isolation cleanly.Key changes:
backend/rollup.ts— Rollup backend support removedbackend/index.ts— removedresolveId/loadhooks, now just delegates to the vite pluginbuildBackendFunctions()inbackend/vite/index.ts— runs a separatevite.build()viacloseBundlehook, writes output to a temp directory, populatesbackendOutputsmap for the upload pluginvirtual-entry.ts— extractedgenerateMainBody()helper for reuseshared.ts—isActionCatalogInstalled()now accepts afromDirparameter for correct resolution when the plugin is linked, fixed regex escaping in action-catalog bridgebackendSupportedBundlersfrom['rollup', 'vite']to['vite']QA Instructions
yarn devin build-pluginsnpx vite build) and verify backend function.jsfiles are generated and included in the upload archiveBlast Radius
apps.backendDiris configuredDocumentation