@whalecloud/portal-plugin-monorepo-compile

0.2.16 • Public • Published

umi-plugin-portal-plugin-monorepo-compile

NPM version NPM downloads

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类型
  • moduleouput为可选配置

以上案例中,运行compile脚本会将userMgr模块编译至build/dist目录下

注意

type传参决定插件的运行机制

  • type: "mainSystem" 插件会将react,dva等公共资源动态写入工程public/resources目录下,将这部分资源externals并用script标签引入

  • type: "subSystem" 插件会注册compile命令,决定工程构建结果

Options

TODO

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @whalecloud/portal-plugin-monorepo-compile

Weekly Downloads

13

Version

0.2.16

License

MIT

Unpacked Size

20.2 kB

Total Files

8

Last publish

Collaborators

  • whalecloud-developer