Quick Start
If you are using version 2.0.0-nightly, please note the following:
-
The Farm team is working hard on version 2.0. We have refactored the entire Node backend and added many practical features. Please check our RoadMap for future updates.
-
This is a nightly build version that may contain new features and fixes that haven't been fully tested. As a result, unstable behavior or unexpected errors may occur.
-
Since this version is in the development phase, features and APIs may change in future versions. Please regularly check the changelog for the latest information.
-
We recommend against using this version in production environments unless you are prepared to handle potential issues.
If you encounter any problems, please feel free to create an Issue to provide feedback to us. Your feedback is crucial for improving Farm's functionality and stability. and we will continue to update the documentation in the coming days. Thank you for your understanding and support.
Farm needs Node 16.18.0 and above.
Online experience
Create a Farm Project
If you are using the nightly version, you need to install all Farm dependencies as nightly versions. We have provided nightly versions for all core packages and plugins. e.g:
You can also directly specify the project name and the template you want to use via additional command line options:
Template | Description | Optional Features |
---|---|---|
vanilla | Vanilla JavaScript | TypeScript |
react | react18 | TypeScript |
vue3 | vue3 | TypeScript |
vue2 | vue2 | TypeScript |
svelte | svelte | TypeScript |
solid | solid | TypeScript |
preact | preact | TypeScript |
lit | lit | TypeScript |
nestjs | nestjs | TypeScript |
tauri | tauri2 | TypeScript |
electron | electron | TypeScript |
2. Start the Project
Choose the package manager you like, install dependencies, then start the project. Then, start the project:
The project will start at
http://localhost:9000
by default.
3. Configuring the Project
The project is configured by farm.config.ts/js/mjs
file in the root directory of the project.
See Configuring Farm for details.
4. Building the project
Build the Farm project as production-ready static files:
The built product is downgraded to ES2017
by default, and the product will be compressed and Tree Shake. If you want to preview the build product locally, you can execute npm run preview
or npx farm preview
.
See Build For Production for details.
4. Preview the build products
Start preview server