<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roya</title>
    <description>The latest articles on DEV Community by Roya (@roya_lan_c712e571a6d261e).</description>
    <link>https://dev.to/roya_lan_c712e571a6d261e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3921583%2Fefa35192-81db-47c8-9732-b9c97cfb379f.jpg</url>
      <title>DEV Community: Roya</title>
      <link>https://dev.to/roya_lan_c712e571a6d261e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roya_lan_c712e571a6d261e"/>
    <language>en</language>
    <item>
      <title>AI can read your Figma. Figwright lets it build there, too.</title>
      <dc:creator>Roya</dc:creator>
      <pubDate>Sat, 27 Jun 2026 10:53:44 +0000</pubDate>
      <link>https://dev.to/roya_lan_c712e571a6d261e/ai-can-read-your-figma-figwright-lets-it-build-there-too-5an9</link>
      <guid>https://dev.to/roya_lan_c712e571a6d261e/ai-can-read-your-figma-figwright-lets-it-build-there-too-5an9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — &lt;a href="https://github.com/awdr74100/figwright" rel="noopener noreferrer"&gt;Figwright&lt;/a&gt; is a free, open-source MCP server + Figma plugin that gives any AI agent a &lt;strong&gt;two-way door&lt;/strong&gt; into Figma. It reads designs into code that reuses &lt;em&gt;your&lt;/em&gt; components and tokens, and it writes back onto the canvas — frames, text, auto-layout, styles, variables, whole screens. &lt;strong&gt;92 tools. Any MCP client. No Dev Mode seat.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;npx -y @figwright/mcp@latest&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Here's a Tuesday I've lived more times than I'd like.&lt;/p&gt;

&lt;p&gt;It's 3pm. A designer drops a Figma link in Slack — &lt;em&gt;"can you build this screen? should be quick 🙏"&lt;/em&gt; — and I make the mistake of believing "should be quick." I point my AI agent at the frame and ask for the code. Thirty seconds later I'm staring at a 180-line component that's really just a wall of &lt;code&gt;&amp;lt;div style={{ ... }}&amp;gt;&lt;/code&gt;, with &lt;code&gt;#2563EB&lt;/code&gt; hardcoded in six places. That blue is literally &lt;code&gt;bg-primary&lt;/code&gt; in our config — the AI just has no way to know that. The &lt;code&gt;Button&lt;/code&gt; I shipped last month? Reinvented from scratch. My Tailwind tokens? Never heard of them. So I spend the next hour find-and-replacing hex codes like it's 2015, swapping the AI's generic markup for the components we already have. The tool "saved me time" by handing me homework.&lt;/p&gt;

&lt;p&gt;Then the designer follows up, breezy as ever: &lt;em&gt;"oh, can you also drop a pricing section into the Figma file so I can tweak the spacing?"&lt;/em&gt; And my AI just… shrugs. It'll describe the canvas to me all day. It can't put one frame back on it.&lt;/p&gt;

&lt;p&gt;And the official Figma Dev Mode MCP — the thing that does the reading half? It wants a &lt;strong&gt;paid Dev Mode seat&lt;/strong&gt;. For a side project, that's where the conversation quietly ends.&lt;/p&gt;

&lt;p&gt;I got tired of every part of that Tuesday, so I built &lt;strong&gt;Figwright&lt;/strong&gt;: a free, open-source MCP server (plus a Figma plugin) that gives any AI agent — Claude Code, Cursor, whatever speaks MCP — a &lt;strong&gt;two-way door&lt;/strong&gt; into Figma. Let me walk you through how it fixes that exact day.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Where &lt;strong&gt;Playwright&lt;/strong&gt; drives the browser, &lt;strong&gt;Figwright&lt;/strong&gt; drives Figma.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Problem 1: "The AI ignores everything I've already built"
&lt;/h2&gt;

&lt;p&gt;Generic tools fail for one reason: they hand the model a &lt;em&gt;flattened picture&lt;/em&gt; of the design and zero knowledge of your repo. Of course it reinvents a button — it doesn't know you have one.&lt;/p&gt;

&lt;p&gt;Figwright does the opposite. Before it writes a line, it does what I call &lt;strong&gt;grounding&lt;/strong&gt;: it reads your real stack (React / Vue / Svelte / Next… + Tailwind / CSS / CSS-in-JS) and then &lt;em&gt;joins the Figma design to your codebase&lt;/em&gt; with three tools that are the heart of the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;component_map&lt;/code&gt;&lt;/strong&gt; — sees a card in the design, knows you already ship &lt;code&gt;&amp;lt;Card&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;token_map&lt;/code&gt;&lt;/strong&gt; — sees your brand blue, emits &lt;code&gt;bg-primary&lt;/code&gt;, not &lt;code&gt;#2563EB&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;icon_map&lt;/code&gt;&lt;/strong&gt; — sees an icon and reuses the &lt;strong&gt;actual SVG from your repo&lt;/strong&gt; (with the right &lt;code&gt;currentColor&lt;/code&gt; / fixed-fill contract), instead of re-drawing a blob.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of it rides on &lt;code&gt;get_design_context&lt;/code&gt;, which gives the model &lt;em&gt;faithful, de-duplicated&lt;/em&gt; context — layout, typography, variables, components — instead of a screenshot it has to guess from.&lt;/p&gt;

&lt;p&gt;So the same request that used to spit out &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; soup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ generic tool: hardcoded values, your design system nowhere in sight&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#2563EB&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#fff&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;fontWeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Get started&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;…now comes back as code I can actually merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ Figwright: reuses the component and tokens I already have&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"primary"&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"md"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  Get started
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No afternoon of cleanup. That's the whole point: &lt;strong&gt;don't be a compiler that flattens the design — surface honest context and let the model write code that fits the repo it's living in.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 2: "It can only look, never touch"
&lt;/h2&gt;

&lt;p&gt;This is the half nobody else does. When the designer asks me to push a section &lt;em&gt;into&lt;/em&gt; Figma, I now just… do it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Build a 3-tier pricing section in Figma from this spec.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Figwright authors the canvas directly — and it &lt;strong&gt;reuses the file's design system&lt;/strong&gt; instead of dropping flat rectangles. Real auto-layout, your text and color styles, your variables &lt;strong&gt;bound&lt;/strong&gt; to the right nodes, your components instantiated. Under the hood that one prompt fans out into real tool calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create_frame → set_auto_layout → create_text → apply_style_to_node
→ bind_variable_to_node → create_instance → resize_nodes → ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scaffold a whole screen, fix one component, or generate design-system assets — from a prompt or a chunk of code. Turn a React component into a Figma component. Recreate a landing page on the canvas. The symmetry is the magic: &lt;strong&gt;the same agent that implements your designs can also build them.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 3: "Why am I paying for a seat just to read my own file?"
&lt;/h2&gt;

&lt;p&gt;Figwright talks to Figma through a &lt;strong&gt;plugin&lt;/strong&gt;, so the free tier is enough — no Dev Mode seat, no paid tier. And it isn't married to one editor: any MCP-capable client works the same way.&lt;/p&gt;

&lt;p&gt;Here's the honest comparison with the official option:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Official Dev Mode MCP&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Figwright&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reads a design → code&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Writes back to the canvas&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;✅&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reuses &lt;em&gt;your&lt;/em&gt; components &amp;amp; tokens&lt;/td&gt;
&lt;td&gt;partial&lt;/td&gt;
&lt;td&gt;✅ provider-first&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works in any MCP client&lt;/td&gt;
&lt;td&gt;Dev Mode clients&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;paid Dev Mode seat&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;free&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The official Dev Mode MCP is genuinely good — but it's read-only and behind a paid seat. Figwright is the one that also &lt;strong&gt;writes back&lt;/strong&gt;, reuses your codebase, and runs for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stuff you only learn from real, messy files
&lt;/h2&gt;

&lt;p&gt;A demo is easy. Trusting a tool on a 2,000-layer client file is where it gets real — and a few scars shaped how Figwright works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Run two agents at once.&lt;/strong&gt; I keep Claude Code &lt;em&gt;and&lt;/em&gt; Cursor open. They used to fight over the plugin socket, so Figwright runs a &lt;strong&gt;leader/follower election&lt;/strong&gt;: one owns the connection, the others forward over HTTP, and if the leader quits a follower takes over — sub-second, no manual reconnect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Busy ≠ dead."&lt;/strong&gt; A big export would &lt;em&gt;look&lt;/em&gt; like a dropped connection — a heavy, synchronous step starved the heartbeat and the relay cut the line. Cranking the timeout up doesn't help; the heartbeat has to survive the work. Now it does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screenshots never come back empty.&lt;/strong&gt; I once exported a logo and got a 1×1 transparent pixel because it lived inside a clipped carousel. Figwright bypasses ancestor clipping, so a screenshot returns the real thing — not a blank.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary on the wire.&lt;/strong&gt; The plugin↔server protocol is &lt;strong&gt;msgpack&lt;/strong&gt;, not JSON — faster and smaller for the chunky payloads design data throws around.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of it is flashy. All of it is the difference between a demo and a tool you reach for on a deadline.&lt;/p&gt;

&lt;h2&gt;
  
  
  92 tools, three groups
&lt;/h2&gt;

&lt;p&gt;The count isn't the point — coverage is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read&lt;/strong&gt; — selection, document/node inspection, styles, variables, components, fonts, reactions, screenshots, even PDF export.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write&lt;/strong&gt; — create and edit frames, text, shapes, auto-layout, effects, styles, variables, components, pages, reactions… plus a &lt;code&gt;batch&lt;/code&gt; tool to apply many edits at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grounding&lt;/strong&gt; — &lt;code&gt;get_design_context&lt;/code&gt;, &lt;code&gt;component_map&lt;/code&gt;, &lt;code&gt;token_map&lt;/code&gt;, &lt;code&gt;icon_map&lt;/code&gt; — the join layer that ties Figma to your code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your MCP client lists every tool at connect time, so that's always the source of truth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Skills do the orchestrating
&lt;/h2&gt;

&lt;p&gt;Raw tools are low-level. Figwright ships two model-invoked &lt;strong&gt;skills&lt;/strong&gt; that encode the grounded workflows, so your agent reaches for the right tools at the right moment:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Skill&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;figma-codegen&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Turn a Figma selection into framework-aware code, grounded on your stack and components.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;figma-build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Build a Figma design from code or a description, reusing the file's existing system.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add awdr74100/figwright/skills
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick start
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Add the server&lt;/strong&gt; to your MCP client (&lt;code&gt;.mcp.json&lt;/code&gt; for Claude Code; other clients use the same shape):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"figwright"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@figwright/mcp@latest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Install the plugin&lt;/strong&gt; from the &lt;a href="https://github.com/awdr74100/figwright/releases/latest" rel="noopener noreferrer"&gt;latest GitHub release&lt;/a&gt;: unzip it, then in the Figma &lt;strong&gt;desktop app&lt;/strong&gt; → &lt;strong&gt;Plugins → Development → Import plugin from manifest…&lt;/strong&gt; and pick the &lt;code&gt;manifest.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Connect.&lt;/strong&gt; Open the plugin in Figma — it auto-connects and shows &lt;strong&gt;Connected&lt;/strong&gt;. Ask your agent to run &lt;code&gt;ping&lt;/code&gt; to confirm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Try it.&lt;/strong&gt; With a frame selected: &lt;em&gt;"Code this Figma selection as a React component."&lt;/em&gt; …or the other way: &lt;em&gt;"Build a pricing section in Figma from this spec."&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do I need Figma Dev Mode or a paid plan?&lt;/strong&gt;&lt;br&gt;
No. It's a plugin, so the free tier is enough — no Dev Mode seat, no paid tier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which agents work?&lt;/strong&gt;&lt;br&gt;
Anything that speaks MCP — Claude Code, Cursor, and other MCP clients all work the same way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can multiple agents use the same plugin?&lt;/strong&gt;&lt;br&gt;
Yes — leader/follower election shares one plugin across several servers, with a graceful handoff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it actually local?&lt;/strong&gt;&lt;br&gt;
Yes. The relay is &lt;code&gt;127.0.0.1&lt;/code&gt;-only; nothing leaves your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "Figwright"?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;figwright&lt;/code&gt; follows the old &lt;strong&gt;&lt;em&gt;-wright&lt;/em&gt;&lt;/strong&gt; tradition — a maker or craftsman. A &lt;strong&gt;playwright&lt;/strong&gt; writes plays, a &lt;strong&gt;shipwright&lt;/strong&gt; builds ships, a &lt;strong&gt;wheelwright&lt;/strong&gt; builds wheels. It's a nod to &lt;a href="https://playwright.dev" rel="noopener noreferrer"&gt;&lt;strong&gt;Playwright&lt;/strong&gt;&lt;/a&gt;, which automates the browser. Where Playwright drives the browser, &lt;strong&gt;Figwright&lt;/strong&gt; drives Figma — a maker of designs that both reads the canvas and crafts work back onto it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it — and tell me what breaks
&lt;/h2&gt;

&lt;p&gt;It's MIT-licensed, open to contributions, and already carries an &lt;strong&gt;A&lt;/strong&gt; quality score on &lt;a href="https://glama.ai/mcp/servers/awdr74100/figwright" rel="noopener noreferrer"&gt;Glama&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⭐ &lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/awdr74100/figwright" rel="noopener noreferrer"&gt;https://github.com/awdr74100/figwright&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;npm:&lt;/strong&gt; &lt;code&gt;@figwright/mcp&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I built Figwright because I was tired of AI tools that could only &lt;em&gt;look&lt;/em&gt; at my designs — and that handed me homework every time they did. If you've felt the same wall, give it a spin on a real file and tell me how the two-way loop holds up. Star the repo if it's useful, open an issue if it isn't, and I'd genuinely love to see what you build (or break).&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I built a Vite plugin to bring Nuxt-style middleware to Vue</title>
      <dc:creator>Roya</dc:creator>
      <pubDate>Sat, 09 May 2026 10:57:24 +0000</pubDate>
      <link>https://dev.to/roya_lan_c712e571a6d261e/i-built-a-vite-plugin-to-bring-nuxt-style-middleware-to-vue-2na7</link>
      <guid>https://dev.to/roya_lan_c712e571a6d261e/i-built-a-vite-plugin-to-bring-nuxt-style-middleware-to-vue-2na7</guid>
      <description>&lt;p&gt;Vue is great. Vite is great. Vue Router is great. But there's one area where the "bring your own solution" philosophy starts to show its cracks: &lt;strong&gt;navigation guards&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The moment your app needs more than a simple auth check — analytics, permission levels, feature flags, prefetching — you start piling logic into &lt;code&gt;beforeEach&lt;/code&gt; and hoping for the best.&lt;/p&gt;




&lt;h2&gt;
  
  
  What about the existing solutions?
&lt;/h2&gt;

&lt;p&gt;To be fair, there are some community approaches out there:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Roll your own middleware runner&lt;/strong&gt; — works, but you're reinventing the wheel every project, with no type safety&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;vue-router-middleware-plugin&lt;/strong&gt; — closest thing I found, but no TypeScript support for middleware names, no async context handling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Just use Nuxt&lt;/strong&gt; — valid option, but sometimes you really don't need the full SSR framework for a simple SPA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these fully scratched the itch, so I built &lt;a href="https://github.com/awdr74100/vite-plugin-vue-middleware" rel="noopener noreferrer"&gt;&lt;code&gt;vite-plugin-vue-middleware&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The goal was simple: &lt;strong&gt;make Vue SPA middleware feel as natural as Nuxt, without leaving the Vite ecosystem.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What started as a straightforward file-scanning plugin turned into something more interesting, especially when I ran headfirst into the &lt;strong&gt;async context problem&lt;/strong&gt; — more on that below.&lt;/p&gt;




&lt;h2&gt;
  
  
  What problems it solves
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Problem 1: Everything piles up in &lt;code&gt;beforeEach&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; Each middleware is its own file inside &lt;code&gt;src/middleware/&lt;/code&gt;. The plugin scans the directory automatically and wires everything up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/middleware/
├── 01.auth.global.ts     ← runs on every route, first
├── 02.log.global.ts      ← runs on every route, second
├── admin.ts              ← only runs when the route opts in
└── guest.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your router setup becomes a single line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;setupMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;virtual:vue-middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nf"&gt;setupMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. New middleware file = automatically picked up. Delete a file = gone. No manual registration, no imports to remember.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problem 2: No type safety for named middleware
&lt;/h3&gt;

