Quick Start

Create Project

Run the following command to create an Esmx project:

npm
yarn
pnpm
bun
npm create esmx my-app

Select Template

After running the command, you will see the template selection interface:

Available Templates

TemplateDescription
shared-modulesMicro frontend shared modules solution
vue-csrVue 3 Client-Side Rendering
vue-ssrVue 3 Server-Side Rendering
vue2-csrVue 2.7 Client-Side Rendering
vue2-ssrVue 2.7 Server-Side Rendering

Specify Template

You can also directly specify a template using the -t or --template option to skip the interactive selection:

npm create esmx my-app --template vue-csr

Start Development Server

After creating the project, navigate to the directory and start the development server:

cd my-app
npm install
npm run dev

The development server will start at http://localhost:3000.

Production Build

Build the production version:

npm run build
npm run start

Project Structure

The created project structure is as follows:

my-app/
├── src/                            # Source code
│   ├── app.vue                     # App component
│   ├── create-app.ts               # App creation function
│   ├── entry.client.ts             # Client entry
│   ├── entry.node.ts               # Development server entry
│   ├── entry.server.ts             # Server-side rendering entry
│   └── components/                 # Components directory
│       └── hello-world.vue
├── tsconfig.json                   # TypeScript configuration
├── package.json                    # Project dependencies and scripts
└── README.md                       # Project description

Advanced Options

Override Existing Directory

Use the --force or -f option to force override an existing directory:

npm create esmx my-app --force

Specify Project Name

Use the --name or -n option to specify the project name:

npm create esmx my-app --name my-project