Scaffold a new Preact app with Lighthouse-perfect performance defaults in one command, without manually configuring a bundler.
Convert an existing Preact CLI app to serve pages offline using the auto-generated service worker.
Add TypeScript to a Preact project by using the TypeScript template at project creation time.
Extend the build configuration with custom Webpack or Babel settings without ejecting the project setup.
Now in maintenance mode, new projects should use Vite with create-preact instead, existing apps remain stable.
Preact CLI is a command-line tool that scaffolds and builds web applications using Preact, a lightweight alternative to React. Its purpose is to give developers a fully configured project setup without manually wiring together a bundler, a development server, and deployment optimizations. You run one command with a template name and a project name, and you get a working application structure. The tool is now in maintenance mode and no longer receives active development. The README recommends using Vite with the create-preact tool for new projects instead. Preact CLI remains stable and usable for existing applications, but new feature work has stopped. When it was current, the standout features were strong defaults for performance. It aimed for a perfect score on Google Lighthouse, a tool that measures web page quality, right from the start without any manual tuning. It automatically splits code so that each page of your app only loads the JavaScript it needs rather than the entire application at once. It generates a service worker, which is a browser-level script that caches content so the app continues to work offline or on slow connections. It also pre-renders each route into static HTML before the JavaScript loads, so visitors see content immediately rather than a blank screen. The CLI has a handful of commands. The create command generates a new project from one of several official templates, covering standard setups, TypeScript, a single-file minimal version, a Netlify CMS integration, and an embeddable widget. The build command produces optimized files for deployment. The watch command starts a local development server with automatic reloading when you change files. A separate info command prints information about your local environment to help with debugging. Configuration can be extended without ejecting. You can provide custom Babel, Webpack, and browserslist configs alongside the project, and the tool picks them up. CSS preprocessors including Sass, Less, and Stylus are supported, and CSS Modules work without additional setup.
← preactjs on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.