SILKROAD

This template should help get you started developing with Vue 3 in Vite.

Setup

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

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Compile and Minify for Production

npm run build

Hint: in index.js

  const history = createWebHistory(import.meta.env.BASE_URL)
  1. Not correct {process.env.BASE_URL}
  2. Correct {import.meta.env.BASE_URL}

Vercel

Setup

  1. Create an account with vercel

  2. Import your GitHub Repo (Make sure you don't have me50 account activated)

  3. Create a file called vercel.json and dump this content in it

{"rewrites": [{ "source": "/:path*", "destination": "/index.html" }]}