@u-blog/frontend
v0.0.1
Published
vue3的ts项目模板
Readme
Template-Vue-TS
一个模板
🍔项目介绍
如果需要
husky、commintlint,请依次执行以下命令
pnpm run prepare
echo "npx lint-staged" > .husky/pre-commit --> v9
npx husky add .husky/pre-commit "npx lint-staged" --> v8如果需要
commitlint,请依次执行以下命令
pnpm add @commitlint/config-conventional @commitlint/cli -D
echo "npx --no -- commitlint --edit ${1}" > .husky/commit-msg --> v9
npx husky add .husky/commit-msg "npx --no -- commitlint --edit ${1}" --> v8- commitlint 配置文件:
commitlint.config.js
// more:https://github.com/angular/angular/blob/main/CONTRIBUTING.md
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'build', // 编译相关的修改,如发布版本,对项目构建或依赖的改动
'ci', // 对CI 配置文件和脚本的更改
'chore', // 构建过程或辅助工具的变动,比如增加依赖库等
'update', // 更新功能
'docs', // 文档变动 documentation
'feat', // 新增功能 feature
'fix', // 修复bug
'perf', // 性能优化 performance
'refactor', // 重构
'revert', // 撤回commit,回滚上一个版本
'style', // 格式(不影响代码运行的变动)
'test' // 测试(单元/集成测试)
]
],
'type-case': [0],
'type-empty': [0],
'scope-empty': [0],
'scope-case': [0],
'subject-full-stop': [0, 'never'],
'subject-case': [0, 'never'],
'header-max-length': [0, 'always', 100]
}
}🧀如何设置以及启动项目
安装依赖
pnpm install启动本地开发环境
pnpm start构建生产环境
pnpm run build:prod代码格式检查以及自动修复
pnpm run lint:fix🍚目录大纲
template-vue-ts
├─ public
│ ├─ logo.svg
│ └─ vite.svg
├─ src
│ ├─ App.vue
│ ├─ assets
│ │ ├─ icons
│ │ ├─ images
│ │ └─ styles
│ │ ├─ index.scss
│ │ ├─ reset.scss
│ │ └─ variables.scss
│ ├─ auto-import.d.ts
│ ├─ components
│ ├─ components.d.ts
│ ├─ directive
│ ├─ hooks
│ ├─ lang
│ ├─ main.ts
│ ├─ router
│ │ └─ index.ts
│ ├─ service
│ ├─ store
│ ├─ types
│ ├─ utils
│ └─ views
│ └─ HomeView.vue
├─ tests
├─ README.md
├─ .editorconfig
├─ .env.development
├─ .env.production
├─ .eslintrc-auto-import.json
├─ .eslintrc.cjs
├─ .eslintrcignore
├─ .gitignore
├─ .prettierignore
├─ .prettierrc
├─ env.d.ts
├─ index.html
├─ package.json
├─ pnpm-lock.yaml
├─ tsconfig.config.json
├─ tsconfig.json
└─ vite.config.ts
🚀浏览器支持
Modern browsers and Internet Explorer 10+.
| IE / Edge | Firefox | Chrome | Safari | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
