Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 17b4c4b

Browse files
committed
update
1 parent 345a1ee commit 17b4c4b

File tree

6 files changed

+63
-12
lines changed

6 files changed

+63
-12
lines changed

‎README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,34 @@ React技术栈系列教程,涉及React、Redux、Babel、Webpack等相关技
4949
7. [在Webpack中使用环境变量](https://github.com/iSpring/babel-webpack-react-redux-tutorials/blob/master/tutorials/webpack-environment-variables/README.md)
5050
8. [Webpack中Chunk概念详解以及通过Webpack Code Splitting实现异步按需加载](https://github.com/iSpring/babel-webpack-react-redux-tutorials/tree/master/tutorials/webpack-code-splitting/README.md)
5151
9. 使用bundle-loader异步加载资源文件
52-
10. Webpack中使用CommonsChunkPlugin
53-
11. Webpack Dev Server
54-
12. Webpack Source Maps
52+
10. 使用webpack-md5-hash
53+
11. Webpack中使用CommonsChunkPlugin
54+
12. Webpack Dev Server
55+
13. Webpack Source Maps
5556

5657
- React
5758
1. JSX语法
5859
2. React组件
5960
3. React组件状态与生命周期
6061
4. React组件事件和ref
6162
5. Conditional Rendering
62-
6. 在React中使用classnames和CSS Module
63-
7. Route
63+
6. Lists and Keys
64+
7. 在React中使用classnames和CSS Module
6465
8. React Developer Tools
6566
9. Performance
66-
10. Animation
67-
11. PureRender
68-
12. Two-way Binding
69-
13. Test
67+
10. Context
68+
11. Animation
69+
12. PureRender
70+
13. Two-way Binding
71+
14. Test
72+
73+
- react-router
74+
1. react-router使用基础
75+
2. Route配置
76+
3. history
77+
4. location对象以及路由切换时的参数传递
78+
5. 通过Route向Component传递props
79+
6. 在react-router中使用代码分离实现动态路由
7080

7181
- Redux
7282
1. Redux使用基础
File renamed without changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "react-router-basic-use",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"reference": [
12+
"https://github.com/ReactTraining/react-router/blob/v3/docs/Introduction.md",
13+
"https://github.com/ReactTraining/react-router/blob/v3/docs/guides/RouteConfiguration.md"
14+
]
15+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
/buildOutput
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "webpack-bundle-loader",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"clear": "rimraf buildOutput",
8+
"prebuild": "npm run clear",
9+
"build": "webpack --progress --colors",
10+
"start": "npm run build"
11+
},
12+
"author": "",
13+
"license": "ISC",
14+
"devDependencies": {
15+
"babel-core": "^6.24.1",
16+
"babel-loader": "^6.4.1",
17+
"babel-preset-es2015": "^6.24.1",
18+
"rimraf": "^2.6.1",
19+
"webpack": "^1.14.0"
20+
},
21+
"reference": [
22+
"https://github.com/webpack-contrib/bundle-loader/blob/master/README.md"
23+
]
24+
}

‎tutorials/webpack-code-splitting/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ require.ensure(["./c.js", "./d.js", "./e.js"], function() {
204204
`require.ensure(dependencies, callback, chunkName)`方法中的`dependencies`可以保留空数组[],Webpack一样能智能地分析`callback`回调方法,从中找出`callback`回调中需要同步加载的资源文件并打包成normal chunck。
205205

206206
`require.ensure(dependencies, callback, chunkName)`方法最后有一个可选的`chunkName`参数,通过该参数可以给新生成的normal chunk设置chunk name,给其设置chunk name有两个好处:
207-
- 可以通过`output.chunkName`配置为`[name]`设置生成的normal chunk的文件名
207+
- 可以通过`output.chunkFilename`配置为`[name]`设置生成的normal chunk的文件名
208208
- 具有相同chunk name的多个normal chunk会合并为一个文件
209209

210210
修改`webpack.config.js`,配置如下所示:
@@ -255,7 +255,7 @@ require(["module-a", "module-b"], function(a, b) {
255255

256256
- multiple entry会产生多个entry chunk,需要通过`ouput.fileName`指定各个entry chunk的文件名,而且一般会使用`[id]``[name]`等设置`ouput.fileName`的值,这样使得不同的entry chunk具有不同的文件名。
257257

258-
- 如果使用Code Splitting创建了代码分离点,那么需要通过`output.chunkName`设置新生成的normal chunk文件名。
258+
- 如果使用Code Splitting创建了代码分离点,那么需要通过`output.chunkFilename`设置新生成的normal chunk文件名。
259259

260260

261261
3. normal chunk一般是被entry chunk在运行时动态加载的文件。
@@ -264,4 +264,4 @@ require(["module-a", "module-b"], function(a, b) {
264264

265265
- 通过代码`require.ensure([], function(...){})``require([amd1, amd2], function(amd1, amd2){})`可以设置代码的分离点(Code Splitting Point),Webpack会将其创建一个新的normal chunk。
266266

267-
- 生成的normal chunk的文件名可以通过`output.chunkName`设定,在代码分离点处我们可以传入一个chunk name以便在`output.chunkName`中使用`[name]`作为输出的文件名。
267+
- 生成的normal chunk的文件名可以通过`output.chunkFilename`设定,在代码分离点处我们可以传入一个chunk name以便在`output.chunkFilename`中使用`[name]`作为输出的文件名。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /