fix(vite): allow global prod builds with npx#4260
Conversation
Inline `isCSSRequest` and `normalizePath` from vite to avoid requiring vite as a runtime dependency.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughStatic Vite helper imports are replaced with dynamic runtime imports in build code; the bundled ChangesDynamic Module Loading and Vite Plugin Patching
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/build/vite/env.ts`:
- Around line 90-93: createNitroEnvironment calls createFetchableDevEnvironment
but the recent scoped dynamic import in createEnvironment only binds
createFetchableDevEnvironment inside that block, leaving
createFetchableDevEnvironment undefined where createNitroEnvironment is used;
fix by ensuring createFetchableDevEnvironment is available in the scope used by
createNitroEnvironment — either perform a top-level or shared dynamic import of
"./dev.ts" that extracts createFetchableDevEnvironment (e.g., assign it to a
module-scoped variable) or update createNitroEnvironment to import/create it
when needed so the symbol referenced by createNitroEnvironment is actually
defined; adjust createEnvironment (and its import("./dev.ts") usage) accordingly
to not shadow or localize the binding.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: af3b58a8-b966-4ba2-a8ac-af057d0ff9fa
📒 Files selected for processing (4)
patches/@hiogawa__vite-plugin-fullstack.patchpnpm-workspace.yamlsrc/build/vite/env.tssrc/build/vite/plugin.ts
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
commit: |
Nitro can be used to build a Vite application for production deployment anywhere without being installed and used via
npx|pnpx|bunx nitro build --builder vite.However in some places (dev paths) we were importing from vite which is not possible as vite is not a direct nitro dep. Also fullstack plugin needed two small utils can be inlined.