0.2.16 • Published 6 years ago
@whalecloud/portal-plugin-monorepo-compile v0.2.16
umi-plugin-portal-plugin-monorepo-compile
assitBuild
Usage
Install via yarn or npm.
$ yarn add @whalecloud/portal-plugin-monorepo-compile@^0.2.11Configure 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 compile0.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