CLI and configuration for the evjs fullstack framework.
npm install -g @evjs/cliNo configuration file is needed. ev dev and ev build work out of the box with sensible defaults:
- Entry:
./src/main.tsx - HTML:
./index.html - Client dev server: port 3000
- API server (dev): port 3001
- Server functions auto-discovered via
"use server"directive
| Command | Description |
|---|---|
ev dev |
Start dev server (client HMR + API watch) |
ev build |
Production build (client + server) |
Scaffolding: Use
npx @evjs/create-appto scaffold a new project.
Uses webpack Node API directly (no temp config files):
- WebpackDevServer (port 3000) — client bundle with HMR.
- Node API Server (port 3001) — auto-starts when server bundle is emitted, uses
node --watch.
Runs webpack via Node API with NODE_ENV=production:
dist/client/— optimized client assets with content hashes.dist/server/main.[hash].js— server bundle (entry discovered viadist/server/manifest.json).
Create ev.config.ts in the project root (optional):
import { defineConfig } from "@evjs/ev";
export default defineConfig({
entry: "./src/main.tsx",
html: "./index.html",
dev: { port: 3000 },
server: {
endpoint: "/api/fn",
dev: { port: 3001 },
},
});The dev and server.dev fields accept extra options that are merged with defaults.
my-app/
├── ev.config.ts # optional config
├── index.html # HTML template
├── package.json
├── tsconfig.json
└── src/
├── main.tsx # app bootstrap (keep minimal)
├── routes.tsx # route tree + components
├── api/ # server functions
│ ├── users.server.ts
│ └── posts.server.ts
└── auth.ts
- Don't create
webpack.config.cjs— useev.config.tsinstead - Don't install webpack manually — it's a dependency of
@evjs/cli - Config file must be
ev.config.ts— notevjs.config.ts - Import
defineConfigfrom@evjs/ev— not from@evjs/server
Users do NOT need to install these — they're included in @evjs/cli:
webpack,webpack-dev-serverhtml-webpack-plugin,swc-loader,@swc/core@evjs/bundler-webpack,@evjs/build-tools