vite-syntax-plugin-api

Clarify Vite plugin hook lifecycles, structure, and virtual modules.

4|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer --skill vite-syntax-plugin-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vite-syntax-plugin-api
Source: https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer/tree/main/.claude/skills/vite/vite-syntax/vite-syntax-plugin-api
Command: npx skills add https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer --skill vite-syntax-plugin-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Clarifies how to write Vite plugins by detailing hook lifecycles, plugin structure, and virtual modules.

Core Features & Use Cases

  • Supports writing plugins that hook into the Vite dev server, build pipeline, and HTML transforms.
  • Documents plugin structure, hook lifecycles, and virtual modules to streamline development and maintenance.
  • Real-world scenarios include creating tooling that customizes the Vite build, server behavior, and HTML processing.

Quick Start

Create a minimal Vite plugin scaffold using vite-syntax-plugin-api to explore hook lifecycles.

Frequently Asked Questions about vite-syntax-plugin-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Vite plugin that hooks into the dev server and build pipeline?

Vite plugin structure relies on hook lifecycles to intercept the dev server, build pipeline, and HTML transforms. You implement API hooks like configureServer and transformIndexHtml to customize processing.

What is the lifecycle of Vite plugin hooks like configResolved and handleHotUpdate?

Vite plugin hook lifecycles define execution timing for the dev server and build pipeline. configResolved executes after Vite config initialization, and handleHotUpdate processes custom module hot replacement logic.

How to create virtual modules in a Vite plugin?

Creating virtual modules in a Vite plugin involves intercepting module requests during the build pipeline or dev server lifecycle. You use specific hooks to return custom module content dynamically without physical files.

Does Vite plugin API support Rollup-compatible hooks for build pipeline customization?

Yes, the Vite plugin API supports Rollup-compatible hooks for build pipeline customization. Plugin authors can use these standard Rollup hooks alongside Vite-specific extensions like configureServer for unified dev and production tooling.

When do I need to use transformIndexHtml in a Vite plugin?

You need to use the transformIndexHtml hook when customizing HTML processing within Vite. It allows your plugin to modify the dev server or build pipeline HTML output by injecting scripts, tags, or modifying existing markup.