umi-plugin-portal-plugin-monorepo-compile
assitBuild
Usage
Install via yarn or npm.
$ yarn add @whalecloud/portal-plugin-monorepo-compile@^0.2.11
Configure in .umirc.js
,
export default {
plugins: [
['@whalecloud/portal-plugin-monorepo-compile', {
type: 'mainSystem' // 默认值 mainSystem:主系统 subSystem:子系统
}],
],
}
0.1.4 更新日志
- 新增:增加
umi compile
命令,子系统可选择需要编译的模块(该功能需要传入type="subSystem")
使用方法
package.json 注册命令
export default {
plugins: [
['@whalecloud/portal-plugin-monorepo-compile', {
type: 'subSystem'
}],
],
}
{
"scripts": {
"compile": "umi compile"
}
}
$ yarn compile
0.1.7 更新日志
修复:开发环境下不会运行此插件逻辑;umi 2.6.0
之前不支持es7 async/await
注意升级
0.2.2 更新日志
- 新增: 增加主系统/子系统均可使用该插件:
- 主系统——管理
externals
,动态引入公共资源包 - 子系统——管理
externals
,动态选择需要构建的模块
0.2.3 更新日志
- 新增: 主系统头部引入
fdx.min.css
0.2.10 更新日志
- 新增: 完善
compile
脚本命令,快速指定编译模块和输出路径
0.2.11 更新日志
- 构建单个模块不再打包全局的model和样式,模块应当脱离于系统
package.json
{
"scripts": {
"compile": "umi compile --module userMgr --output build/dist"
}
}
-
module
: 编译目标的模块名 -
ouput
: 编译输出路径,string
类型 -
module
和ouput
为可选配置
以上案例中,运行compile
脚本会将userMgr
模块编译至build/dist
目录下
注意
type
传参决定插件的运行机制
-
type: "mainSystem"
插件会将react
,dva
等公共资源动态写入工程public/resources
目录下,将这部分资源externals
并用script
标签引入 -
type: "subSystem"
插件会注册compile
命令,决定工程构建结果
Options
TODO
LICENSE
MIT