Skip to content

libt-web/react-ssr

Repository files navigation

egg-react-webpack-boilerplate

基于 Egg + React + Webpack3 单页面服务端渲染同构工程骨架项目

  • Egg 版本: ^2.x.x
  • Node 版本: Node ^8.x.x+
  • Webpack 版本: ^3.10.0, 对应 easywebpack-react 版本为 3.6.0
  • React 版本: ^15.0.0, ^16.0.0,

文档

特性

  • 基于 React 单页面服务端客户端同构实现

  • 支持服务端渲染 render 和纯前端渲染 renderClient

  • 支持 react-router, react-redux 服务端/客户端单页面渲染

  • Node 8 版本的 async 和 await 特性, Controller 采用 class 方式编写

依赖

工程化

使用

安装cli

npm install easywebpack-cli -g

安装依赖

npm install
npm start

启动应用

npm start

应用访问: http://127.0.0.1:7001

npm start启动

项目构建

// 直接运行(编译文件全部在内存里面,本地开发使用)
npm start

// 编译文件到磁盘打包使用(发布正式环境)
npm run build 或者 easywebpack build prod

License

MIT

About

React 服务端渲染

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published