This template should help get you started developing with Vue 3 in Vite.
You can use Vue directly from a CDN via a script tag: html
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
Install Node.js version 16.0 or higher
The below command will install and execute create-vue:
> npm init vue@latest
Once the project is created, follow the instructions to install dependencies and start the dev server:
> cd <your-project-name>
> npm install
> npm run dev
When you are ready to ship your app to production, run the following:
> npm run build
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
See Vite Configuration Reference.
npm install
npm run dev
npm run build
Hint: in index.js
const history = createWebHistory(import.meta.env.BASE_URL)
- Not correct {process.env.BASE_URL}
- Correct {import.meta.env.BASE_URL}
Setup
-
Create an account with vercel
-
Import your GitHub Repo (Make sure you don't have me50 account activated)
-
Create a file called
vercel.json
and dump this content in it
{"rewrites": [{ "source": "/:path*", "destination": "/index.html" }]}