explaingit

farm-fe/farm

5,577RustAudience · developerComplexity · 3/5Setup · moderate

TLDR

A very fast web build tool written in Rust that bundles JavaScript, TypeScript, React, and Vue projects. Starts in milliseconds, applies code changes almost instantly, and is compatible with Vite plugins.

Mindmap

mindmap
  root((Farm))
    What It Does
      Web app bundling
      Dev server
      Production build
    Speed Features
      Rust core
      Lazy compilation
      Incremental builds
    Supports
      JavaScript
      TypeScript
      React and Vue
    Compared To
      Faster than Webpack
      Vite compatible
      Same dev and prod
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace Webpack in a large JavaScript project to get significantly faster development build startup times

USE CASE 2

Switch from Vite to Farm to eliminate dev-vs-production build inconsistencies while keeping existing Vite plugins

USE CASE 3

Start a new React or Vue project with Farm for millisecond startup and near-instant hot reloading

USE CASE 4

Use lazy compilation to only build the parts of a large app that are actively being used, cutting wait times

Tech stack

RustJavaScriptTypeScriptNode.js

Getting it running

Difficulty · moderate Time to first run · 30min

Install via npm/yarn/pnpm, no manual Rust compilation needed, requires Node.js 16+ on the host machine.

In plain English

Farm is a tool that builds web applications for the browser. When you write code in JavaScript, TypeScript, React, or Vue, a build tool takes all those files and packages them into the smaller, optimized files a browser can load. Farm does that job, and its main selling point is speed: it is written in Rust, a programming language known for performance, which lets it start projects in milliseconds and apply code changes almost instantly while you are working. The authors built Farm because they felt the popular tools already available had real weaknesses at scale. Webpack, which has been the standard for years, can be very slow on large codebases. Vite, a newer alternative, is faster during development but uses a different approach for the production build than for development, which can cause bugs that only appear when you ship. Farm uses the same approach in both environments, so what you see during development matches what goes to production. It also supports Vite plugins directly, meaning teams already using Vite can switch without throwing away their existing setup. Some of its other features include incremental building, which means it skips recompiling any file that has not changed since the last run, and lazy compilation, which means it only compiles parts of the code that are actually being used at any given moment. Both of these cut down waiting time on large projects. It also handles CSS, images, Sass, Less, and other common file types without needing extra configuration. Farm reached version 1.0 and is described as production-ready. The project is open source and has been used in enterprise projects according to the README. You can start a new project with a single command using npm, yarn, or pnpm.

Copy-paste prompts

Prompt 1
I have a large React and TypeScript project using Webpack that takes 30 seconds to start. Show me how to migrate it to Farm and what config changes I need to make.
Prompt 2
Create a new Vue 3 project using Farm from scratch. Walk me through the CLI commands and the resulting project structure.
Prompt 3
How does Farm's lazy compilation work, and how do I configure it to only compile routes the user is visiting in a large React app?
Prompt 4
I'm using Vite plugins in my project. Show me how to use those same plugins in Farm without rewriting them, and what the farm.config.ts file should look like.
Open on GitHub → Explain another repo

← farm-fe on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.