-
Notifications
You must be signed in to change notification settings - Fork 406
fix(vite): use dynamic base URL based on cloud distribution #6562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Instead of hardcoding base href in index.html, set vite's base config dynamically based on DISTRIBUTION === 'cloud'. This ensures proper asset loading across different deployment contexts.
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 11/04/2025, 07:35:32 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 11/04/2025, 07:54:59 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
|
Going to see if I can change go server instead first, as I don't want a different base url across distributions - makes things inconsistent especially for FE 3p extension devs. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.28 MB (baseline 3.28 MB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 728 kB (baseline 728 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 8.18 kB (baseline 8.18 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 293 kB (baseline 293 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
UI Components — 12.6 kB (baseline 12.6 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 10.4 kB (baseline 10.4 kB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 1.07 kB (baseline 1.07 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 5.32 MB (baseline 5.32 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 2.55 MB (baseline 2.55 MB) • ⚪ 0 BBundles that do not match a named category
|
|
Edit: still needed for nested paths. |
## Summary - Replace hardcoded `<base href="/">` in index.html with dynamic vite base config - Set `base: DISTRIBUTION === 'cloud' ? '/' : ''` in vite.config.mts - Ensures proper asset loading across different deployment contexts ## Test plan - [ ] Verify cloud distribution builds work correctly - [ ] Verify localhost/desktop distributions work correctly - [ ] Test asset loading in both contexts ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6562-fix-vite-use-dynamic-base-URL-based-on-cloud-distribution-2a06d73d365081c8b5d2e58870ebd14d) by [Unito](https://www.unito.io)
|
The reason we don't want to set it for OSS is that some apps serve the application on a nested path IIRC and it may or may not break some extensions. The fact that extensions might behave differently on cloud vs. OSS is something we need to fix eventually for this - but server-side fix was a bit too involved. |
Summary
<base href="/">in index.html with dynamic vite base configbase: DISTRIBUTION === 'cloud' ? '/' : ''in vite.config.mtsTest plan
┆Issue is synchronized with this Notion page by Unito