Quick Start

Environment Setup

Before getting started, you need to install Node.js with version >= 20. We recommend using Node.js 20 LTS version.

You can check your current Node.js version with:

node -v

If Node.js is not installed or the version is too low, you can use nvm or fnm to install the required version.

Here's an example of installing Node.js 20 LTS with nvm:

# Install Node.js 20 LTS version
nvm install 20 --lts

# Set Node.js 20 as default
nvm alias default 20

# Switch to Node.js 20
nvm use 20

Create EMP Project

You can use create-emp to initialize an EMP project by running:

npm
yarn
pnpm
bun
npm create emp@latest

Follow the prompts to proceed. You can choose from these templates provided by create-emp:

Template Description Features
react React 18 TypeScript
vue3 Vue 3 TypeScript
vue2 Vue 2 TypeScript

CLI Tools

The EMP CLI includes a lightweight command line tool with commands like dev and build.

package.json
{
  "scripts": {
    // Start development server
    "dev": "emp dev",
    // Build for production
    "build": "emp build",
    // Preview production build locally
    "start": "emp serve",
    // Bundle size analysis
    "stat": "emp build --analyze",
  }
}

Refer to [CLI Tools] for all available commands and options.

Entry Module

By default, EMP CLI uses src/index.(js|ts|jsx|tsx) as the entry module. You can modify the entry module using the [entry] configuration option.