Skip to content

Commit ce87464

Browse files
committed
small change
1 parent f2d8f5b commit ce87464

File tree

969 files changed

+11150
-10
lines changed

Some content is hidden

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

969 files changed

+11150
-10
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# README
22

3-
# 统一事项
3+
# 统一如下事项
44

5-
- 目前测试node.js: v10.15.1 --> 建议备注一下版本号
6-
- 尽量使用yarn安装 --> 不用因为更换了路径而重新安装依赖
7-
- 打包目录名统一为dist
8-
- 工程名格式统一
5+
- 测试node.js: v10.15.1 --> 建议备注一下版本号
6+
- 打包目录名为dist
7+
- 工程名格式
98

109
```
1110
构建工具v(webpack/gulp)
1211
+ js-framework(react/vue)
1312
+ UI/技术特点(antd/elementui)
1413
+ author
15-
(+ simple ) --> 尽量带UI示范,没有UI的加`simple`标识一下
14+
(+ simple ) --> 尽量带UI或场景示范,没有UI的加`simple`
15+
(+ old ) --> 技术栈太旧
1616
+ 应用场景(h5/pc/IE8?)
1717
+ mpa/spa
1818
```
@@ -27,6 +27,8 @@ npm run dev/serve/start
2727
npm run build/build:dist/dist
2828
```
2929

30+
- 尽量支持yarn安装 --> 这样不用因为更换了路径而重新安装依赖
31+
3032
# TODO
3133

3234
- 使用anujs + antd1 搭一个完善点的template
@@ -56,18 +58,19 @@ npm run build/build:dist/dist
5658
# 怀疑人生
5759

5860
```
59-
以下操作仅当遇到坑的时候考虑一下, 实在不确定😂
61+
以下操作仅当遇到坑的时候考虑一下
62+
实在不确定😂
6063
```
6164

6265
- 用nvm切换版本之后, 环境上也许并没有彻底切换过来 --> 重装nodejs
6366
- nodejs也许可以降到 v8.9.0 -> 可能webpack与node.js版本有关
6467
- yarn/npm/cnpm install 都试试看
6568

66-
- --> 大概率npm安装是没问题的
69+
- 大概率npm安装是没问题的
6770
- 不需要等安装命令彻底结束,可能就已经可以npm run dev了
68-
- --> 记得翻墙Proxy
71+
- 记得翻墙Proxy再安装
6972

70-
- 不要用IDEA的命令行按钮直接运行 -> 可能有坑
73+
- 不要用IDEA的命令行按钮直接运行 -> 可能有坑, IDEA运行时要选择node版本
7174

7275

7376

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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# web-react-ie8-antd-cool
2+
react已经完美的兼容了IE8 而且antd打包后也完美兼容IE8!!!!这个工程主要是针对多页面项目的!!不是单页面项目的.
3+
<br>
4+
参考了不同人的打包方式,自己针对项目整合修改了下,调试和打包都已经测试过正常的.
5+
<br>
6+
使用的是蚂蚁金服的打包工具,貌似也只能使用这个工具进行打包了.
7+
8+
```
9+
使用方法:
10+
1.clone包下到本地
11+
12+
2.npm install
13+
14+
3.调试:
15+
npm run dev
16+
使用8989的端口监听
17+
ie8是不支持热加载调试的,ie9以及现代浏览器都支持调试测试.
18+
19+
如果需要用ie8做调试的话,请使用:
20+
npm run ie
21+
同样使用8989的端口监听
22+
只是每次修改完代码后,需要手动刷新页面才能更新修改的内容.
23+
24+
4.打包:
25+
npm run build
26+
27+
打包的文件都在dist文件夹里.IE8下可以正常使用的.
28+
29+
如果使用正常并且喜欢的话给个star,如果有出错的话请issues
30+
```
31+
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"name": "web-react-ie8-antd-cool",
3+
"version": "1.0.0",
4+
"description": "react ie8 antd",
5+
"author": "ÁõÇì",
6+
"entry": {
7+
"index": "./src/page/index.js",
8+
"user": "./src/page/user.js"
9+
},
10+
"scripts": {
11+
"install:yarn": "yarn install",
12+
"remove": "rimraf node_modules",
13+
14+
"dev": "dora -p 8001 --plugins \"webpack?disableNpmInstall,hmr,proxy,livereload?enableJs=false&injectHost=127.0.0.1,browser-history?index=/src/page/index.html\"",
15+
"dev:ie": "dora -p 8001 --plugins \"webpack?disableNpmInstall,proxy,livereload?enableJs=false&injectHost=127.0.0.1,browser-history?index=/src/page/index.html\"",
16+
"build": "atool-build"
17+
},
18+
"dependencies": {
19+
"antd": "2.2.1",
20+
"atool-build": "^0.9.0",
21+
"babel-plugin-antd": "^0.4.1",
22+
"babel-runtime": "^6.6.1",
23+
"bce-sdk-js": "^0.1.8",
24+
"classnames": "^2.2.3",
25+
"console-polyfill": "^0.2.3",
26+
"echarts-for-react": "^1.1.5",
27+
"es3ify-loader": "^0.2.0",
28+
"es5-shim": "^4.5.9",
29+
"es6-promise": "^4.0.5",
30+
"fetch-detector": "^1.0.0",
31+
"fetch-ie8": "^1.4.0",
32+
"history": "^2.0.1",
33+
"immutable": "^3.8.1",
34+
"isomorphic-fetch": "^2.2.1",
35+
"js-cookie": "^2.1.1",
36+
"key-mirror": "^1.0.1",
37+
"lodash": "^4.13.1",
38+
"md5": "^2.1.0",
39+
"moment": "^2.15.2",
40+
"object-assign": "^4.0.1",
41+
"react": "0.14.x",
42+
"react-dom": "0.14.x",
43+
"react-redux": "^4.4.0",
44+
"react-router": "2.3.x",
45+
"react-router-redux": "^4.0.5",
46+
"redbox-react": "^1.3.2",
47+
"redux": "^3.3.1",
48+
"redux-immutable": "^3.0.8",
49+
"redux-logger": "^2.6.1",
50+
"redux-thunk": "^2.0.1",
51+
"reqwest": "^2.0.5"
52+
},
53+
"devDependencies": {
54+
"atool-build": "^0.9.0",
55+
"atool-test-mocha": "^0.1.4",
56+
"babel-core": "^6.4.0",
57+
"babel-eslint": "^6.0.0",
58+
"babel-loader": "~6.2.1",
59+
"babel-plugin-import": "^1.0.1",
60+
"babel-plugin-transform-runtime": "^6.8.0",
61+
"babel-polyfill": "^6.3.14",
62+
"babel-preset-es2015": "^6.3.13",
63+
"babel-preset-react": "^6.3.13",
64+
"babel-register": "^6.3.13",
65+
"bundle-loader": "^0.5.4",
66+
"chai": "^3.4.1",
67+
"copy-webpack-plugin": "^3.0.1",
68+
"cross-env": "^3.1.3",
69+
"dora": "0.4.x",
70+
"dora-plugin-browser-history": "0.2.x",
71+
"dora-plugin-hmr": "0.7.x",
72+
"dora-plugin-livereload": "0.5.x",
73+
"dora-plugin-proxy": "0.8.x",
74+
"dora-plugin-webpack": "0.8.1",
75+
"enzyme": "^1.2.0",
76+
"eslint": "^2.7.0",
77+
"eslint-config-airbnb": "6.x",
78+
"eslint-plugin-react": "4.x",
79+
"expect": "^1.20.1",
80+
"glob": "^7.0.3",
81+
"html-loader": "^0.4.4",
82+
"html-webpack-plugin": "^2.24.1",
83+
"jsdom": "^9.4.1",
84+
"karma": "^0.13.19",
85+
"karma-chai": "^0.1.0",
86+
"karma-mocha": "^0.2.1",
87+
"karma-phantomjs-launcher": "^0.2.3",
88+
"karma-sourcemap-loader": "^0.3.6",
89+
"karma-spec-reporter": "0.0.23",
90+
"karma-webpack": "^1.7.0",
91+
"markdown-loader": "^0.1.7",
92+
"mocha": "^2.3.4",
93+
"react-addons-test-utils": "^0.14.6",
94+
"sinon": "^1.17.2"
95+
}
96+
}
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+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* @Author: Marte
3+
* @Date: 2017-06-02 09:24:22
4+
* @Last Modified by: Marte
5+
* @Last Modified time: 2017-06-02 14:32:52
6+
*/
7+
const React = require('react');
8+
9+
export default class Header extends React.Component{
10+
render(){
11+
return(
12+
<div>
13+
<h1>头部在这里</h1>
14+
</div>
15+
)
16+
}
17+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
require('es5-shim');
2+
require('es5-shim/es5-sham');
3+
require('console-polyfill');
4+
require('fetch-ie8');
5+
6+
const React = require('react');
7+
const ReactDOM = require('react-dom');
8+
9+
import HeaderComp from '../components/header'
10+
11+
//antd全家桶的css
12+
import DatePicker from 'antd/lib/date-picker';
13+
import 'antd/dist/antd.css';
14+
15+
16+
function onChange(checked) {
17+
console.log(`switch to ${checked}`);
18+
}
19+
20+
21+
class App extends React.Component{
22+
render(){
23+
return(
24+
<div>
25+
<HeaderComp></HeaderComp>
26+
<DatePicker/>
27+
<h1>欢迎来到首页!!!</h1>
28+
<a href="./user.html">去用户页面</a>
29+
</div>
30+
)
31+
}
32+
}
33+
34+
35+
36+
ReactDOM.render(<App/>,document.getElementById('app'));
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+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<title>首页</title>
7+
<!--[if lt IE 10]>
8+
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
9+
<![endif]-->
10+
<link href="common.css" rel="stylesheet"></head>
11+
</head>
12+
<body>
13+
<div id="app"></div>
14+
<script type="text/javascript" src="common.js"></script>
15+
</body>
16+
</html>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require('es5-shim');
2+
require('es5-shim/es5-sham');
3+
require('console-polyfill');
4+
require('fetch-ie8');
5+
6+
const React = require('react');
7+
const ReactDOM = require('react-dom');
8+
9+
import HeaderComp from '../components/header'
10+
11+
//antd全家桶的css
12+
import { Slider } from 'antd';
13+
import DatePicker from 'antd/lib/date-picker';
14+
import 'antd/dist/antd.css';
15+
16+
17+
function onChange(checked) {
18+
console.log(`switch to ${checked}`);
19+
}
20+
21+
22+
class App extends React.Component{
23+
render(){
24+
return(
25+
<div>
26+
<HeaderComp></HeaderComp>
27+
<Slider defaultValue={30} />
28+
<DatePicker/>
29+
<h1>欢迎来到首页!!!</h1>
30+
<a href="./user.html">去用户页面</a>
31+
</div>
32+
)
33+
}
34+
}
35+
36+
37+
38+
ReactDOM.render(<App/>,document.getElementById('app'));
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+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<title>用户页面</title>
7+
<!--[if lt IE 10]>
8+
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
9+
<![endif]-->
10+
<link href="common.css" rel="stylesheet"></head>
11+
</head>
12+
<body>
13+
<div id="userPage"></div>
14+
<script type="text/javascript" src="common.js"></script>
15+
</body>
16+
</html>

0 commit comments

Comments
 (0)