Skip to main content
FarmFarm
Version: 1.x
On this page

Lit

Create a Lit project based on Farm.

Farm provides two approaches to support creating Lit projects:

  • Use the create-farm scaffold to create a scaffold project
  • You can manually create a Lit project following the current documentation

Creating a Lit Project

sh
npm create farm@latest
sh
yarn create farm@latest
sh
pnpm create farm@latest
sh
bun create farm@latest

Select Lit template in Select Framework

If you use lit then we need to configure the decorator

farm.config.ts
import { defineConfig } from '@farmfe/core';

export default defineConfig({
  compilation: {
    presetEnv: false,
    script: {
      plugins: [],
      target: 'es2022',
      parser: {
        tsConfig: {
          decorators: true,
          dts: false,
          noEarlyErrors: false,
          tsx: false
        }
      }
    }
  }
});

For more example details: React Example

100%

Drag or pinch to explore. Keyboard: + / − zoom, arrows pan, 0 resets, Esc closes.