Giter Site home page Giter Site logo

vite-ts-tailwind's Introduction

Vite Typescript + Tailwind Starter

Simple, opinionated, fully typed, and production-ready project template for Vite.

Editor screenshot

This template is practical and batteries included but not overly complex or bloated. Also explicit configuration over magic; it should be easy to understand how everything works, strip out anything you don't need, and fast to modify things to your needs.

Includes plenty of examples of how to do things but minimal cruft to delete to get you going.

A detailed changelog is available.

Features

  • Vue 3
  • Fully typed Vuex 4 store
  • Routing using vue-router 4
  • TypeScript 4.3
  • Tailwind CSS 2.2 w/ JIT compiler + following plugins preinstalled
    • @tailwindcss/aspect-ratio
    • @tailwindcss/line-clamp
    • @tailwindcss/typography
    • @tailwindcss/forms
    • firefox-variant
  • PostCSS 8 w/ postcss-nesting plugin
  • Eslint
  • Prettier
  • Alias @ to <project_root>/src
  • Manually configured global components in main.ts
  • Predefined global variables:
    • VITE_APP_VERSION is read from package.json version at build time
    • VITE_APP_BUILD_EPOCH is populated as new Date().getTime() at build time
  • Using newest script setup syntax w/ Ref sugar (see the official Script Setup documentation and Ref Sugar RFC discussion)
  • Cypress.io e2e tests (configured similarly to vue-cli)
  • GitHub workflows
    • Dependabot
    • Automated e2e tests
  • GitLab CI

Notes

  • In order to take full advance of the new script setup sugar and full TypeScript support in Vue SFC templates (like in the screenshot above), you should disable Vetur and use Volar instead. (This is totally optional but recommended as it results much better DX!) See official IDE Support documentation.
  • If you need more than one parameter in the typed Vuex actions, use payload object instead of multiple parameters. For example:
    [Action.updateItem](
      { commit }: AugmentedActionContext,
      payload: {
        id: string
        obj: Partial<MyItem>
      }
    ): Promise<void>

Project setup and usage

Install dependencies:

yarn

Run development server:

yarn dev

Open Cypress test runner:

yarn test

Run Cypress tests in headless mode:

yarn test:ci

Build and preview built site locally:

yarn preview

Build:

yarn build

Elsewhere

Contributing

Contributions are welcome! Please follow the code of conduct when interacting with others.

vite-ts-tailwind's People

Contributors

aoping avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.