Preact
Create a Preact project based on Farm.
Farm provides two approaches to support creating Preact projects:
- Use the
create-farmscaffold to create a scaffold project - You can manually create a
Preactproject following the current documentation
Creating a Preact Project
sh
npm create farm@latestsh
yarn create farm@latestsh
pnpm create farm@latestsh
bun create farm@latestSelect Preact template in Select Framework
farm.config.ts
import { defineConfig } from '@farmfe/core';
import Preact from "vite-plugin-preact";
export default defineConfig({
plugins: [Preact()],
});
If you want to start DevServer
sh
npm devsh
yarn devsh
pnpm devsh
bun devIf you need to run the build production environment product command
sh
npm buildsh
yarn buildsh
pnpm buildsh
bun buildIf you need to preview your build product
sh
npm previewsh
yarn previewsh
pnpm previewsh
bun previewFor more example details: Preact Example
Farm