Code Monkey home page Code Monkey logo

vite-vue3-template's Introduction

Vite + Vue3 + TypeScript + Element Plus + SASS + ESLint + Prettier + 支持 jsx 支持setup 语法糖

修改 Vite 配置文件

规范目录结构

├── publish/
└── src/
├── api/ // 接口文件
├── assets/ // 静态资源目录
├── common/ // 通用类库目录
├── components/ // 公共组件目录
├── router/ // 路由配置目录
├── store/ // 状态管理目录
├── style/ // 通用 CSS 目录
├── utils/ // 工具函数目录
├── views/ // 页面组件目录
├── App.vue
├── main.ts
├── shims-vue.d.ts
├── tests/ // 单元测试目录
├── index.html
├── tsconfig.json // TypeScript 配置文件
├── vite.config.ts // Vite 配置文件
└── package.json

集成 UI 框架 Element Plus

npm i sass -D 安装 sass

集成 EditorConfig 配置

EditorConfig 有助于为不同 IDE 编辑器上处理同一项目的多个开发人员维护一致的编码风格。

官网:editorconfig.org

在项目根目录下增加 .editorconfig 文件:

注意: VSCode 使用 EditorConfig 需要去插件市场下载插件 EditorConfig for VS Code 。 JetBrains 系列(WebStorm、IntelliJ IDEA 等)则不用额外安装插件,可直接使用 EditorConfig 配置。

集成 Prettier 配置

npm i prettier -D

配置 .prettierrc

注意: VSCode 编辑器使用 Prettier 配置需要下载插件 Prettier - Code formatter 。 JetBrains 系列编辑器(WebStorm、IntelliJ IDEA 等)则不用额外安装插件,可直接使用 Prettier 配置。

集成 ESLint 配置

VSCode 在 settings.json 设置文件中,增加以下代码: "editor.codeActionsOnSave": { "source.fixAll.eslint": true }

集成 husky 和 lint-staged

集成 Commitizen 实现规范提交 git cz 提交

单元测试 jest

技术栈

快速开始

安装依赖

npm install
# or
yarn add

启动项目

npm run dev

项目打包

npm run build

许可

MIT Copyright © 2021 RyanLYC

vite-vue3-template's People

Contributors

ryanlyc avatar

Stargazers

 avatar  avatar vtoo avatar

Watchers

 avatar

Forkers

ly-sniper

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.