Watch 3 Star 10 Fork 2

码云极速下载 / umiJavaScriptMIT

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库:
umi 是一个可插入式企业级 React 应用框架 spread retract

Clone or download 2.11 KB
Copy Edit Web IDE Raw Blame History


Notice: y is the alias for yarn, n is the alias for npm.

Set up

Install dev deps after git clone the repo.

$ y

Bootstrap every package with yarn. (Need to execute when new package is included)

$ y bootstrap

Link umi globally.

$ cd packages/umi
$ y link

Common Tasks

Monitor file changes and transform with babel.

$ y build --watch

Run test.

# Including e2e test
$ y test

# Unit test only
$ y debug .test.(t|j)s

# Test specified file and watch
$ y debug getMockData.test.js -w

# Test specified package
$ PACKAGE=umi-mock y debug

# Don't run e2e test
$ E2E=none y debug

# Generate coverage
$ y debug --coverage

Run umi dev in examples/func-test.

$ cd examples/func-test
$ umi dev

Then open http://localhost:8000/ in your browser.

Run umi build in examples/simple.

$ cd examples/func-test
$ umi build

# Build without compress
$ COMPRESS=none umi build

Publish to npm.

# Generator the changelog first.
$ y changelog

# Do not use yarn for this command.
$ n run publish

Debug doc in local.

$ y doc:dev

Deploy doc to

$ y doc:deploy

Debug umi ui in local.

# First, run umi dev --watch to start static dev server: http://localhost:8002/
$ y ui:build --watch

If the server starts on a different port, such as 8003 or 8004, this is because another process is currently running on port 8002.

It's a better idea to find the running process and kill it.

# Mac/Linux: 
$ lsof -i tcp:3000
# Find the ID of the process
$ kill <process id>

# Windows
$ netstat -ano | findstr :3000
# Find the ID of the process
$ taskkill /PID typeyourPIDhere /F


# Then run umi ui under a umi project.
$ LOCAL_DEBUG=1 umi ui

# if want to debug for more defail, using
$ LOCAL_DEBUG=1 DEBUG=umiui:UmiUI* umi ui

# Or Run `umi dev --ui` in examples/func-test.
$ umi dev --ui

PR rebase automatically using /rebase comment.


Comment ( 0 )

Sign in for post a comment


Help Search