1.2.6 • Published 3 years ago

vue-cli-plugin-tq-tpl v1.2.6

Weekly downloads
9
License
ISC
Repository
-
Last release
3 years ago

vue-cli-plugin-tq-tpl

banner

配合 @vue/cli 3.0 通过插件快速生成前端项目模版.

注意事项:

  • 终端运行 vue config 查看 useTaobaoRegistrypackageManager 信息
    • useTaobaoRegistrytrue,则运行 vue config -s useTaobaoRegistry false 设置成 false
    • 查看 packageManager 值为 yarn 还是 npm,并分别执行下面两个步骤,切换镜像源
  • 若用 npm 安装依赖,则需将 npm 的镜像源设置成 http://223.4.69.11:4873/
    • 可安装 nrm 设置、切换镜像源
  • 若用 yarn 安装依赖,则需将 yarn 的镜像源设置成 http://223.4.69.11:4873/
    • 运行指令 yarn config set registry http://223.4.69.11:4873/

目录

使用

安装插件

$ vue add tq-tpl

安装依赖

$ npm install

vue add tq-tpl 后会默认执行了 npm install 进行依赖安装

分支说明

  • master 主分支
  • dev 开发分支
  • releate/addTemplate 新增后端管理模板分支(可删)
  • dev-second-phase v1.2.0升级分支
  • dev-mtpl 新增云图模板分支

指令

normal/screen

  • npm run serve 启动本地服务
  • npm run build 构建打包

framework

  • npm run serve 启动本地服务
  • npm run framework 构建打包基座项目

本地开发模式下,可以访问/dev路由,进入子应用本地联调模式

module

  • npm run serve 启动本地服务
  • npm run module 构建打包子应用项目
  • npm run dev:module 启动本联调模式

本地开发模式下,可以访问/dev路由,进入子应用本地联调模式

template-env

  • npm run serve 启动本地服务
  • npm run preview 构建打包模版项目

template-env 类型的项目推荐在push到仓库后带入构建好的资源,方便支持预览相关功能,因此该模式下的项目也不推荐做的厚重

其他

注入环境变量

 $ npm run [build/framework/module] -- --app_env='{"DNS_CODE": "test"}'

是否启用 external (默认为 true)

  $ npm run module -- --external=false

默认抽离配置项:

conf.externals({
  'vue-router': 'VueRouter',
  'vuex': 'Vuex',
  'vuex-persistedstate': 'VuexPersistedstate',
  'vuex-router-sync': 'VuexRouterSync',
  '@ourea/fetch': 'vFetch',
  ...EXTERNAL_OPTIONS,cd 
})

根据devServerproxy配置生成nginx.conf

 $ npm run build -- --port=8181 --root=/home/8181/mnt/dist

注意: v1.1.16 版本前的依赖, devServerproxy必填项

指令对应的环境变量

 $ npm run build // NODE_ENV: production
 $ npm run framework // NODE_ENV: framework
 $ npm run module // NODE_ENV: module

调试方式:

安装本地插件

版本更新说明

v1.1.16

  • dev:module指令新增端口检测功能,默认为3000,可同时启动多个子应用
  • 子应用中 baseUrl 端口号 3000 改成 控制台 输出可用的端口号。
    process.env.NODE_ENV === 'development' && http.setOption({
      conf: {
        baseUrl: 'http://localhost:3000/api',
      },
    })
    v1.1.17
  • framework 模版 build 指令走自定义 build 指令

v1.2.0

  • 新增 husky lint-stagedgit commit 前校验 eslint
  • 修改 dev:module 的环境变量由 development 修改为 dev-module

Husky hooks skipped mac上使用sourceTree提交代码不会走husky自定义的钩子

v1.2.1

  • 新增 数据可视化大屏基线子项目 模版
1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.2

3 years ago

1.2.0-beta.5

4 years ago

1.1.17-beta.2

4 years ago

1.1.15

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago