You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

wrangler-pages-functions-dev

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wrangler-pages-functions-dev

A vite plugin for handling pages functions requests in local dev mode


Version published
Weekly downloads
10
increased by66.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

wrangler-pages-functions-dev

wrangler-pages-functions-dev is a Vite plugin that can be used to handle Cloudflare Pages Functions during local development.

It can be useful for example when working on a single page application that makes use of Pages Functions.

Usage

Install the package as a dev dependency alongside wrangler:

npm i -D wrangler-pages-functions-dev wrangler

To use the plugin with vite dev simply update your vite config file to include the plugin and to specify which routes it should handle, for example:

export default defineConfig({
  plugins: [
+    wranglerPagesFunctionsDev({
+      matchRoutes: /api/,
+    }),
    // ...
  ],
})

You can preview or deploy you application with wrangler pages in the same exact way as you would without this plugin (this plugin only effects vite dev everything else works exactly the same as it would otherwise).

Examples

  • React SPA hello-world example
    Very minimalistic example that shows how this plugin can be used to locally developer a react SPA applications alongside Pages Functions.

Keywords

FAQs

Package last updated on 28 May 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc