npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-fable

v0.5.2

Published

Compile F# with Fable from inside Vite, so a .fs file is just another module Vite can import.

Readme

Vite plugin for Fable

NPM Version

[!IMPORTANT] This project is up for adoption. I'm looking for eager people to maintain this.Please open a discussion if you are interested!

Compile F# with Fable from inside Vite, so a .fs file is just another module Vite can import.

The usual setup puts Fable in front of your dev server (dotnet fable watch --run vite). This plugin does not. You run vite, and F# is compiled on demand and updated over HMR, the same way Vite treats TypeScript, JSX or Sass.

Requirements

  • The .NET 10 SDK on your PATH. Reading your .fsproj means asking MSBuild about it. Check with dotnet --version.
  • Vite 8 (peer dependency).

You do not need Fable as a dotnet tool. The compiler ships prebuilt inside the package, so there is no post-install step and installing with --ignore-scripts is fine.

Install

npm install -D vite-plugin-fable
bun install -D vite-plugin-fable

Getting started

Add the plugin to your Vite config:

// vite.config.js
import { defineConfig } from "vite";
import fable from "vite-plugin-fable";

export default defineConfig({
  plugins: [fable()],
});

The plugin compiles the single .fsproj next to your Vite config. If there is more than one, point at the one you want with fable({ fsproj: "./src/App.fsproj" }).

Import your F# entry point as a module:

<script type="module">
  import "/App.fs";
</script>

<script type="module" src="/App.fs"> does not work: Vite only resolves the .fs extension inside module resolution. See vitejs/vite#9981.

Now start Vite. The plugin stays quiet and prints one line per compile:

  VITE v8.2.2  ready in 376 ms

  ➜  Local:   http://localhost:5173/
  12:32:44 PM [vite] [fable] compiled App.fsproj in 1.53s

With React

The most common setup, using Fable.Core.JSX:

// vite.config.js
import { defineConfig } from "vite";
import fable from "vite-plugin-fable";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [fable({ jsx: "automatic" }), react({ include: /\.fs$/ })],
});

Two things to know about that line:

  • Order matters. fable goes before react.
  • The two options do different jobs. fable({ jsx }) is what turns Fable's JSX into JavaScript; Vite cannot do it for a .fs module. react({ include: /\.fs$/ }) is what makes .fs components Fast Refresh boundaries, so an edit updates in place instead of reloading the page.

Using Feliz.CompilerPlugins or plain Fable.React instead? Those emit classic-runtime React and need a different react() filter. The recipes page has both, plus the React Compiler.

Documentation

Video

I talked a little bit about this project during this stream:

vite-plugin-fable stream

License

Apache-2.0