Get Started

Create a Project

Run the following command to create an Esmx project:

npm
yarn
pnpm
bun
npm create esmx my-app

Choose a Template

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

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 a Template

You can directly specify a template via -t or --template and skip interactive selection:

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

Combined Parameters Example

npm create esmx my-app --template vue-ssr --name my-project --force

Start the Dev Server

After creation, enter the directory and start the dev server:

cd my-app
npm install
npm run dev

The dev server starts at http://localhost:3000.

Production Build

Build for production:

npm run build
npm run start

Troubleshooting

  • Node.js version should be >= 24.
  • If the port is in use, update npm run dev config or adjust the port env.
  • If installation fails, check proxy settings or use a domestic mirror source.

Project Structure

The generated project structure:

my-app/
├── src/
│   ├── app.vue
│   ├── create-app.ts
│   ├── entry.client.ts
│   ├── entry.node.ts
│   ├── entry.server.ts
│   └── components/
│       └── hello-world.vue
├── tsconfig.json
├── package.json
└── README.md

Advanced Options

Overwrite Existing Directory

Use --force or -f to overwrite an existing directory:

npm create esmx my-app --force

Set Project Name

Use --name or -n to set a project name:

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