Skip to content

Commit 404317b

Browse files
committed
small change
1 parent ce87464 commit 404317b

File tree

152 files changed

+141899
-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.

152 files changed

+141899
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"presets": [
3+
"env",
4+
"react",
5+
"stage-0"
6+
],
7+
"plugins": [
8+
"transform-runtime",
9+
[
10+
"import",
11+
{
12+
"libraryName": "antd"
13+
}
14+
]
15+
]
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es6: true,
6+
node: true,
7+
},
8+
extends: 'eslint:recommended',
9+
parserOptions: {
10+
sourceType: 'module',
11+
},
12+
rules: {
13+
'comma-dangle': ['error', 'always-multiline'],
14+
indent: ['error', 2],
15+
'linebreak-style': ['error', 'unix'],
16+
quotes: ['error', 'single'],
17+
semi: ['error', 'always'],
18+
'no-unused-vars': ['warn'],
19+
'no-console': 0,
20+
},
21+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#脚手架/React-AntDesign-Webpack-ie8前端开发平台
2+
## 相关技术
3+
* 技术栈:react react-dom react-router-dom AntDesign axios es6等
4+
* 支持ie8
5+
* 封装了一些企业前端开发常用组件,且通过脚本异步加载方式集成了webuploader/sockjs/echarts等流行组件
6+
* 开发环境 node || 构建工具 webpack1
7+
* 带有node_modules.zip,支持内网开发(右键-解压到当前文件夹)。
8+
* 支持开发环境,无刷新热更新,css抽取,代码压缩/混淆,gzip压缩,模块分片异步加载,url图片抽取,css模块化
9+
* 支持可视化模块打包分析,支持IDE源码断点调试(vscode,webstorm)
10+
* 推荐IDE: VsCode(免费好用) WebStorm(专业前端,收费 非常好用)
11+
* 演示地址:
12+
* https://youka2012.github.io/rawie8-demo
13+
14+
## 开发坏境启动
15+
`npm install`
16+
17+
* 如果不联网,可直接解压node_modules.zip
18+
19+
`npm start`
20+
21+
* 浏览器打开[http://localhost:8888](http://localhost:8888) 支持热更新
22+
23+
* 开发环境常用配置已经抽取在my-dev-config.js
24+
25+
## 生产坏境部署
26+
`npm run build`
27+
28+
* 拷贝dist文件夹内容至服务器即可,也可以通过gulp等自动化工具自动拷贝到相关路径
29+
30+
31+
## 说明
32+
33+
采用 `webpack`,`react``Ant Design` 等技术,兼容到浏览器 `IE8`
34+
* 项目初期参考了大神HeavenSky:https://github.com/HeavenSky/react-antd-ie8的分享的项目react-antd-ie8
35+
* 具体请见 `package.json`
36+
* 相关plugin如果报错,则尝试较低版本,注意不同版本的配置区别!!
37+
* 项目中涉及网络请求的地方已替换为模拟数据,网络请求的代码保留已在注释中。
38+
39+
## 相关资源
40+
41+
* react14: https://www.jianshu.com/p/a8bc5b292561
42+
* react ie8:https://blog.csdn.net/zjw0742/article/details/52981706
43+
* webpack 1.x:https://segmentfault.com/a/1190000008908550
44+
* react-router-dom:https://blog.csdn.net/mapbar_front/article/details/79605346
45+
* Ant Design 1.x:https://1x.ant.design/docs/react/getting-started
46+
* echarts:https://www.echartsjs.com/tutorial.html#5%20%E5%88%86%E9%92%9F%E4%B8%8A%E6%89%8B%20ECharts
47+
* webuploader:http://fex.baidu.com/webuploader/getting-started.html
48+
* sockjs:https://github.com/sockjs/sockjs-client
49+
50+
## 欢迎交流分享!!!
51+
52+
## VS Code调试配置
53+
先启动项目
54+
vscode中新建调试,lunch.json如下配置
55+
{
56+
"version": "0.2.0",
57+
"configurations": [
58+
{
59+
"type": "chrome",
60+
"request": "launch",
61+
"name": "Launch Chrome against localhost",
62+
"url": "http://localhost:8888",
63+
"webRoot": "${workspaceFolder}",
64+
"sourceMaps": true,
65+
"skipFiles": [
66+
"node_modules/**"
67+
],
68+
"sourceMapPathOverrides": {
69+
"webpack:///*": "${webRoot}/*"
70+
}
71+
},
72+
{
73+
"type":"chrome",
74+
"request": "attach",
75+
"name":"attach to chrome",
76+
"port":9222,
77+
"webRoot": "${workspaceFolder}",
78+
"sourceMaps": true
79+
}
80+
]
81+
}
82+
83+
## WebStorm 调试配置
84+
85+
先启动项目
86+
新建右上角JavaScript Debug
87+
URL填http://localhost:8888/ (开发环境server地址)
88+
下方列表中src对应的remote url设置为webpack:///src
89+
点击调试按钮即可
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
debugIE:false,//是否在开发环境进行ie8调试
3+
devPort:8888,//开发环境服务器端口
4+
//反向代理配置
5+
proxyConfig: {
6+
"/api/*": {
7+
target: "http://localhost:8989",
8+
secure: false,
9+
changeOrigin: false,
10+
},
11+
"/druid": {
12+
target: "http://localhost:8989",
13+
secure: false,
14+
changeOrigin: false,
15+
},
16+
},
17+
chunkStats:false,//是否生成打包分析文件,供上传分析网站 http://webpack.github.io/analyse/可视化分析项目模块
18+
bundleAnalyzerPlugin:false//是否在9998端口输出模块分析可视化界面
19+
};

0 commit comments

Comments
 (0)