Skip to content

Commit

Permalink
merge core
Browse files Browse the repository at this point in the history
  • Loading branch information
easonyq committed Nov 22, 2017
1 parent 679c890 commit 65e0cef
Show file tree
Hide file tree
Showing 96 changed files with 6,749 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
"node": 4
}
}
]
],
"stage-2"
],
"plugins": [
"transform-runtime"
"transform-runtime",
"add-module-exports",
"dynamic-import-node"
]
}
3 changes: 3 additions & 0 deletions .fecsignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ coverage
node_modules
dist
bin
_old
core/build/templates
*.html
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ node_modules
dist
tmp
*-lock.json
core/lib
coverage
.nyc_output
core/test/fixtures/dist/
core/test/fixtures/.lavas/
27 changes: 27 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
lavas-core
===================

[![npm version](https://badge.fury.io/js/lavas-core.svg)](https://badge.fury.io/js/lavas-core)
[![Build Status](https://travis-ci.org/lavas-project/lavas-core.svg?branch=master)](https://travis-ci.org/lavas-project/lavas-core)

[![NPM](https://nodei.co/npm/lavas-core.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/lavas-core/)

Lavas 运行核心部分,执行以下步骤:
1. 读取配置,校验部分属性类型正确性
2. 根据文件结构和用户配置生成路由文件
3. 生成 manifest 和 bundle 文件,开发模式放在内存文件系统中
4. 开发模式下添加 webpack-dev-middleware 和 hot-middleware

开发模式下所有页面请求由服务端渲染。生产模式中针对配置了预渲染的页面,生成 html 并注入对应的 skeleton,这部分页面请求不经过服务端渲染,直接返回页面。

# 运行测试用例

koa 要求 Node 7+,所以测试用例也运行在这个版本之上
```bash
npm run test
```

# TODO

1. 生成嵌套路由 childRoutes
2. 中间件
Loading

0 comments on commit 65e0cef

Please sign in to comment.