Skip to content

Latest commit

Β 

History

History
136 lines (100 loc) Β· 3.35 KB

File metadata and controls

136 lines (100 loc) Β· 3.35 KB

Zephyr Rolldown Plugin

A Rolldown plugin for deploying applications with Zephyr Cloud. This plugin enables seamless deployment of your Rolldown-built applications to Zephyr's global edge network.

For more information, please refer to our documentation for rolldown.

Note: This plugin is currently in development (WIP - Work In Progress).

Installation

# npm
npm install --save-dev zephyr-rolldown-plugin

# yarn
yarn add --dev zephyr-rolldown-plugin

# pnpm
pnpm add --dev zephyr-rolldown-plugin

# bun
bun add --dev zephyr-rolldown-plugin

Usage

Add the plugin to your Rolldown configuration:

// rolldown.config.mjs
import { defineConfig } from 'rolldown';
import { withZephyr } from 'zephyr-rolldown-plugin';

export default defineConfig({
  input: 'src/main.tsx',
  plugins: [
    {
      name: 'emit-html',
      generateBundle() {
        const html = `
          <html>
            <body>
              <div id="root"></div>
              <script type="module" src="./main.js"></script>
            </body>
          </html>
        `;
        this.emitFile({
          type: 'asset',
          fileName: 'index.html',
          source: html,
        });
      },
    },
    withZephyr(), // Add Zephyr plugin
  ],
});

TypeScript Configuration

// rolldown.config.ts
import { defineConfig } from 'rolldown';
import { withZephyr } from 'zephyr-rolldown-plugin';

export default defineConfig({
  input: 'src/main.tsx',
  plugins: [
    // ... other plugins
    withZephyr(),
  ],
});

Features

  • πŸš€ Automatic deployment during build
  • πŸ“¦ Asset optimization and bundling with Rolldown
  • πŸ”§ Zero-config setup
  • πŸ“Š Build analytics and monitoring
  • 🌐 Global CDN distribution
  • ⚑ Fast builds with Rolldown's Rust-based bundler

Getting Started

  1. Install the plugin in your Rolldown project
  2. Add it to your Rolldown configuration
  3. Build your application as usual
  4. Your app will be automatically deployed to Zephyr Cloud

Build Scripts

Add these scripts to your package.json:

{
  "scripts": {
    "dev": "rolldown --watch",
    "build": "rolldown",
    "build:prod": "NODE_ENV=production rolldown"
  }
}

Requirements

  • Rolldown (latest version)
  • Node.js 18 or higher
  • Zephyr Cloud account (sign up at zephyr-cloud.io)

Status

This plugin is currently in active development. Features and API may change as Rolldown evolves. We're working closely with the Rolldown team to ensure optimal integration.

Examples

Check out our examples directory for complete working examples:

Contributing

We welcome contributions! Please read our contributing guidelines for more information.

License

Licensed under the Apache-2.0 License. See LICENSE for more information.