Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ckx-create-umi

chenkaixia11MIT0.12.3TypeScript support: included

Creates a UmiJS application using the command line.

readme

create-umi

Creates a UmiJS application/plugin/block/library using the command line.

Usage

$ yarn create umi [appName]

Boilerplates

  • ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block.
  • app - Create project with a simple boilerplate, support typescript.
  • block - Create a umi block.
  • library - Create a library with umi.
  • plugin - Create a umi plugin.

Usage Example

$ yarn create umi

? Select the boilerplate type (Use arrow keys)
  ant-design-pro  - Create project with an layout-only ant-design-pro boilerplate, use together with umi block.
❯ app             - Create project with a simple boilerplate, support typescript.
  block           - Create a umi block.
  library         - Create a library with umi.
  plugin          - Create a umi plugin.

? Do you want to use typescript? (y/N)

? What functionality do you want to enable? (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◯ antd
 ◯ dva
 ◯ code splitting
 ◯ dll

  create abc/package.json
  create abc/.gitignore
  create abc/.editorconfig
  create abc/.env
  create abc/.eslintrc
  create abc/.prettierignore
  create abc/.prettierrc
  create abc/.umirc.js
  create abc/mock/.gitkeep
  create abc/src/assets/yay.jpg
  create abc/src/global.css
  create abc/src/layouts/index.css
  create abc/src/layouts/index.tsx
  create abc/src/pages/index.css
  create abc/src/pages/index.tsx
  create abc/tsconfig.json
  create abc/typings.d.ts
 📋  Copied to clipboard, just use Ctrl+V
 ✨  File Generate Done

FAQ

yarn create umi command failed

这个问题基本上都是因为没有添加 yarn global module 的路径到 PATH 环境变量引起的。

先执行 yarn global bin 拿到路径,然后添加到 PATH 环境变量里。

$ yarn global bin
/usr/local/bin

你也可以尝试用 npm,

$ npm create umi

或者手动安装 create-umi,并执行他,

$ npm install create-umi -g
$ create-umi

LICENSE

MIT

changelog

The new CHNAGELOG will be updated on the Release page.

0.9.5 / 2019-01-14

  • enhance: add tests files (#32)

0.9.4 / 2019-01-14

  • fix: create with typescript (#31)
  • fix: 少了一个分号 (#30)

0.9.3 / 2019-01-13

  • yarn create umi时报错 (#29)

0.9.2 / 2019-01-12

  • fix: create-umi not found, Close #26, Close #27
  • fix: create-umi -v

0.9.1 / 2019-01-12

  • enable treeShaking by default

0.9.0 / 2019-01-12

  • refact: improve create-umi (#25)
    • 重构一遍,结构清晰一些
    • app 支持 TypeScript,Close #22, Close #17
    • app 添加 ESLint 校验、treeShaking 配置
    • 优化 ant-design-pro 仓库 clone 时间问题,Close #20
    • 优化选择界面的提示文案,Close #24

0.8.1 / 2019-01-05

  • fix: update umi-plugin-library to ^1.0.1-0