← All tools

@farmfe/cli

Popularity 65 Updated Development & Build

CLI of Farm

npmauto-collected

Installation

npm
npm install -g @farmfe/cli

Install with npm.

<div align="center" <a href="https://github.com/farm-fe/farm" <img src="./assets/logo.png" width="550" / </a <h3Extremely fast, Vite-compatible web build tool written in Rust</h3 <p <spanEnglish</span | <a href="https://github.com/farm-fe/farm/blob/main/README.zh-CN.md"简体中文</a </p <p align="center" <a href="https://discord.gg/mDErq9aFnF" <img src="https://img.shields.io/badge/chat-discord-blueviolet?style=flat&logo=discord&colorA=ffe3f5&colorB=711a5f" alt="discord chat" / </a <a href="https://twitter.com/FarmFe71928" <img src="https://img.shields.io/twitter/url.svg?label=@fefarm&style=social&url=https://twitter.com/FarmFe71928"/ </a <a href="https://npmjs.com/package/@farmfe/core"<img src="https://img.shields.io/npm/v/@farmfe/core.svg?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="npm package"</a <a href="https://nodejs.org/en/about/releases/"<img src="https://img.shields.io/node/v/@farmfe/core.svg?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="node compatibility"</a <a href="https://npmcharts.com/compare/@farmfe/core?minimal=true" <img src="https://img.shields.io/npm/dm/@farmfe/core.svg?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="downloads" / </a <a href="https://github.com/farm-fe/farm/blob/main/LICENSE" <img src="https://img.shields.io/npm/l/@farmfe/core?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="license" / </a <a href="https://gurubase.io/g/farm" <img src="https://img.shields.io/badge/Gurubase-Ask%20Farm%20Guru-711a5f?style=flat-square&labelColor=ffe3f5" alt="Gurubase" / </a </p <br/ </div

---

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

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] - Since Farm v0.13, Vite plugins can be used directly in Farm. Refer to Using vite plugins in Farm - Since Farm v0.14, persistent disk cache enabled by default. Refer to Incremental Building - Now Farm is 1.0 stable and production ready!. See Farm official website to get started.

  • ⚡ 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.

<br/

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.

<br/