Skip to content

Commit 26d8f93

Browse files
merge master
2 parents 4f33f8a + 92ec0c5 commit 26d8f93

File tree

14 files changed

+754
-934
lines changed

14 files changed

+754
-934
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ node_js:
88
script:
99
- bash ./scripts/deploy.sh
1010
sudo: required
11-
cache: yarn
1211
install:
1312
- npm i yarn -g
1413
- yarn

components/notification-bar/notification-bar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default class NotificationBar extends React.Component {
1111
<div className={ `notification-bar ${dismissedMod}` }>
1212
<Container className="notification-bar__inner">
1313
<p>
14-
赞助 webpack,同时获取官方衣服!访问 <a href="https://webpack.threadless.com">webpack 官方商店!</a>&nbsp; 所有收益都转到 webpack 的 <a href="https://opencollective.com/webpack">Open Collective 页面!</a>
14+
赞助 webpack,同时获取官方衣服!访问 <a href="https://webpack.threadless.com">webpack 官方商店!</a>&nbsp; 查看所有收益请转到 webpack 的 <a href="https://opencollective.com/webpack">Open Collective 页面!</a>
1515
</p>
1616
<p>
1717
webpack 2 已经发布!阅读<a href="https://medium.com/webpack/webpack-2-and-beyond-40520af9067f#.ojp0x5ls1">公告</a>&nbsp;并且现在就<a href="/guides/installation">安装它</a>&nbsp;!
@@ -46,4 +46,4 @@ export default class NotificationBar extends React.Component {
4646

4747
} else return false;
4848
}
49-
}
49+
}

components/organization/projects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
"repo": "webpack/i18n-webpack-plugin",
257257
"npm": "i18n-webpack-plugin",
258258
"description": "Embed localization into your bundle.",
259-
"maintainer": "EcutDavid"
259+
"maintainer": ""
260260
},
261261
{
262262
"repo": "webpack/json5-loader",

content/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ webpack.js index=./src/index.js index2=./src/index2.js --output-path='./dist' --
175175

176176
| 参数 | 说明 | 使用方法 |
177177
|--------------------|---------------------------|-----------------------------|
178-
| --module-bind | 为 loader 绑定一个扩展 | --module-bind /\.js$/=babel |
178+
| --module-bind | 为 loader 绑定一个扩展 | --module-bind /\.js$/=babel-loader |
179179
| --module-bind-post | 为 post loader 绑定一个扩展 | |
180180
| --module-bind-pre | 为 pre loader 绑定一个扩展 | |
181181

content/concepts/loaders.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = {
7070
use: [
7171
{ loader: ['style-loader'](/loaders/style-loader)},
7272
{
73-
loader: ['css-loader'](/loaders/css-loader)},
73+
loader: ['css-loader'](/loaders/css-loader),
7474
options: {
7575
modules: true
7676
}
@@ -100,7 +100,7 @@ T> 尽可能使用 `module.rules`,因为这样可以在源码中减少引用
100100
可选项,你也可以通过 CLI 使用 loader:
101101

102102
```sh
103-
webpack --module-bind jade --module-bind 'css=style!css'
103+
webpack --module-bind jade-loader --module-bind 'css=style-loader!css-loader'
104104
```
105105

106106
这会对 `.jade` 文件使用 `jade-loader`,对 `.css` 文件使用 [`style-loader`](/loaders/style-loader)[`css-loader`](/loaders/css-loader)

content/configuration/devtool.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ contributors:
2626
source-map | -- | -- | yes | 原始源码
2727
nosources-source-map | -- | -- | yes | 无源码内容
2828

29+
T> `+` 表示较快,`-` 表示较慢,`o` 表示时间相同
30+
2931
其中一些值适用于开发环境,一些适用于生产环境。对于开发环境,通常希望更快速的 Source Map,需要添加到 bundle 中以增加体积为代价,但是对于生产环境,则希望更精准的 Source Map,需要从 bundle 中分离并独立存在。
3032

3133
W> Chrome 中的 Source Map 有一些问题。[我们需要你的帮助!](https://github.com/webpack/webpack/issues/3165)

content/configuration/index.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,16 @@ module.exports = {
368368
// 精确控制要显示的 bundle 信息
369369
370370
[devServer](/configuration/dev-server): {
371-
/* TODO */
371+
proxy: { // proxy URLs to backend development server
372+
'/api': 'http://localhost:3000'
373+
},
374+
contentBase: path.join(__dirname, 'public'), // boolean | string | array, static file location
375+
compress: true, // enable gzip compression
376+
historyApiFallback: true, // true for index.html upon 404, object for multiple paths
377+
hot: true, // hot module replacement. Depends on HotModuleReplacementPlugin
378+
https: false, // true for self-signed, object for cert authority
379+
noInfo: true, // only errors & warns on hot reload
380+
// ...
372381
},
373382
374383
[plugins](plugins): [

content/guides/code-splitting-css.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ webpack 能够用 `ExtractTextWebpackPlugin` 帮助你将 CSS 单独打包,以
4444

4545
安装 [`ExtractTextWebpackPlugin`](/plugins/extract-text-webpack-plugin)
4646
```
47-
npm i --save-dev extract-text-webpack-plugin@beta
47+
npm i --save-dev extract-text-webpack-plugin
4848
```
4949

50-
为了使用这个插件,它需要通过2步被配置到 `webpack.config.js` 文件中。
50+
为了使用这个插件,它需要通过三步被配置到 `webpack.config.js` 文件中。
5151

5252
```diff
53+
+var ExtractTextPlugin = require('extract-text-webpack-plugin');
5354
module.exports = {
5455
module: {
5556
rules: [{

content/guides/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ webpack 不仅仅作为模块打包器存在。如果你要在使用 webpack 或
1313
| 特性 | webpack/webpack | jrburke/requirejs | substack/node-browserify | jspm/jspm-cli | rollup/rollup | brunch/brunch |
1414
|---------|-----------------|-------------------|--------------------------|---------------|---------------|---------------|
1515
| 附加模块按需加载 | **yes** | **yes** | no | [System.import](https://github.com/systemjs/systemjs/blob/master/docs/system-api.md#systemimportmodulename--normalizedparentname---promisemodule) | no | no |
16-
| AMD `define` | **yes** | **yes** | [deamdify](https://github.com/jaredhanson/deamdify) | yes | [rollup-plugin-amd](https://github.com/brunch/uglify-js-brunch) | yes |
16+
| AMD `define` | **yes** | **yes** | [deamdify](https://github.com/jaredhanson/deamdify) | yes | [rollup-plugin-amd](https://github.com/piuccio/rollup-plugin-amd) | yes |
1717
| AMD `require` | **yes** | **yes** | no | yes | no | yes |
1818
| AMD `require` 按需加载 | **yes** | 手动配置 | no | yes | no | no |
1919
| CommonJS `exports` | **yes** | 只包含在 `define`| **yes** | yes | [commonjs-plugin](https://github.com/rollup/rollup-plugin-commonjs) | yes |

content/guides/lazy-load-react.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ class LazilyLoad extends React.Component {
8282
}
8383

8484
componentDidUpdate(previous) {
85-
if (this.props.modules === previous.modules) return null;
86-
this.load();
85+
const shouldLoad = !!Object.keys(this.props.modules).filter((key)=> {
86+
return this.props.modules[key] !== previous.modules[key];
87+
}).length;
88+
if (shouldLoad) {
89+
this.load();
90+
}
8791
}
8892

8993
componentWillUnmount() {

0 commit comments

Comments
 (0)