Modern Vue
现代化的 Vue 技术栈 支持 Micro front end 和 Monorepo 🎉。
即刻享受令人愉悦的开发体验 😄。
特点
-
⚡️ 打包时进行压缩优化
-
⚡️ 上传静态资源至 OSS 以支持 CDN
-
🦾 通过 .env 文件进行环境隔离 轻松使用多套环境以应对开发和生产环境
-
🦾 使用
Rush搭建Monorepo -
🦾 使用
micro-app作为微前端方案 配合 monorepo 轻松接入多个不同技术栈的项目 -
🎨 支持
Commitlint以规范代码提交 -
🎨 使用 prettier 和 pretty-quick 进行代码自动格式化
-
🗂 基于文件结构的路由系统
-
📦 自动引入组件
-
📑 布局系统
-
📲 PWA
-
🎨 Windi CSS - next generation utility-first CSS framework
-
🌍 I18n
-
📥 APIs 自动引入 - use Composition API and others directly
-
🖨 服务端页面生成 (SSG) 通过 vite-ssg
-
🦔 规范的 CSS critters
-
🦾 全面支持 TypeScript
-
⚙️ 使用 [Vitest] 单元测试 (github.com/vitest-dev/…), E2E Testing with Cypress on GitHub Actions
Pre-packed
UI Frameworks
- Windi CSS (On-demand TailwindCSS) - lighter and faster, with a bunch of additional features!
Icons
- Iconify - use icons from any icon sets 🔍Icônes
unplugin-icons- icons as Vue components
Plugins
- Vue Router
vite-plugin-pages- file system based routingvite-plugin-vue-layouts- layouts for pages
- Pinia - Intuitive, type safe, light and flexible Store for Vue using the composition api
unplugin-vue-components- components auto importunplugin-auto-import- Directly use Vue Composition API and others without importingvite-plugin-pwa- PWAvite-plugin-windicss- Windi CSS Integrationvite-plugin-md- Markdown as components / components in Markdownmarkdown-it-prism- Prism for syntax highlightingprism-theme-vars- customizable Prism.js theme using CSS variables
- Vue I18n - Internationalization
vite-plugin-vue-i18n- Vite plugin for Vue I18n
- VueUse - collection of useful composition APIs
@vueuse/head- manipulate document head reactively
Coding Style
- Use Composition API with
<script setup>SFC syntax
Dev tools
- TypeScript
- Vitest - Unit testing powered by Vite
- Cypress - E2E testing
- pnpm - fast, disk space efficient package manager
vite-ssg- Server-side generation- critters - Critical CSS
- Netlify - zero-config deployment
- VS Code Extensions
- Vite - Fire up Vite server automatically
- Volar - Vue
3
<script setup>IDE support - Iconify IntelliSense - Icon inline display and autocomplete
- i18n Ally - All in one i18n support
- Windi CSS Intellisense - IDE support for Windi CSS
- ESLint
特别鸣谢
运行环境
Node >=14
GitHub Template
Create a repo from this template on GitHub.
如何使用
Development
安装 rush 工具链:
npm i -g pnpm typescript eslint@7 @microsoft/rush prettier
进入项目目录并使用 rushx 运行(代替 npm run) 然后浏览器访问 http://localhost:3333 :
cd apps/modern-vue
rushx dev
启动 react 项目:
cd apps/sub-react
rushx start
然后访问 http://localhost:3333/sub/react
打包
打包项目命令为:
cd apps/modern-vue
rushx build
使用 Env 环境:
rushx build:test