&lt;p&gt;When you write middleware names as strings in &lt;code&gt;meta.middleware&lt;/code&gt;, there's no autocomplete, no error on typos — you only find out at runtime that &lt;code&gt;'auht'&lt;/code&gt; is not a valid middleware name. Classic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; The plugin auto-generates a &lt;code&gt;.d.ts&lt;/code&gt; that augments vue-router's &lt;code&gt;RouteMeta&lt;/code&gt;, so your middleware names are fully typed with IntelliSense.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;definePage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;guest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;// autocomplete works, typos caught at compile time&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Problem 3: &lt;code&gt;inject()&lt;/code&gt; silently breaks after &lt;code&gt;await&lt;/code&gt; — and TanStack Query will find this out for you
&lt;/h3&gt;

&lt;p&gt;This one caught me off guard. Vue's &lt;code&gt;inject()&lt;/code&gt; only works inside an active app context. In an async function, code after &lt;code&gt;await&lt;/code&gt; runs in a new microtask — Vue's context is already gone by then.&lt;/p&gt;

&lt;p&gt;Why does TanStack Vue Query come into this? Because &lt;code&gt;useQueryClient()&lt;/code&gt; calls &lt;code&gt;inject()&lt;/code&gt; under the hood. So if you ever try to do something like this in middleware:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ❌ looks fine, blows up at runtime&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;validateSession&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;queryClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQueryClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// inject() called outside of component setup 💥&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;queryClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prefetchQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userQueryOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get a cryptic error, scratch your head for 20 minutes, and eventually realize it's not TanStack's fault — it's the async context evaporating after &lt;code&gt;await&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; The plugin applies a &lt;strong&gt;build-time AST transform&lt;/strong&gt; that converts your async middleware into a generator-based executor. Each segment after an &lt;code&gt;await&lt;/code&gt; is re-entered via &lt;code&gt;app.runWithContext()&lt;/code&gt;, which restores the Vue injection context automatically.&lt;/p&gt;

&lt;p&gt;The transform is completely transparent — &lt;strong&gt;you keep writing normal async/await&lt;/strong&gt;, the plugin handles the rest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ✅ works — inject() (and useQueryClient) are available after every await&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;validateSession&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;queryClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQueryClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// works perfectly now&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;queryClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prefetchQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userQueryOptions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No manual changes needed on your end. Just write middleware like you normally would.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick start
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; vite-plugin-vue-middleware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// vite.config.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;vueMiddleware&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vite-plugin-vue-middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;vue&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;vueMiddleware&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/router/index.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;setupMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;virtual:vue-middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nf"&gt;setupMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/middleware/01.auth.global.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineMiddleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;virtual:vue-middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isLoggedIn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;checkAuth&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isLoggedIn&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Return values follow the same contract as vue-router navigation guards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;nothing returned → continue&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;return false&lt;/code&gt; → abort navigation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;return '/path'&lt;/code&gt; or &lt;code&gt;return { name: 'login' }&lt;/code&gt; → redirect&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  File naming conventions
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Filename&lt;/th&gt;
&lt;th&gt;Behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;auth.global.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs on every route navigation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;01.auth.global.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Global, numeric prefix controls execution order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;admin.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Only runs when &lt;code&gt;meta.middleware&lt;/code&gt; includes &lt;code&gt;'admin'&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Works with unplugin-vue-router
&lt;/h2&gt;

&lt;p&gt;If you're using file-based routing with &lt;a href="https://github.com/posva/unplugin-vue-router" rel="noopener noreferrer"&gt;unplugin-vue-router&lt;/a&gt;, you can declare middleware directly in your &lt;code&gt;.vue&lt;/code&gt; files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"ts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nf"&gt;definePage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;admin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Full type safety included.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/awdr74100/vite-plugin-vue-middleware" rel="noopener noreferrer"&gt;awdr74100/vite-plugin-vue-middleware&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm&lt;/strong&gt;: &lt;a href="https://www.npmjs.com/package/vite-plugin-vue-middleware" rel="noopener noreferrer"&gt;vite-plugin-vue-middleware&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you run into any issues or have feature ideas, issues and PRs are very welcome. Would love to hear if you've hit the async context problem too — curious how common it actually is.&lt;/p&gt;

&lt;p&gt;If this saves you some headache, a ⭐ on GitHub would mean a lot — it helps others find the project too!&lt;/p&gt;

</description>
      <category>vue</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
