# react_project **Repository Path**: alanyf/react_project ## Basic Information - **Project Name**: react_project - **Description**: webpack配置的前端开发环境 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-08-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 此工程是用webpack配置的前端工程化项目,主要用来测试、存放一些新学的技术的demo,每当有新的积累就写进来 目前已有功能: 1. react-router 2. react-redux架构 3. fetch 代替ajax 进行前后端交互 4. 部署了简单的nodejs服务器,为某些功能提供node.js 后台的接口 运行npm 命令: 1. $ npm run dev //开启webpack 服务器进行前端开发 2. $ npm start //开启node.js 服务器,为某些功能提供后台接口 踩坑及问题描述: 1. root_path定义的问题、省略.js .jsx后缀名的问题: 解决方法: 在resolve中设置: resolve: { //自动扩展文件后缀名 //这里第一个""空字符串解决不省略后缀是正确识别文件 "extensions": ['', '.jsx', '.js', '.json', '.scss'], "alias": { "root_path": __dirname+'/src' } } 2. 跨浏览器,跨版本测试工具: For beginners like me to learn the concepts in [Redux](https://github.com/gaearon/redux) Can it be simpler? send a pull request To run this example: 1. `npm install` 2. `npm start` 3. open http://localhost:3000/ in the browser And also head over to http://gaearon.github.io/redux/ for some great documentation. There is also a [webpack](https://github.com/jackielii/simplest-redux-example/tree/webpack) and an [ES5](https://github.com/jackielii/simplest-redux-example/tree/es5) example.