Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lichess-org/lila/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Lichess client is built with TypeScript, Snabbdom (virtual DOM), and Sass. The UI is organized as a pnpm monorepo workspace with 30+ packages in theui/ directory.
Technology Stack
- TypeScript: Type-safe JavaScript
- Snabbdom: Lightweight virtual DOM library
- Sass: CSS preprocessing
- esbuild: Fast JavaScript bundler
- pnpm: Fast, disk-efficient package manager
UI Directory Structure
Workspace Structure
The UI is a pnpm monorepo defined in/pnpm-workspace.yaml:
ui/ has its own package.json describing:
- Source files
- Dependencies (internal and external)
- Build configuration
Internal Dependencies
Packages depend on each other using workspace references:Building the UI
Build Script
Theui/build script is the main entry point for building UI assets:
Watch Mode
Start the build system in watch mode to continuously rebuild on changes:Building Specific Packages
Build only specific packages:Production Build
Create an optimized production build:Clean Build
Remove build artifacts and rebuild:Package Configuration
Each package’spackage.json includes a custom build property describing how assets are generated.
Bundle Property
Defines JavaScript modules to create as entry points:src/analyse.tssrc/analyse.nvui.tssrc/analyse.study.ts
Bundle with Inline Scripts
For critical rendering path code:<script> tags to avoid FOUC (Flash of Unstyled Content).
Sync Property
Defines filesystem copies for assets:- Copying npm packages to
/public/npm - Linking local package versions during development
Hash Property
Defines assets to content-hash for CDN caching:/public/hashed/ with content-based filenames.
Import Resolution
TypeScript (tsc)
Usesexports in package.json for type checking:
esbuild
Uses only thesource value for bundling:
Development Workflow
Testing
Run UI tests with the test runner:Key Packages
lib
ui/lib/
Shared library code:
- Common utilities
- Chess engine interface
- WebSocket handling
- xhr helpers
common
ui/common/
Common UI components and helpers.
analyse
ui/analyse/
Analysis board interface:
- Move tree navigation
- Computer evaluation display
- Study interface
round
ui/round/
Live game interface:
- Move input
- Clock display
- Game controls (resign, draw, takeback)
puzzle
ui/puzzle/
Puzzle training interface:
- Puzzle presentation
- Solution verification
- Rating updates
site
ui/site/
Core site UI:
- Navigation
- User menu (dasher)
- Notifications
Working with Assets
Images and Fonts
Static assets go in/public/:
Stylesheets
Sass files in each package:Linked Packages
For development on external packages (e.g., chessground, pgn-viewer):Build System Internals
The build system source is inui/.build/:
Troubleshooting
Changes Not Appearing
- Check build output for errors
- Clear browser cache (hard refresh: Ctrl+Shift+R)
- Verify manifest was updated in
/public/compiled/
Build Errors
pnpm Issues
Node Version
Ensure Node.js v24.11.1+:Next Steps
- Learn about building the entire project
- Explore testing strategies
- Review the module structure

