Skip to main content

Shared Options

Configure shared options for Both Farm's DevServer and Compiler. Example:

Type:

root

  • default: process.cwd()

Configure the root directory for project compilation. All relative paths are relative to root during compilation.

clearScreen

  • default: true

Whether to clear the screen when start to compile the project.

envDir

  • default: <root>

Configuring the directory to load .env, .env.development, .env.production files. By default it's the same as root.

In above example, will load .env, .env.development, .env.production files from <root>/env directory.

envPrefix

  • default: ['FARM_', 'VITE_']

Env variables starts with envPrefix will be injected define automatically.

publicDir

  • default: public

Files under publicDir will always be treated as static assets. serve it in dev, and copy it to output.path when build.

For example, you can add static assets like font to public dir and using them as /xxx.ttf.

plugins

  • default: []

Configure Farm Plugins. See Using Farm Plugins

vitePlugins

  • default: []

Configure Vite/Rollup/Unplugin plugins. See Using Vite Plugins

Extremely Fast Web Build Tool Written in Rust

Copyright © 2024 Farm Community. Built with Docusaurus.