New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vite-plugin-cloudflare-redirect

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-cloudflare-redirect

Vite plugin to handle Cloudflare's _redirects file

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

vite-plugin-cloudflare-redirect

Vite plugin to handle Cloudflare's _redirects file following https://developers.cloudflare.com/pages/platform/redirects/.

Usage

Create a _redirects file at /public (or following the publicDir config):

# /public/_redirects
/foo https://example.com 302
// vite.config.js
import { defineConfig } from 'vite'
import { cloudflareRedirect } from 'vite-plugin-cloudflare-redirect'

export default defineConfig({
  plugins: [
    cloudflareRedirect({
      redirectsFile: './custom/_redirects' // optional
    })
  ]
})

By default if no options are passed, the plugin would try to load from /public/_redirects (from publicDir config). If the file isn't found, no redirects will happen. Pass the redirectsFile option to specify a custom path.

Sponsors

Sponsors

License

MIT

Keywords

vite

FAQs

Package last updated on 27 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts