All Projects β†’ detroitenglish β†’ Cloudflare Workers Webpack Plugin

detroitenglish / Cloudflare Workers Webpack Plugin

Licence: mit
Launch Cloudflare Workers to the Edge from the comfort of your build step πŸš€

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Cloudflare Workers Webpack Plugin

Workerize Loader
πŸ—οΈ Automatically move a module into a Web Worker (Webpack loader)
Stars: ✭ 2,135 (+11761.11%)
Mutual labels:  webpack, webpack-plugin, worker
Cloudflare Workers Webpack Boilerplate
A superbly simple, minimal-config template for building, bundling and deploying Cloudflare Workers with Webpack πŸš€
Stars: ✭ 101 (+461.11%)
Mutual labels:  webpack, serverless, cloudflare
Offline Plugin
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
Stars: ✭ 4,444 (+24588.89%)
Mutual labels:  webpack, webpack-plugin
Onedrive Index Cloudflare Worker
DEPRECATED: Please use https://github.com/spencerwooo/onedrive-cf-index instead
Stars: ✭ 485 (+2594.44%)
Mutual labels:  serverless, cloudflare
Optimize Plugin
Optimized Webpack Bundling for Everyone. Intro ‡️
Stars: ✭ 525 (+2816.67%)
Mutual labels:  webpack, webpack-plugin
Edge Sql
Cloudflare Workers providing a SQL API
Stars: ✭ 429 (+2283.33%)
Mutual labels:  serverless, cloudflare
React Starter Kit
React Starter Kit β€” front-end starter kit using React, Relay, GraphQL, and JAM stack architecture
Stars: ✭ 21,060 (+116900%)
Mutual labels:  webpack, cloudflare
Prerender Spa Plugin
Prerenders static HTML in a single-page application.
Stars: ✭ 7,018 (+38888.89%)
Mutual labels:  webpack, webpack-plugin
Webpack Extension Reloader
A upgrade from πŸ”₯webpack-chrome-extension-reloaderπŸ”₯, now on all browsers
Stars: ✭ 355 (+1872.22%)
Mutual labels:  webpack, webpack-plugin
Webpack Deep Scope Analysis Plugin
A webpack plugin for deep scope analysis
Stars: ✭ 589 (+3172.22%)
Mutual labels:  webpack, webpack-plugin
Comlink Loader
Webpack loader to offload modules to Worker threads seamlessly using Comlink.
Stars: ✭ 535 (+2872.22%)
Mutual labels:  webpack, worker
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: ✭ 611 (+3294.44%)
Mutual labels:  webpack, serverless
Moment Locales Webpack Plugin
Easily remove unused Moment.js locales with webpack
Stars: ✭ 396 (+2100%)
Mutual labels:  webpack, webpack-plugin
Webpack Chrome Extension Reloader
πŸ”₯ Hot reloading while developing Chrome extensions with webpack πŸ”₯
Stars: ✭ 365 (+1927.78%)
Mutual labels:  webpack, webpack-plugin
Webpack Parallel Uglify Plugin
A faster uglifyjs plugin.
Stars: ✭ 456 (+2433.33%)
Mutual labels:  webpack, webpack-plugin
Browser Sync Webpack Plugin
Easily use BrowserSync in your Webpack project.
Stars: ✭ 356 (+1877.78%)
Mutual labels:  webpack, webpack-plugin
Babel Minify Webpack Plugin
[DEPRECATED] Babel Minify Webpack Plugin
Stars: ✭ 502 (+2688.89%)
Mutual labels:  webpack, webpack-plugin
Serverless Typescript Starter
πŸ—„πŸ™…β€β™€οΈ Deploy your next serverless JavaScript function in seconds
Stars: ✭ 653 (+3527.78%)
Mutual labels:  webpack, serverless
Web Webpack Plugin
alternative for html-webpack-plugin
Stars: ✭ 318 (+1666.67%)
Mutual labels:  webpack, webpack-plugin
Personal Site
My personal website - built with React, React-Router, React-Snap for Static-Export, and GitHub Pages.
Stars: ✭ 324 (+1700%)
Mutual labels:  webpack, serverless

Cloudflare Worker Webpack Plugin

Deploy freshly-bundled Cloudflare Worker scripts and route matching patterns directly from your build step πŸš€

Example use in Cloudflare Worker Webpack Boilerplate

    Example as implemented in Cloudflare Worker Webpack Boilerplate

Usage

Install, ...

npm install -D cloudflare-worker-webpack-plugin

... require...

const CloudflareWorkerPlugin = require('cloudflare-worker-webpack-plugin');

... and include the plugin in your webpack dark arts configuration:

// ...ave satanas webpackus ...
plugins: [

  new CloudflareWorkerPlugin(
    $CLOUDFLARE_AUTH_EMAIL,         // first arg: user-email
    $CLOUDFLARE_AUTH_KEY,           // second arg: api-key
    {                               // options object
      site: `your-site.lol`,
      enabledPatterns: `omg.your-site.lol/*,example.your-site.lol/crazy/pattern/*`,
      disabledPatterns: `example.your-site.lol/crazy/pattern/ignore-me-tho`,
      verbose: true,
      // See 'Configuration' below for additional options
    }
  ),

],

Configuration

Required Configuration

Cloudflare Credentials

  • $CLOUDFLARE_AUTH_EMAIL: Your Cloudflare user email.
  • $CLOUDFLARE_AUTH_KEY: Your Cloudflare super-duper-secret API key.

Cloudflare Zone

You must provide one of the following two options:

  • zone: Zone ID of the domain for which you're deploying your script

    OR

  • site: Fully-qualified domain name (FQDN) of your target deployment zone.

Note: If both zone and site are provided, zone wins.

Options

  • enabledPatterns: a single route matching pattern, a comma-separated list of patterns, or an Array of patterns to enable for your newly spawned JavaScript minion (default: undefined)
    • Example (string): "*.your-site.lol"
    • Example (list): "*.your-site.lol,your-site.lol/some-pattern/*"
    • Example (Array): ["*.your-site.lol", "your-site.lol/some-pattern/*"]
  • disabledPatterns: same as enabledPatterns above, but the worker will ignore requests matching these patterns.
  • script: relative path to your worker script (default: <webpack-config-output-file>)
  • metadataPath: Optional relative path to a JSON metadata file with e.g. secrets (default: undefined)
  • skipWorkerUpload: Skip uploading the worker script and process only route patterns (default: false)
  • reset: Delete ALL route patterns, DELETE existing worker script, and exit (default: false)
  • verbose: Log additional information about each deployment step to the console (default: false)
  • colors: Use colors in console output (default: false)
  • emoji: Use emoji in console output (default: false)
  • enabled: Whether to deploy to Cloudflare or bypass; useful for e.g. CI and testing (default: true)

Note: Any existing patterns not found in enabledPatterns or disabledPatterns will be deleted!

Potential Issues

This plugin does not support features reserved for Enterprise Cloudflare Workers.

Contributing

PR's are very much welcome. Here are some fun ideas to consider:

  • [ ] Write hella' cool automated tests
  • [ ] Support other neat Cloudflare Worker features like Workers KV and wasm

Feel free to create an issue throwing your own ideas at me.

Because Software

Neat Little Badges

cloudflare

code style: prettier npm version

Disclaimer

Besides a happy customer, I am not affiliated with Cloudflare in any way.

Assume in good faith that I have no idea what I'm doing; REVIEW THE SOURCE and use at your own risk πŸ™ˆ

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].