Code Monkey home page Code Monkey logo

reacttest's Introduction

react 脚手架

说明

  • 使用最新的react 16、react router4、mobx管理数据
  • 使用http-proxy-middleware 代理,解决前端跨域问题
  • 使用webpack.DllPlugin和webpack.DefinePlugin 来分离公共组件
  • 使用airbnb标准进行语法检查
  • 使用react-css-module管理css
  • 增加git钩子,git commit 时进行语法检查,语法检查不通过,commit将无法提交
  • 使用webpack-bundle-analyzer分析代码,代码大小看起来更直观

开始运行

1、克隆代码

git clone https://github.com/sq9950/reactTest.git

2、进入目录并安装依赖

cd reactTest && npm i

3、手动解压dist.zip

4、覆盖node_modules jimu-mobile 里的dist

cp dist node_modules/jimu-mobile/

5、启动服务

  npm start

6、编译代码

  npm run build

7、编译公共组件

  npm run buildlib

8、代码编译到dist后,可以快速启动一个静态服务器

  // 启动后,页面正常点击可以,但点击后路由跳转了,再点刷新,会有问题,这个待解
  npm run staticServer

./node_modules/.bin/static-server dist

请将dist.zip 解压 并替换 node_modules/jimu-mobile/dist 里面的所有文件

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.