farm-fe/farm

Rustfarmfe.org

Extremely fast Vite-compatible web build tool written in Rust

build-toolcompilerrusthmrfrontendfarmbundlertypescriptvite
Crecimiento de estrellas
Estrellas
5.6k
Forks
192
Crecimiento semanal
+-1
Issues
168
2k4k
nov 2022feb 2024may 2025sept 2026
Artefactoscrates.io
README

Extremely fast, Vite-compatible web build tool written in Rust

English | 简体中文

discord chat npm package node compatibility downloads license Gurubase



Intro

Farm is an extremely fast, Vite-compatible web build tool written in Rust. Designed to be fast, powerful, and consistent, it delivers the best web development experience — the real next-generation build tool.

Online experience

Edit Farm

Why Farm?

See Why Farm for details.

In short, tools like webpack are too slow, but new tools like Vite are not perfect, Vite has a lot of drawbacks when comes to a large project:

  • A huge number of requests during development:when there are hundreds or thousands modules per page, loading performance severely degraded, it may takes seconds or more when refresh the page.
  • Inconsistency between development and production: Using different strategy and tools in development and production, it's really inconsistent and it's hard to debug online issues.
  • Inflexible Code Splitting: It's hard to control the output of your bundles.

Farm can solve these problems perfectly, and it's really fast cause it's written in Rust. Farm aims to be fast, consistent, flexible, which is the real next generation build tool.

Features

[!NOTE]

  • Extremely Fast: Written in Rust, start a React / Vue project in milliseconds and perform an HMR update within 20ms for most situations.
  • Incremental Building: Support persistent cache, module level cache enabled by default, any module won't be compiled twice until it's changed!
  • 🧰 Fully Pluggable and Vite Compatible: Everything inside Farm is powered by plugins, Support Vite Plugins out of box. Supports Farm compilation plugins(both Rust and JavaScript plugins, and SWC plugins), Farm runtime plugins and Farm server plugin.
  • ⚙️ Powerful: Compiles JS/TS/JSX/TSX, CSS, CSS Modules, HTML, and static assets out of the box. Official compilation plugins for React, Vue, Sass, Less, PostCSS, and more.
  • ⏱️ Lazy Compilation: Dynamically imported resources are compiled only when requested, speed up compilation for large scale project. Just write a dynamic import and the imported module won't be compiled when it is executed.
  • 📦 Partial Bundling: Bundle your project into a few reasonable bundles automatically, speeding up resource loading without losing caching granularity. Refer to RFC-003 Partial Bundling for details.
  • 🔒 Consistency: What you see in development will be the same as what you get in production.
  • 🌳 Compatibility: Supports both legacy (ES5) and modern browsers.

Farm has implemented all features of a web build tool, including production optimization like tree shake and minification. It's now 1.0 stable. We have already migrated enterprise projects to Farm, and it works great!

See RFC-001 Architecture for design motivation and architecture.


Getting Started

Create a new Farm project with your favorite package manager:

# with npm
npm create farm@latest
# with yarn
yarn create farm@latest
# with pnpm
pnpm create farm@latest

Visit Farm Documentation to learn more about Farm.

Benchmark

Farm is much faster than similar tool, 20x faster than webpack and 10x faster than Vite in the benchmark:

benchmark

See Benchmark for details.

Contribution

See Contributing Guide.

Chat With Us


  • QQ group


Contributors




Contributors of farm-fe/farm New trends of farm-fe
Contributors of farm-fe/farm

Credits

Thanks to https://github.com/tmm who donated the farm npm package to the Farm team.

Thanks to projects:

  • The SWC project created by @kdy1, which powers Farm's code parsing, transformation and minification.

  • The NAPI-RS project created by @Brooooooklyn, which powers Farm's node-binding implementation.

  • The Rollup project created by @lukastaegert, which inspired Farm's plugin system implementation.

  • The Vite project created by Evan You, which inspired Farm's compatibility design of ecosystem.

Author & Maintainer

Author:

Maintainer:

Repositorios relacionados
vitejs/vite

Next generation frontend tooling. It's fast!

TypeScriptnpmlibraryMIT Licensevitehmr
vite.dev
82.8k8.7k
webpack/webpack

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

JavaScriptnpmlibraryMIT Licensewebpackjavascript
webpack.js.org
65.9k9.5k
parcel-bundler/parcel

The zero configuration build tool for the web. 📦🚀

JavaScriptnpmlibraryMIT Licensemodule-bundlerbuild-tool
parceljs.org
44k2.3k
vercel/turborepo

Build system optimized for JavaScript and TypeScript, written in Rust

Rustcrates.iolibraryMIT Licensemonorepojavascript
turborepo.dev
31.1k2.4k
nrwl/nx

The Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds, scales your CI, and fixes failed PRs automatically. Ship in half the time.

TypeScriptnpmcliMIT Licensenxangular
nx.dev
29.3k3k
gradle/gradle

Adaptable, fast automation for all

GroovylibraryApache License 2.0gradlebuild-tool
gradle.org
18.8k5.3k
go-task/task

A fast, cross-platform build tool inspired by Make, designed for modern workflows.

GoGo ModuleslibraryMIT Licensegomake
taskfile.dev
16.1k904
web-infra-dev/rspack

Fast Rust-based bundler for the web with a modernized webpack API 🦀

Rustcrates.iolibraryMIT Licensebundlerjavascript
rspack.rs
12.9k847
jetify-com/devbox

Instant, easy, and predictable development environments

GoGo ModuleslibraryApache License 2.0devboxdevelopment-environment
jetify.com/devbox/
12.3k358
xmake-io/xmake

🔥 A cross-platform build utility based on Lua

LualibraryApache License 2.0luabuild-tool
xmake.io
12.2k950
earthly/earthly

Super simple build framework with fast, repeatable builds and an instantly familiar syntax – like Dockerfile and Makefile had a baby.

GoGo ModuleslibraryMozilla Public License 2.0build-automationbuild
earthly.dev
12k457
wxt-dev/wxt

⚡ Next-gen Web Extension Framework

TypeScriptnpmlibraryMIT Licensebuild-tooldev-server
wxt.dev
10.5k562