Run the following command to create an Esmx project:
npm create esmx@latest my-appNote: Commands adapt to your package manager automatically. Examples below use npm format.
After running the command, you'll see a template selection prompt:
| Template | Description |
|---|---|
| shared-modules | Micro-Frontend shared module solution |
| 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 |
You can also specify a template directly using the -t or --template option to skip interactive selection:
npm create esmx@latest my-app --template vue-csrnpm create esmx@latest my-app --template vue-ssr --name my-project --forceAfter creating the project, go to the project directory and start the development server:
cd my-app
npm install
npm run devThe development server will start at http://localhost:3000.
Build the production version:
npm run build
npm run start>= 24.npm run dev configuration or adjust the port environment variable.The created project structure is as follows:
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 descriptionUse the --force or -f option to force overwrite an existing directory:
npm create esmx@latest my-app --forceUse the --name or -n option to specify the project name:
npm create esmx@latest my-app --name my-project