what-framework-cli
v0.11.7
Published
What Framework CLI - Dev server, build, and deployment tools
Maintainers
Readme
what-framework-cli
CLI for What Framework. Provides a zero-config dev server with HMR, production builds with content hashing and gzip, preview server, and static site generation.
Install
npm install what-framework-cli --save-devOr use directly:
npx what-framework-cli devCommands
what dev
Start a development server with hot module reloading via WebSocket.
what dev
what dev --port 8080
what dev --host 0.0.0.0Features:
- WebSocket-based HMR with automatic reconnection
- Bare import transforms (
what-> framework modules) - File-based routing from
src/pages/ - SPA fallback for client-side routing
- Server action endpoint
what build
Create a production build with minification, content hashing, and gzip compression.
what buildOutput:
- Minified JS and HTML
- Content-hashed filenames for cache busting
- Gzipped copies of all JS files
manifest.jsonmapping original filenames to hashed versions- Bundled framework runtime
what preview
Preview a production build locally.
what preview
what preview --port 4000what generate
Static site generation. Runs a build, then pre-renders all pages.
what generatewhat init
Create a new project (prefer npx create-what for the full scaffolding experience).
what init my-appConfiguration
Create a what.config.js in your project root:
export default {
mode: 'hybrid', // 'static' | 'server' | 'client' | 'hybrid'
pagesDir: 'src/pages', // Pages directory for file-based routing
outDir: 'dist', // Build output directory
};Options
| Flag | Description | Default |
|---|---|---|
| --port | Server port | 3000 (dev), 4000 (preview) |
| --host | Server host | localhost |
Links
License
MIT
