Vue + Fleek Starter Kit Template

Fleek Support
Fleek Support
  • Updated




πŸ’» GitHub Repo

You can find the template here.

πŸš€ Project Structure

Inside of your Vue project, you'll see the following folders and files:

β”œβ”€β”€ public/
β”‚   └── favicon.svg
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ router/
β”‚   β”œβ”€β”€ views/
β”‚   β”œβ”€β”€ App.vue
β”‚   └── main.ts
β”œβ”€β”€ index.html
β”œβ”€β”€ env.d.ts
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ vite.config.ts
└── package.json

If you want to lern more about vue you can checkout the official Vue Documentation.

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
pnpm install Installs dependencies
pnpm run dev Starts local dev server at localhost:5173
pnpm run build Build your production site to ./dist/
pnpm run preview Preview your build locally, before deploying
pnpm run build-only Build your production site without running typechecks
pnpm run type-check Run the typecheck

⚑ How to deploy to Fleek

1. Create a fleek.json config file:

You can configure this site deployment using Fleek CLI and running:

 > fleek sites init
   WARN! Fleek CLI is in beta phase, use it under your own responsibility
   ? Choose one of the existing sites or create a new one. β€Ί 
   ❯ Create a new site

It will prompt you for a namedist directory location & build command

  • name: How you want to name the site
  • dist: The output directory where the site is located, for this template it's dist
  • build command: Command to build your site, this will be used to deploy the latest version either by CLI or Github Actions

2. Deploy the site

After configuiring your fleek.json file, you can deployt the site by running

fleek sites deploy

After running it you will get an output like this:

 WARN! Fleek CLI is in beta, use it at your own discretion
 > Success! Deployed!
 > Site IPFS CID: Qmbv2NT91iPkXaoim5CSwdR8MLEoquRPcsdZncZ5QaxAqn

 > You can visit through the gateway:

Extra features

Keep in mind:

This template has been configured to produce a static output.

// vite.config.ts

import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'

export default defineConfig({
  plugins: [vue(), vueJsx()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
  base: './',

This means that assets will be pre-fixed with ./, you can learn more about it in Vite Documentation

To avoid routing issues when we deploy our site to IPFS, we'll use Hash routing

import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
      path: '/',
      name: 'home',
      component: HomeView
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')

export default router

πŸ‘€ Want to learn more?

Feel free to check Fleek Documentation & Vue Documentation.

Was this article helpful?



Article is closed for comments.