A simple opinionated Vue3 Starter Template with Vite.js
Fork of vitesome with more goodies. This template should help get you started developing with Vue 3 and Typescript in Vite in a bliss.
-
📲 PWA
-
🎨 Uno CSS - The instant on-demand Atomic CSS engine.
-
🔥 Use the new
<script setup>
syntax -
🔧 PostCSS with autoprefixer
-
📥 APIs auto importing - directly use Vue Composition API and others without importing
-
🦾 TypeScript, of course
-
⚙️ E2E Testing with Cypress on GitHub Actions
-
☁️ Deploy on Netlify, zero-config
This repo brings few things pre-packed, so you don't need to install them manually everytime.
- Uno CSS(https://github.com/antfu/unocss)
- PostCSS with plugins support
- Default Google Fonts with
vite-plugin-fonts
uno-iconify
Use any icon pack of your liking- Custom icons below
./assets/icons
with
@vueuse/head
- manipulate document head reactivelyunplugin-vue-components
- components auto importunplugin-auto-import
- Directly use Vue Composition API and others without importingvite-plugin-compress
- Compress your bundle + assets from Vitevite-plugin-vue-i18n
- Vite plugin for Vue I18nvite-plugin-pwa
- PWArollup-plugin-visualizer
- visualize and analyze your bundle to see which modules are taking up space.@rollup/plugin-strip
- remove debugger statements and functions like assert.equal and console.log from your codeVue I18n
- InternationalizationVue Router
Pinia
- Intuitive, type safe, light and flexible Store for Vue using the composition apiVueUse
- collection of useful composition APIs
- Use Composition API with
<script setup>
SFC syntax - ESLint with @antfu/eslint-config, single quotes, no sem
yarn
yarn dev
This will serve the app at http://localhost:4000
yarn build
Builds the app for production to the dist
folder.
It correctly bundles Vue in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Visit Netlify and select your repo, select OK along the way, and your App will be live in a minute. Visit Vercel and select your repo, select OK along the way, and your App will be live in a minute.
VSCode + Vetur. Make sure to enable vetur.experimental.templateInterpolationService
in settings!
<script setup>
is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use Volar instead of Vetur (and disable Vetur).
Since TypeScript cannot handle type information for .vue
imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue
imports (for example to get props validation when using manual h(...)
calls), you can use the following:
- Install and add
@vuedx/typescript-plugin-vue
to the plugins section intsconfig.json
- Delete
src/shims-vue.d.ts
as it is no longer needed to provide module info to Typescript - Open
src/main.ts
in VSCode - Open the VSCode command palette
- Search and run "Select TypeScript version" -> "Use workspace version"