Fix(csp): remove unsafe-eval requirement for Vue3 production builds#4159
Fix(csp): remove unsafe-eval requirement for Vue3 production builds#4159
Conversation
- Switch from full Vue build (with compiler) to runtime-only build - Runtime-only build doesn't require unsafe-eval CSP directive - Update app initialization to pass root component to createApp() - Explicitly disable unsafe-eval in DisableCSP middleware for production - Development mode (with hot reload) continues to disable CSP entirely The full Vue build includes template compiler which uses new Function() internally, requiring unsafe-eval. Since we use pre-compiled .vue SFCs, the runtime-only build is sufficient and more secure. Closes #4158
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR updates Vue build configuration from the full ESM bundler to the runtime-only variant, restructures Vue app initialization to use AppComponent as the root directly, and removes CSP unsafe-eval relaxation from the middleware. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Fixes #3764
The full Vue build includes template compiler which uses new Function() internally, requiring unsafe-eval. Since we use pre-compiled .vue SFCs, the runtime-only build is sufficient and more secure.
Summary by CodeRabbit
Bug Fixes
Refactor