$ gnpm install @gidc/vue2-mobile-project-template
.
├── config # 模块、代理、打包配置
├── dist # 打包之后的问天所在位置
│   ├── web # 打包后的web文件
│   └── zip # 对应模块的zip
├── public # 静态资源文件
└── src # 主资源
    ├── assets # 资源包
    ├── common # 公共依赖
    ├── components # 公共组件
    ├── config # 公共模块配置
    └── modules # 模块
        ├── demo # demo示例
        └── main # 主包,如无特殊需求,请勿修改
安装
npm install
# 或使用淘宝镜像 http://registry.npm.taobao.org
# npm install --registry=http://registry.npm.taobao.org
# cnpm install
运行
npm run serve
之后在浏览器地址栏中输入http://localhost:<port>/<模块名称>#/<路由名>即可访问
编译、打包
npm run build:all # 打包全部模块
npm run build -- [module] # 打包模块名称
增加模块
在config目录的modules.config.js中新增模块配置
/**
* 多模块入口配置
*/
const businessArray = [
 {
   /* 主包 */
   chunk: 'main',
   chunkName: '主包',
   template: 'src/modules/main/index.html'
 },
 {
   /* 子包demo */
   chunk: 'demo',
   chunkName: 'demo'
 }      
]
// ......
chunk: 模块id,唯一值,不可重复chunkName: 模块名称template: 静态资源index.html模版,若不设置则使用公共模版文件在src/modules下新增一个vue入口文件main.js和App.vue,具体可以参考demo模块,如下例为最基础vue入口配置
└── <modules name>
    ├── main.js
    └── App.vue
2020/05/18 v2.0.0 beta1
2020/07/18 v2.0.1
Copyright 2013 - present © cnpmjs.org | Home |