/vue-template

Based on Vue3,including Vue Router、Vuex,Service Worker and Test

Primary LanguageVue

Vue 3 + Typescript 4 + Vue Cli 5 + Vue Router 4 + Vuex 4 Template

作者:Mr.Hope License

该项目为 Typescript 版 Vue 项目模板,同时添加了 vue router 和 vuex。

→ 点击前往

别名设置

  • @:src/

Linter 配置

项目风格预设基于 prettier。

初始化项目

yarn install

启动开发环境

yarn run serve

运行开发环境,可在浏览器通过 http://localhost:8080 直接访问。 使用 ctrl + c 组合键并输入 yenter 来终止开发环境

构建生产环境

执行构建,将构建成功的网页输出至 /dist 目录

  • 构建现代输出(ES5 标准支持,有 fallback)
yarn run build
  • 构建常规输出(ES5 标准支持,有 fallback)
yarn run normal:build

执行文件格式化修复

yarn run lint

分析打包文件

  • 分析现代构建打包

    yarn run analyze
  • 分析普通构建打包

    yarn run normal:analyze

查看浏览器支持

yarn run browser

输出 Webpack 模式打包配置

  • 输出现代构建打包配置至当前目录的 moderm.js

    yarn run inspect
  • 输出普通构建打包配置至当前目录的 normal.js

    yarn run normal:inspect

执行测试

# e2e test
yarn run test:e2e

# unit test
yarn run test:unit

自定义配置

查看 自定义配置.