-
构建vite项目
1)使用 NPM:
npm init @vitejs/app
切换目录, cd vite-project,
初始化npm install
运行 npm run dev
真香,毫秒级的就开启了你的第一个vite项目
2)使用 Yarn:
yarn create @vitejs/app
- 构建一个 Vite + Vue 项目,运行
npm 6.x
npm init @vitejs/app my-vue-app --template vue
npm 7+, 需要额外的双横线:
npm init @vitejs/app my-vue-app – --template vue
yarn
yarn create @vitejs/app my-vue-app --template vue
支持的模板预设包括:
- vanilla
- vue
- vue-ts
- react
- react-ts
- preact
- preact-ts
- lit-element
- lit-element-ts
查看模板 : https://github.com/vitejs/vite/tree/main/packages/create-app