Skip to content

Commit 9ef133a

Browse files
committed
Merge branch 'master' into cn
# Conflicts: # content/configuration/dev-server.md # content/configuration/module.md # content/guides/author-libraries.md # content/guides/hmr-react.md
2 parents 35d1511 + 72825f9 commit 9ef133a

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

content/configuration/dev-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ content is served from dist/
3838

3939
这将给出一些背景知识,就能知道服务器的访问位置,并且知道服务已启动。
4040

41-
如果你通过 Node.js API 来使用 dev-server, `devServer` 中的选项将被忽略。将选项作为第二个参数传入: `new WebpackDevServer(compiler, {...})`
41+
如果你通过 Node.js API 来使用 dev-server, `devServer` 中的选项将被忽略。将选项作为第二个参数传入: `new WebpackDevServer(compiler, {...})`关于如何通过 Node.js API 使用 webpack-dev-server 的示例,请[查看此处](https://github.com/webpack/webpack-dev-server/blob/master/examples/node-api-simple/server.js)
4242

4343

4444
## `devServer.clientLogLevel`

content/configuration/module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ parser: {
140140
amd: false, // 禁用 AMD
141141
commonjs: false, // 禁用 CommonJS
142142
system: false, // 禁用 SystemJS
143-
harmony: false, // 禁用 ES6 Harmony import/export
143+
harmony: false, // 禁用 ES2015 Harmony import/export
144144
requireInclude: false, // 禁用 require.include
145145
requireEnsure: false, // 禁用 require.ensure
146146
requireContext: false, // 禁用 require.context

content/guides/author-libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ webpack是一个用来打包应用(application)和库(library)的代码
1010

1111
## 创建一个库
1212

13-
假设你正在写一个小的 library `webpack-numbers',允许将数字1到5从数字转换为文本表示,反之亦然。实现使用ES6模块,可能看起来像这样:
13+
假设你正在写一个小的 library `webpack-numbers',允许将数字1到5从数字转换为文本表示,反之亦然。实现使用 ES2015 模块,可能看起来像这样:
1414

1515
__src/index.js__
1616
```javascript

content/guides/get-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ T> 输出可能会稍有不同。如果构建成功,那么你就可以继续
127127
在浏览器中打开 `webpack.config.js`,查看成功后 bundle 的结果。
128128
你应该看到带有以下文本的页面:'Hello webpack'。
129129

130-
## Using ES6 modules with webpack
130+
## Using ES2015 modules with webpack
131131

132-
Noticed the use of [ES6 module import](https://developer.mozilla.org//en-US/docs/Web/JavaScript/Reference/Statements/import) (alias ES2015, *harmony*) in `app/index.js`? Although `import`/`export` statements are not supported in browsers (yet), using them is fine since webpack will replace those instructions with an ES5 compatible wrapper code. Inspect `dist/bundle.js` to convince yourself.
132+
Noticed the use of [ES2015 module import](https://developer.mozilla.org//en-US/docs/Web/JavaScript/Reference/Statements/import) (alias ES2015, *harmony*) in `app/index.js`? Although `import`/`export` statements are not supported in browsers (yet), using them is fine since webpack will replace those instructions with an ES5 compatible wrapper code. Inspect `dist/bundle.js` to convince yourself.
133133

134-
Note that webpack will not touch your code other than `import`/`export`. In case you are using other [ES6 features](http://es6-features.org/), make sure to use a transpiler such as [Babel](https://babeljs.io/) or [Bublé](https://buble.surge.sh/guide/).
134+
Note that webpack will not touch your code other than `import`/`export`. In case you are using other [ES2015 features](http://es6-features.org/), make sure to use a transpiler such as [Babel](https://babeljs.io/) or [Bublé](https://buble.surge.sh/guide/).
135135

136136
## 使用带有配置的 webpack
137137

content/guides/hmr-react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export default App;
217217

218218
与我们在 [Babel 配置文件](#babel-config) 中所配置的是一样的。注意,不仅仅只有模块热替换的场景需要禁用Babel模块插件。如果你不将此插件禁用,你可能会遇到许多其他的问题(查看 [从webpack v1 迁移到 v2](/guides/migrating/#mixing-es2015-with-amd-and-commonjs)[webpack-tree-shaking](http://www.2ality.com/2015/12/webpack-tree-shaking.html))。
219219

220-
4. 注意,如果你在webpack 2 配置文件中启用了ES6模块,并且按照上文#3 的配置,修改了你的`.babelrc` 文件,你需要使用`require`命令,或者,创建两个`.babelrc`文件(查看问题 [这里](https://github.com/webpack/webpack.js.org/issues/154)):
220+
4. 注意,如果你在webpack 2 配置文件中启用了 ES2015 模块,并且按照上文#3 的配置,修改了你的`.babelrc` 文件,你需要使用`require`命令,或者,创建两个`.babelrc`文件(查看问题 [这里](https://github.com/webpack/webpack.js.org/issues/154)):
221221
* 一个文件放置在项目的根目录,并且加上配置: `"presets": ["es2015"]`
222222
* 另一个文件放置在webpack要构建代码的主目录。在这个例子里,放置的目录路径是`src/`
223223

content/guides/tree-shaking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ contributors:
55
- zacanger
66
---
77

8-
_Tree shaking_ is a term commonly used in the JavaScript context for dead-code elimination, or more precisely, live-code import. It relies on ES6 module [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)/[export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export) for the [static structure](http://exploringjs.com/es6/ch_modules.html#static-module-structure) of its module system. The name and concept have been popularized by the ES6 module bundler [rollup](https://github.com/rollup/rollup).
8+
_Tree shaking_ is a term commonly used in the JavaScript context for dead-code elimination, or more precisely, live-code import. It relies on ES2015 module [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)/[export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export) for the [static structure](http://exploringjs.com/es6/ch_modules.html#static-module-structure) of its module system. The name and concept have been popularized by the ES2015 module bundler [rollup](https://github.com/rollup/rollup).
99

10-
webpack 2 comes with a built-in support for ES6 modules (alias *harmony modules*) as well as unused module export detection.
10+
webpack 2 comes with a built-in support for ES2015 modules (alias *harmony modules*) as well as unused module export detection.
1111

1212
## Example
1313

content/writers-guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The site will update itself as you make changes.
2828
* webpack should always be written in lower-case letters. Even at the beginning of a sentence. ([source](https://github.com/webpack/media#name))
2929
* loaders are enclosed in backticks and [kebab-cased](https://en.wikipedia.org/w/index.php?title=Kebab_case): `css-loader`, `ts-loader`, …
3030
* plugins are enclosed in backticks and [camel-cased](https://en.wikipedia.org/wiki/Camel_case): `BannerPlugin`, `NpmInstallWebpackPlugin`, …
31+
* Use ES5; ES2015, ES2016, … to refer to the ECMAScript standards
3132

3233
## Formatting
3334

0 commit comments

Comments
 (0)