Run the following command to create an Esmx project:
npm create esmx@latest my-appNote: The command will automatically adapt to the package manager you are using; the following examples use the npm format.
After running the command, you will see the template selection interface:
| Template | Description |
|---|---|
| shared-modules | For creating micro-frontend modules shared across projects |
| vue-csr | Vue 3 Client-Side Rendering |
| vue-ssr | Vue 3 Server-Side Rendering |
| vue2-csr | Vue 2.7 Client-Side Rendering |
| vue2-ssr | Vue 2.7 Server-Side Rendering |
This scaffolding tool supports specifying templates or configuring projects directly through command-line arguments to skip interactive selection.
You can also specify a template directly with the -t or --template option to skip the interactive selection:
npm create esmx@latest my-app --template vue-csrUse the --name or -n option to specify the project name:
npm create esmx@latest my-app --name my-projectUse the --force or -f option to force overwrite an existing directory:
npm create esmx@latest my-app --forceYou can combine multiple options:
npm create esmx@latest my-app --template vue-ssr --name my-project --forceAfter creating the project, enter the directory and start the development server:
cd my-app
npm install
npm run devThe development server will start at http://localhost:3000.
To build for production:
npm run build
npm run start>= 24.npm run dev configuration or set a different port via an environment variable.The created project has the following structure:
my-app/
├── src/ # Source code
│ ├── app.vue # Application component
│ ├── create-app.ts # Application 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