Socket
Book a DemoInstallSign in
Socket

vite-plugin-zephyr

Package Overview
Dependencies
Maintainers
3
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-zephyr

Vite plugin for Zephyr

latest
Source
npmnpm
Version
0.0.59
Version published
Weekly downloads
595
672.73%
Maintainers
3
Weekly downloads
 
Created
Source

Vite Plugin Zephyr

Zephyr Cloud | Zephyr Docs | Discord | Twitter | LinkedIn

Zephyr Logo

A Vite plugin for deploying applications with Zephyr Cloud. This plugin integrates with Vite's build process to enable seamless deployment of your applications with Module Federation support. Read more from our documentation here.

Get Started

The fastest way to get started is to use create-zephyr-apps to generate a new Vite application with Zephyr integration and there are various vite examples available:

npx create-zephyr-apps@latest

Installation

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

# yarn
yarn add --dev vite-plugin-zephyr

# pnpm
pnpm add --dev vite-plugin-zephyr

# bun
bun add --dev vite-plugin-zephyr

Usage

Basic Configuration

Add the plugin to your Vite configuration:

// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { withZephyr } from 'vite-plugin-zephyr';

export default defineConfig({
  plugins: [react(), withZephyr()],
  build: {
    target: 'chrome89',
  },
});

With Module Federation

For microfrontend applications using Module Federation:

// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { withZephyr, type ModuleFederationOptions } from 'vite-plugin-zephyr';

const mfConfig = {
  name: 'my-app',
  remotes: {
    shared: 'shared@http://localhost:3001/remoteEntry.js',
  },
  shared: {
    react: { singleton: true },
    'react-dom': { singleton: true },
  },
};

export default defineConfig({
  plugins: [
    react(),
    withZephyr({ mfConfig })
  ],
  build: {
    target: 'chrome89',
  },
});

TypeScript Configuration

// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { withZephyr, type ModuleFederationOptions } from 'vite-plugin-zephyr';

const mfConfig: ModuleFederationOptions = {
  name: 'host-app',
  remotes: {
    'remote-app': 'remoteApp@http://localhost:3001/remoteEntry.js',
  },
  shared: {
    react: { singleton: true },
    'react-dom': { singleton: true },
  },
};

export default defineConfig({
  plugins: [react(), withZephyr({ mfConfig })],
  build: {
    target: 'chrome89',
  },
});

Features

  • 🚀 Seamless deployment during Vite build
  • 🏗️ Module Federation support via @module-federation/vite
  • 📦 Asset optimization and caching
  • 🔧 Zero-config setup for simple applications
  • 📊 Build analytics and monitoring
  • 🌐 Global CDN distribution
  • ⚡ Hot module replacement in development

Module Federation Support

This plugin uses the official vite plugin from Module Federation under the hood, providing:

  • Host Applications: Consume remote modules from other applications
  • Remote Applications: Expose modules for consumption by host applications
  • Shared Dependencies: Efficient sharing of common libraries
  • Dynamic Imports: Runtime loading of remote modules

Getting Started

  • Install the plugin in your Vite project
  • Add it to your Vite configuration
  • Configure Module Federation (if needed) for microfrontends
  • Build your application with vite build
  • Your app will be automatically deployed to Zephyr Cloud

Build Scripts

Add these scripts to your package.json:

{
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  }
}

Requirements

  • Vite 4.x or higher
  • Node.js 18 or higher
  • Zephyr Cloud account (sign up at zephyr-cloud.io)

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.

FAQs

Package last updated on 16 Sep 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