feat: inject SPA config in Frameworks API#28
Conversation
✅ Deploy Preview for angular-runtime-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Vite plugin now adds a build-time SPA configuration plugin that reads Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/vite-plugin/src/main.ts (1)
144-144: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the public
netlify()wiring.The new tests invoke
createSpaConfigPlugin()directly, so they would still pass ifnetlify()stopped returning this plugin. Add an integration assertion throughnetlify()to protect this public entry point.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vite-plugin/src/main.ts` at line 144, Add integration coverage for the public netlify() entry point that verifies its returned plugin wiring includes the createSpaConfigPlugin() behavior. Keep the existing direct createSpaConfigPlugin() tests, but exercise the behavior through netlify() so removing that plugin from netlify() causes the test to fail.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/vite-plugin/src/main.ts`:
- Line 144: Add integration coverage for the public netlify() entry point that
verifies its returned plugin wiring includes the createSpaConfigPlugin()
behavior. Keep the existing direct createSpaConfigPlugin() tests, but exercise
the behavior through netlify() so removing that plugin from netlify() causes the
test to fail.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: efe758f3-3740-48b0-bf54-c51e0bbff69c
📒 Files selected for processing (5)
.prettierignorepackages/angular-runtime/demo.test.mjspackages/vite-plugin/src/lib/build.test.tspackages/vite-plugin/src/lib/build.tspackages/vite-plugin/src/main.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
netlify/blueprints(manual)
💤 Files with no reviewable changes (1)
- packages/angular-runtime/demo.test.mjs
Follow-up of: netlify/build#7141
When
appType === 'spa', the Vite plugin will now auto-inject:{ "build": { "spa": true } }in
.netlify/v1/config.json. Then,@netlify/buildand@netlify/configchanges in the above linked PR will handle adding the rewrite.