Skip to content

[📝CUSTOM]Optimize vercel.json for Secure and Stable Vercel Deployments(Level3) #899

@sashreek-x

Description

@sashreek-x

Description:
The current vercel.json configuration in the project has a standard setup that works for basic Vercel deployments but lacks several advanced configurations required for long-term stability, CI/CD integration, and predictable build behavior under changing environments.

A few concerns identified include:
The use of npm install instead of npm ci, which can cause inconsistent dependency trees across builds.
Absence of schema validation through the official $schema field, which can result in unnoticed syntax or config issues.
Caching rules that could lead to stale assets or improper cache invalidation in critical updates.
Missing deterministic behavior in clean URL rewrites and routing for SPA fallback handling.
Lack of a build ignore safeguard that can prevent skipped builds in automated pipelines.

To ensure Level 3 deployment reliability, this issue aims to:
Implement a vercel schema for validation.
Harden the cache and rewrite logic for both single-page app routing and static assets.
Introduce deterministic installs with npm ci.
Strengthen HTTP and security headers to meet production-grade standards.
Ensure no conflicting behaviors exist between Vite’s router and Vercel’s rewrite logic.
The goal is to make the vercel.json configuration fully production-ready, enabling flawless deployment behavior, secure HTTP header enforcement, optimized caching, and minimal cold-start latency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions