Vite - Vue 2 starter template using composition-api and windiCSS

Overview

Vite - Vue 2 starter template

This starter template will help you to easily create a Vue2 application bundled by the lightning fast build tool called Vite. Besides Vite this template also provides:

  • Typescript support
  • Vue Router
  • Vue Composition-API
  • VueUse
  • WindiCSS (TailwindCSS) + Dark Mode

📦 Vite plugins

🚀 Getting started

  1. Install dependencies
    npm install
  2. Start dev server
    npm run dev
  3. Visit the page
    http://localhost:8080
Comments
  • build: remove `vue-router` auto import type & upgrade deps

    build: remove `vue-router` auto import type & upgrade deps

    Updates

    • degrade @vueuse/core to 5.x

      From v6.0, VueUse requires vue >= v3.2 or @vue/composition-api >= v1.1

      refs: https://vueuse.org/guide/

    • remove vue-router auto import in vite.config.js

      It will auto import useRoute & useRouter, but it doesn't exist in [email protected]

    • refresh yarn.lock & auto-imports.d.ts

    opened by yuler 5
  • The class of the container that wraps the Feature component is not set correctly

    The class of the container that wraps the Feature component is not set correctly

    In the Commits on Mar 27, 2021(7c3c055600d5c43156ae720f0add52a62398791e)

    Incorrect spacing between Feature components ( Features.vue ).

          <div class="w-full py-4 pr-4 xs:pl-4 md:w-1/2 lg:w-1/4">
            <Feature
              title="vite-plugin-vue2"
              text="Vue 2 support for Vite"
              url="https://github.com/underfin/vite-plugin-vue2"
            />
          </div>
          <div class="w-full p-4 md:w-1/2 lg:w-1/4">
            <Feature
              title="vite-plugin-components"
              text="On demand components auto importing for Vite"
              url="https://github.com/antfu/vite-plugin-components"
            />
          </div>
    

    I don't know if the author did it on purpose.

    I guess I should write it this way——

          <div class="w-full py-4 px-2 xs:pr-4 md:w-1/2 lg:w-1/4">
            <Feature
              title="vite-plugin-vue2"
              text="Vue 2 support for Vite"
              url="https://github.com/underfin/vite-plugin-vue2"
            />
          </div>
          <div class="w-full py-4 px-2 xs:pr-4 md:w-1/2 lg:w-1/4">
            <Feature
              title="vite-plugin-components"
              text="On demand components auto importing for Vite"
              url="https://github.com/antfu/vite-plugin-components"
            />
          </div>
    
    opened by AllenHUSH 3
  • I wannt to change it to multi-page app,but get 404 .

    I wannt to change it to multi-page app,but get 404 .

    my vite config according vite docs

    import path from 'path'
    import { defineConfig } from 'vite'
    import { createVuePlugin as Vue2 } from 'vite-plugin-vue2'
    import WindiCSS from 'vite-plugin-windicss'
    import Components from 'unplugin-vue-components/vite'
    import Icons from 'unplugin-icons/vite'
    import IconsResolver from 'unplugin-icons/resolver'
    import ScriptSetup from 'unplugin-vue2-script-setup/vite'
    import AutoImport from 'unplugin-auto-import/vite'
    
    const root = path.resolve(__dirname, 'src')
    const outDir = path.resolve(__dirname, 'dist')
    
    const config = defineConfig({
      // root,
      resolve: {
        alias: {
          '@': `${path.resolve(__dirname, 'src')}`,
        },
        dedupe: ['vue-demi'],
      },
    
      build: {
        // outDir,
        minify: true,
        rollupOptions: {
          input: {
            main: path.resolve(__dirname, 'index.html'),
            about: path.resolve(__dirname, 'about', 'index.html'),
          },
        },
      },
    
      plugins: [
        Vue2(),
        ScriptSetup(),
        WindiCSS(),
        Components({
          resolvers: [
            IconsResolver({
              componentPrefix: '',
            }),
          ],
          dts: 'src/components.d.ts',
        }),
        Icons(),
        AutoImport({
          imports: ['@vue/composition-api', 'vue-router', '@vueuse/core'],
          dts: 'src/auto-imports.d.ts',
        }),
      ],
    
      server: {
        port: 3333,
      },
    })
    
    export default config
    

    image

    open about path :http://localhost:3333/about it is 404.

    How can i fix it?

    opened by jackchoumine 2
  • Missing dependencies: vue-demi (using pnpm)

    Missing dependencies: vue-demi (using pnpm)

    Dear @lstoeferle, I've tried to run your project locally but gets into problem.

    Here are the steps of what I've done:

    • git clone lstoeferle/vite-vue2-windicss-starter
    • pnpm install
    • pnpm run dev

    Here are the error:

    > [email protected] dev E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter
    > vite
    
    error when starting dev server:
    Error: The following dependencies are imported but could not be resolved:
    
      vue-demi (imported by E:/Data/Projects/testing/vue-test/vite-vue2-windicss-starter/src/main.ts)
    
    Are they installed?
        at optimizeDeps (E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-00e79b84.js:67615:15)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
        at async runOptimize (E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-00e79b84.js:68170:48)
        at async Server.httpServer.listen (E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-00e79b84.js:68184:17)
     ERROR  Command failed with exit code 1.
    

    Looks like vue-demi is missing from package.json.

    Regards,

    Martinus

    opened by martinussuherman 2
  • vue 2.7 support

    vue 2.7 support

    Things that still needs to be addressed

    1. resolving aliases when importing assets -> should be fixed with the newest vite plugin ✅
    2. Some unplugin plugins rely on vue-template-compiler while vue 2.7 removed this dependency. But i guess they will be updated on 2.7 is out
    3. vue composition api auto imports
    opened by herrmannplatz 1
  • feat: use vite-plugin-icons

    feat: use vite-plugin-icons

    I have updated vite-plugin-icons to support Vue 2. Both vite-plugin-icons and vite-plugin-components now detect the Vue version automatically, no configure needed.

    vite-plugin-pages and vite-plugin-md also support Vue 2 now. If you'd like, I can set them up in another PR.

    opened by antfu 1
  • feat: live demo

    feat: live demo

    This PR introduces a refactored README which includes a link to the deployed live demo. In addition, there are several small refactorings in code.

    Closes #2

    opened by lstoeferle 0
  • Live demo

    Live demo

    Hi @lstoeferle, I pulled it down and get it running. I'd say I am really impressed by the template layouts and the code structure. I think it will be great for people to have a quick preview of it if you can deploy it as a live demo. 👍

    opened by antfu 0
Owner
Software engineer loving CloudNative and with a growing heart for open source
null
Vue3 + Vite + WindiCSS (Tailwind) Boilerplate for quick starting your Vue3 app with full support for tailwind

Use this boilerplate to quickly start your Vue3 project with WindiCSS (TailwindCSS), using vite as the build tool. Run the development server git clon

Hasin Hayder 9 Aug 2, 2022
A lightweight Nuxt template to write a Markdown driven website, based on Nuxt Content, WindiCSS and Iconify.

A lightweight Nuxt template to write a Markdown driven website, based on Nuxt Content, WindiCSS and Iconify.

null 3 May 30, 2022
⚡️Vite Vue, Pinia, vite-ssg, Typescript, eslint,stylelint starter template

A development template for vue3 + vue-router + pinia + typescript + vite-ssg

猴貓 1 Nov 26, 2022
Nuxt 3 template with Vuetify 3 & WindiCSS

Nuxt 3 template with Vuetify 3 & WindiCSS

thegears 4 Jul 29, 2022
Elucidator blog starter - a starter blog built with Vuejs 3, Vite, and Typescript

Elucidator blog starter Blog starter build with Vue 3 + Vite + Typescript

Elucidator Project 30 Nov 8, 2022
Vue template for starter using Vue3 + TypeScript + Vite + Pinia 🚀

Vue TypeScript Starter This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup>

Yuga Sun 30 Dec 24, 2022
Nuxt3-awesome-starter - A Nuxt 3 starter template or boilerplate with a lot of useful features. Nuxt3 + Tailwindcss 3

Nuxt 3 Awesome Starter a Nuxt 3 starter template or boilerplate with a lot of us

Alfian Dwi Nugraha 663 Jan 2, 2023
A blog application with nuxt3, windicss, nuxt-content

A blog application with nuxt3, windicss, nuxt-content

eggp 3 Aug 16, 2022
Vue 3 starter template: Vite / Vue 3 / Tailwind CSS / PNPM

Vue.js starter template Features: ?? Vue 3 ⚡️ Vite ?? PNPM ?? Vue Router ?? Tailwind CSS ?? Eslint with airbnb and stylelint ?? Light and dark mode co

Léonard Lecouey 44 Jan 2, 2023
Vue-typescript-starter-project - Vue3, Vuex, Vue-router starter project using typescript

Vue Typescript Starter Project Project setup npm install Compiles and hot-reloads for development npm run serve Compiles and minifies for production

paalan 0 Jan 1, 2022
:star: A Vite 2.x + Vue 3.x + TypeScript template starter

Vite2.x + Vue3.x + TypeScript Starter 在线预览 https://vite-vue3-starter.xpoet.cn

指间的诗意 415 Dec 28, 2022
🐬 A Starter template built on Vite 2.x + Vue 3.x + Typescript

vite-ts-starter ?? A Starter template built on Vite 2.x + Vue 3.x + Typescript. Live demo: Vite TS Starter Environment Support Vue 3.x Node >= 14.18.x

Wisdom 20 Dec 14, 2022
Vite + Vue Starter Template

Vite-lite 特性 ⚡️ Vue 3, Vite 3, pnpm, ESBuild - 就是快! ?? 使用 Pinia 的状态管理 ?? 使用Element-Plus UI 组件库 ?? UnoCSS - 高性能且极具灵活性的即时原子化 CSS 引擎 ?? 各种图标集为你所用 ?? 使用 新

xzl 10 Dec 15, 2022
🏕 Opinionated Vite Starter Template

?? Opinionated Vite Starter Template

Anthony Fu 6.6k Jan 3, 2023
A simple opinionated Vue3 Starter Template with Vite.js

Logo created with Windcss logo + Icons made by Vectors Market & Pixel perfect from www.flaticon.com Vitesome ?? ⛵️ A simple opinionated Vue3 Starter T

Alvaro Saburido 160 Jan 4, 2023
Anthony Fu 1.7k Jan 4, 2023
VUE 3 Starter project for using primevue 3 with Vite 2 - Pages, Layouts

Vite Typescript + PrimeVue Starter Build your VUE.js App with the latest and fastest VITE Plugins (nuxt.js like). First Class PrimeVUE support. THX to

Tom 58 Dec 14, 2022
Template creates with Vite that includes a Vue 3 app template with routes and store. Regarding css we use Tailwind CSS

Template creates with Vite that includes a Vue 3 app template with routes and store. Regarding css we use Tailwind CSS

Marco 4 Aug 3, 2022
Vue 3 eshop project with Pinia, Composition API

eshop Vue 3 eshop project with Pinia, Composition API Recommended IDE Setup VSCode + Volar (and disable Vetur). Type Support for .vue Imports in TS Si

Maksim Ivanov 1 Dec 15, 2022