Skip to content

Commit ee1871f

Browse files
committed
small change
1 parent 404317b commit ee1871f

File tree

1,752 files changed

+103246
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,752 files changed

+103246
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["es2015", "react", "stage-0"],
3+
"plugins": [
4+
"add-module-exports",
5+
],
6+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
node_modules
3+
npm-debug.log
4+
dist
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
##redux+react+热加载+兼容IE8
2+
3+
redux + react + webpack-hot-middleware + support IE8
4+
5+
###使用
6+
```
7+
//安装依赖
8+
npm install
9+
//run
10+
npm start
11+
//build
12+
npm run build
13+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello iVan</title>
5+
<!--[if lt IE 10]>
6+
<script src="./shim/shim.js"></script>
7+
<![endif]-->
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<!--use in webpack development mode-->
12+
<script src="/static/bundle.js"></script>
13+
<!--use in webpack production mode-->
14+
<!-- <script src="./dist/bundle.js"></script> -->
15+
</body>
16+
</html>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "redux-react-supportIE8-template",
3+
"version": "1.0.0",
4+
"description": "react-redux work in IE8",
5+
"main": "./src/index.js",
6+
"scripts": {
7+
"install:cnpm": "cnpm install",
8+
"install": "npm install",
9+
"remove": "rimraf node_modules",
10+
11+
"start": "node server.js",
12+
"dev": "npm run start",
13+
"build:webpack": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js",
14+
"build": "npm run build:webpack",
15+
"test": "echo \"Error: no test specified\" && exit 1"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/zhoulijie/react-redux-support-ie8.git"
20+
},
21+
"author": "iVan <jiestyle21@gmail.com>",
22+
"license": "MIT",
23+
"dependencies": {
24+
"eventsource-polyfill": "^0.9.6",
25+
"fetch-ie8": "^1.4.0",
26+
"object-assign": "^4.0.1",
27+
"react": "^0.14.3",
28+
"react-dom": "^0.14.3",
29+
"react-redux": "^4.4.0",
30+
"redux": "^3.3.1",
31+
"redux-logger": "^2.6.1",
32+
"redux-thunk": "^2.0.1"
33+
},
34+
"devDependencies": {
35+
"babel-loader": "^6.2.0",
36+
"babel-plugin-add-module-exports": "^0.1.2",
37+
"babel-preset-es2015": "^6.3.13",
38+
"babel-preset-react": "^6.3.13",
39+
"babel-preset-stage-0": "^6.3.13",
40+
"es3ify-loader": "^0.1.0",
41+
"express": "^4.13.3",
42+
"cross-env": "^1.0.6",
43+
"webpack": "^1.12.9",
44+
"webpack-dev-middleware": "^1.4.0",
45+
"webpack-hot-middleware": "^2.6.0"
46+
}
47+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var path = require('path');
2+
var express = require('express');
3+
var webpack = require('webpack');
4+
var config = require('./webpack.config');
5+
6+
var app = express();
7+
var compiler = webpack(config);
8+
9+
app.use(express.static(path.join(__dirname, '/')))
10+
//use in webpack development mode
11+
app.use(require('webpack-dev-middleware')(compiler, {
12+
noInfo: true,
13+
publicPath: config.output.publicPath
14+
}));
15+
app.use(require('webpack-hot-middleware')(compiler));
16+
17+
//use in webpack production mode
18+
//app.use(express.static(__dirname));
19+
20+
app.get('/', function(req, res) {
21+
res.sendFile(path.join(__dirname, 'index.html'));
22+
});
23+
24+
app.listen(3000, 'localhost', function(err) {
25+
if (err) {
26+
console.log(err);
27+
return;
28+
}
29+
30+
console.log('Listening at http://localhost:3000');
31+
});

__cant-run-now-help/webpack1-react14-redux-simple-old-zhoulijie-ie8-spa/shim/shim.js

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as types from '../constants/actionTypes'
2+
3+
export function addTodo(text) {
4+
return { type: types.ADD_TODO, text }
5+
}
6+
7+
export function completeTodo(id) {
8+
return { type: types.COMPLETE_TODO, id }
9+
}
10+
11+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React,{Component} from 'react';
2+
import TodoItem from '../components/TodoItem';
3+
4+
5+
export default class Content extends Component{
6+
render(){
7+
const {todos,actions} = this.props;
8+
return (
9+
<div>
10+
<ul>{todos.map(todo =>
11+
<TodoItem key={todo.id} todo={todo} {...actions} />
12+
)}</ul>
13+
</div>
14+
);
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React,{Component} from 'react';
2+
3+
// export default class Footer extends Component{
4+
export default class Footer extends Component{
5+
render(){
6+
return (
7+
<div>
8+
<a href="#">all</a>{' '}
9+
<a href="#">active</a>{' '}
10+
<a href="#">completed</a>{' '}
11+
</div>
12+
);
13+
}
14+
}
15+
16+
module.exports = Footer;

0 commit comments

Comments
 (0)