Skip to content

Commit 4bb0c54

Browse files
committed
添加查看原文功能
1 parent 51ae320 commit 4bb0c54

File tree

135 files changed

+45
-564
lines changed

Some content is hidden

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

135 files changed

+45
-564
lines changed

Diff for: src/components/PageLinks/PageLinks.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default ({
77
page = {}
88
}) => {
99
let enURL = 'https://webpack.js.org';
10-
let baseURL = 'https://github.com/webpack-china/webpack.js.org/edit/cn/src/content';
10+
let baseURL = 'https://github.com/docschina/webpack.js.org/edit/cn/src/content';
1111
let indexPath = page.type === 'index' ? '/index' : '';
1212
let mainPath = page.url.startsWith('/') ? page.url : `/${page.url}`;
1313
let editLink = page.file.attributes.edit || baseURL + TrimEnd(mainPath, '/') + indexPath + '.md';

Diff for: src/content/api/cli.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 命令行接口(Command Line Interface)
2+
title: 命令行接口(command line interface)
33
sort: 2
44
contributors:
55
- ev1stensberg
@@ -359,7 +359,3 @@ webpack --progress --profile
359359
6ms emitting
360360
361361
```
362-
363-
***
364-
365-
> 原文:https://webpack.js.org/api/cli/

Diff for: src/content/api/compilation-hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Compilation 钩子
2+
title: compilation 钩子
33
group: Plugins
44
sort: 2
55
---

Diff for: src/content/api/compiler-hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Compiler 钩子
2+
title: compiler 钩子
33
group: Plugins
44
sort: 1
55
contributors:

Diff for: src/content/api/hot-module-replacement.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 模块热替换(Hot Module Replacement)
2+
title: 模块热替换(hot module replacement)
33
contributors:
44
- sokra
55
- skipjack
@@ -166,7 +166,3 @@ module.hot.addStatusHandler(status => {
166166
``` js
167167
module.hot.removeStatusHandler(callback)
168168
```
169-
170-
***
171-
172-
> 原文:https://webpack.js.org/api/hot-module-replacement/

Diff for: src/content/api/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,3 @@ loader 被编写为,接受源代码作为参数的函数,
5757
插件能够完全访问到编译(compilation)的当前状态。
5858

5959
[了解更多关于插件的信息!](/api/plugins)
60-
61-
***
62-
63-
> 原文:https://webpack.js.org/api/

Diff for: src/content/api/loaders.md

-4
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,3 @@ options 的值将会传递给 Complier
451451
### `this._module`
452452
453453
一种 hack 写法。用于访问当前加载的 Module 对象。
454-
455-
***
456-
457-
> 原文:https://webpack.js.org/api/loaders/

Diff for: src/content/api/module-methods.md

-4
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,3 @@ __webpack_modules__[require.resolveWeak(`./page/${page}`)]
356356
```
357357
358358
T> `require.resolveWeak` 是*通用渲染*(SSR + 代码分离)的基础,例如在 [react-universal-component](https://github.com/faceyspacey/react-universal-component) 等包中的用法。它允许代码在服务器端和客户端初始页面的加载上同步渲染。它要求手动或以某种方式提供 chunk。它可以在不需要指示应该被打包的情况下引入模块。它与 `import()` 一起使用,当用户导航触发额外的导入时,它会被接管。
359-
360-
***
361-
362-
> 原文:https://webpack.js.org/api/module-methods/

Diff for: src/content/api/module-variables.md

-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,3 @@ __resourceQuery === '?test'
147147
### `DEBUG` (webpack 特有变量)
148148

149149
等同于配置选项中的 `debug`
150-
151-
***
152-
153-
> 原文:https://webpack.js.org/api/module-variables/

Diff for: src/content/api/node.md

-4
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,3 @@ compiler.run((err, stats) => {
294294
值得一提的是,被 [webpack-dev-server](https://github.com/webpack/webpack-dev-server) 及众多其他包依赖的 [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) 就是通过这种方式,将你的文件神秘地隐藏起来,但却仍然可以用它们为浏览器提供服务!
295295

296296
T> 你指定的输出文件系统需要兼容 Node 自身的 [`fs`](https://nodejs.org/api/fs.html) 模块接口,接口需要提供 `mkdirp``join` 工具方法。
297-
298-
***
299-
300-
> 原文:https://webpack.js.org/api/node/

Diff for: src/content/api/parser.md

-4
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,3 @@ compiler.hooks.normalModuleFactory.tap(factory => {
310310
访问代码片段的抽象语法树(abstract syntax tree - AST)
311311

312312
参数:`ast` `comments`
313-
314-
***
315-
316-
> 原文:https://webpack.js.org/api/parser/

Diff for: src/content/api/plugins.md

-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,3 @@ compiler.hooks.myCustomHook.call(a, b, c);
7373
## 下一步
7474

7575
查看 [compiler hooks](/api/compiler-hooks/) 部分,了解所有可用的 `compiler` 钩子和其所需的参数的详细列表。
76-
77-
***
78-
79-
> 原文:https://webpack.js.org/api/plugins/

Diff for: src/content/api/stats.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 包含统计数据的文件(Stats Data)
2+
title: 包含统计数据的文件(stats data)
33
sort: 3
44
contributors:
55
- skipjack
@@ -69,7 +69,7 @@ webpack --profile --json > compilation-stats.json
6969
```
7070

7171

72-
### Chunk对象 (Chunk Objects)
72+
### Chunk 对象 (Chunk Objects)
7373

7474
每一个 `chunks` 表示一组称为 [chunk](/glossary#c) 的模块。每一个对象都满足以下的结构。
7575

@@ -178,7 +178,3 @@ Critical dependencies:
178178
```
179179
180180
W> 需要注意的是,当 `错误详情为false(errorDetails:false)`传入`toJson`函数时,对栈的追溯就不会被显示。`错误详情(errorDetils)` 默认值为 `true`
181-
182-
***
183-
184-
> 原文:https://webpack.js.org/api/stats/

Diff for: src/content/branding.md

-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,3 @@ T> 对于那些遵循我们的指南,并已经深入了解的人,我们还
9393
## 许可
9494

9595
logo 和品牌名称**并不遵循 MIT 许可**。请查看我们的[遵循许可](https://github.com/webpack/media/blob/master/LICENSE)页面,以获取使用指南。
96-
97-
***
98-
99-
> 原文:https://webpack.js.org/branding/

Diff for: src/content/comparison.md

-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,3 @@ X是路径字符串的长度
5858
注意_加载_和_打包_模块之间的一些关键区别很重要。可以在 [JSPM](https://github.com/jspm/jspm-cli) 引擎下找到像 [SystemJS](https://github.com/systemjs/systemjs) 的工具,用于在浏览器通过运行时(runtime)来加载和转译模块。这和 webpack 有着显著不同,在加载到浏览器之前,模块就已经被转译(通过 "loaders")并打包在一起。
5959

6060
每种方法都有其优势和劣势。运行时(runtime)加载和转译模块,为大型网站增加了大量开销,并且应用程序会由许多模块组成。因此,SystemJS 对于需要少量模块的小型项目更有意义。但是,随着 [HTTP/2](https://http2.github.io/) 改善文件从服务器到客户端的传输速度,这可能会发生一些变化。请注意,HTTP/2 不会修改_转译_模块的任何内容,在客户端下载完成后,还是需要很长时间去进行转译。
61-
62-
***
63-
64-
> 原文:https://webpack.js.org/comparison/

Diff for: src/content/concepts/configuration.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 配置(Configuration)
2+
title: 配置(configuration)
33
sort: 6
44
contributors:
55
- TheLarkInn
@@ -54,7 +54,3 @@ module.exports = {
5454
webpack 接受以多种编程和数据语言编写的配置文件。
5555

5656
查看:[配置语言](/configuration/configuration-languages/)
57-
58-
***
59-
60-
> 原文:https://webpack.js.org/concepts/configuration/

Diff for: src/content/concepts/dependency-graph.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 依赖图(Dependency Graph)
2+
title: 依赖图(dependency graph)
33
sort: 9
44
contributors:
55
- TheLarkInn
@@ -11,7 +11,3 @@ webpack 从命令行或配置文件中定义的一个模块列表开始,处理
1111
从这些_入口起点_开始,webpack 递归地构建一个_依赖图_,这个依赖图包含着应用程序所需的每个模块,然后将所有这些模块打包为少量的 _bundle_ - 通常只有一个 - 可由浏览器加载。
1212

1313
T> 对于 *HTTP/1.1* 客户端,由 webpack 打包你的应用程序会尤其强大,因为在浏览器发起一个新请求时,它能够减少应用程序必须等待的时间。对于 *HTTP/2*,你还可以使用代码拆分(Code Splitting)以及通过 webpack 打包来实现[最佳优化](https://medium.com/webpack/webpack-http-2-7083ec3f3ce6#.7y5d3hz59)
14-
15-
***
16-
17-
> 原文:https://webpack.js.org/concepts/dependency-graph/

Diff for: src/content/concepts/entry-points.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 入口起点(Entry Points)
2+
title: 入口起点(entry points)
33
sort: 2
44
contributors:
55
- TheLarkInn
@@ -104,7 +104,3 @@ const config = {
104104
- 使用 `CommonsChunkPlugin` 为每个页面间的应用程序共享代码创建 bundle。由于入口起点增多,多页应用能够复用入口起点之间的大量代码/模块,从而可以极大地从这些技术中受益。
105105

106106
T> 根据经验:每个 HTML 文档只使用一个入口起点。
107-
108-
***
109-
110-
> 原文:https://webpack.js.org/concepts/entry-points/

Diff for: src/content/concepts/hot-module-replacement.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 模块热替换(Hot Module Replacement)
2+
title: 模块热替换(hot module replacement)
33
sort: 11
44
contributors:
55
- SpaceK33z
@@ -71,7 +71,3 @@ HMR 是可选功能,只会影响包含 HMR 代码的模块。举个例子,
7171
在开发过程中,可以将 HMR 作为 LiveReload 的替代。[webpack-dev-server](/configuration/dev-server/) 支持 `hot` 模式,在试图重新加载整个页面之前,热模式会尝试使用 HMR 来更新。更多细节请查看[模块热更新指南](/guides/hot-module-replacement)
7272

7373
与许多其他功能一样,webpack 的强大之处在于它的可定制化。取决于特定项目需求,会有*许多种*配置 HMR 的方式。然而,对于多数实现来说,`webpack-dev-server` 能够配合良好,可以让你快速入门 HMR。
74-
75-
***
76-
77-
> 原文:https://webpack.js.org/concepts/hot-module-replacement/

Diff for: src/content/concepts/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,3 @@ module.exports = {
160160
```
161161

162162
[了解更多!](/concepts/mode)
163-
164-
***
165-
166-
> 原文:https://webpack.js.org/concepts/

Diff for: src/content/concepts/loaders.md

-4
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,3 @@ loader 通过(loader)预处理函数,为 JavaScript 生态系统提供了
119119
loader 遵循标准的[模块解析](/concepts/module-resolution/)。多数情况下,loader 将从[模块路径](/concepts/module-resolution/#module-paths)(通常将模块路径认为是 `npm install`, `node_modules`)解析。
120120

121121
loader 模块需要导出为一个函数,并且使用 Node.js 兼容的 JavaScript 编写。通常使用 npm 进行管理,但是也可以将自定义 loader 作为应用程序中的文件。按照约定,loader 通常被命名为 `xxx-loader`(例如 `json-loader`)。有关详细信息,请查看[如何编写 loader?](/development/how-to-write-a-loader)
122-
123-
***
124-
125-
> 原文:https://webpack.js.org/concepts/loaders/

Diff for: src/content/concepts/manifest.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Manifest
2+
title: manifest
33
sort: 10
44
contributors:
55
- skipjack
@@ -40,7 +40,3 @@ related:
4040
通过使用 bundle 计算出内容散列(content hash)作为文件名称,这样在内容或文件修改时,浏览器中将通过新的内容散列指向新的文件,从而使缓存无效。一旦你开始这样做,你会立即注意到一些有趣的行为。即使表面上某些内容没有修改,计算出的哈希还是会改变。这是因为,runtime 和 manifest 的注入在每次构建都会发生变化。
4141

4242
查看_管理构建文件_指南的 [manifest 部分](/guides/output-management#the-manifest),了解如何提取 manifest,并阅读下面的指南,以了解更多长效缓存错综复杂之处。
43-
44-
***
45-
46-
> 原文:https://webpack.js.org/concepts/manifest/

Diff for: src/content/concepts/mode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 模式(Mode)
2+
title: 模式(mode)
33
sort: 4
44
contributors:
55
- EugeneHlushko

Diff for: src/content/concepts/module-resolution.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 模块解析(Module Resolution)
2+
title: 模块解析(module resolution)
33
sort: 8
44
contributors:
55
- pksjce
@@ -79,7 +79,3 @@ Loader 解析遵循与文件解析器指定的规则相同的规则。但是 [`r
7979

8080

8181
有关上述配置的更多信息,请查看[解析 API](/configuration/resolve)学习。
82-
83-
***
84-
85-
> 原文:https://webpack.js.org/concepts/module-resolution/

Diff for: src/content/concepts/modules.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 模块(Modules)
2+
title: 模块(modules)
33
sort: 7
44
contributors:
55
- TheLarkInn
@@ -44,7 +44,3 @@ webpack 社区已经为各种流行语言和语言处理器构建了 _loader_,
4444
总的来说,webpack 提供了可定制的、强大和丰富的 API,允许**任何技术栈**使用 webpack,保持了在你的开发、测试和生成流程中**无侵入性(non-opinionated)**
4545

4646
有关完整列表,请参考 [**loader 列表**](/loaders)[**自己编写**](/api/loaders)
47-
48-
***
49-
50-
> 原文:https://webpack.js.org/concepts/modules/

Diff for: src/content/concepts/output.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 输出(Output)
2+
title: 输出(output)
33
sort: 3
44
contributors:
55
- TheLarkInn
@@ -73,7 +73,3 @@ __webpack_public_path__ = myRuntimePublicPath
7373

7474
// 剩余的应用程序入口
7575
```
76-
77-
***
78-
79-
> 原文:https://webpack.js.org/concepts/output/

Diff for: src/content/concepts/plugins.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 插件(Plugins)
2+
title: 插件(plugins)
33
sort: 5
44
contributors:
55
- TheLarkInn
@@ -93,7 +93,3 @@ module.exports = config;
9393
```
9494

9595
T> 你知道吗:以上看到的示例和 [webpack 自身运行时(runtime)](https://github.com/webpack/webpack/blob/e7087ffeda7fa37dfe2ca70b5593c6e899629a2c/bin/webpack.js#L290-L292) 极其类似。[wepback 源码](https://github.com/webpack/webpack)中隐藏有大量使用示例,你可以用在自己的配置和脚本中。
96-
97-
***
98-
99-
> 原文:https://webpack.js.org/concepts/plugins/

Diff for: src/content/concepts/targets.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 构建目标(Targets)
2+
title: 构建目标(targets)
33
sort: 10
44
contributors:
55
- TheLarkInn
@@ -69,7 +69,3 @@ module.exports = [ serverConfig, clientConfig ];
6969
* **[Boilerplate of Electron-React Application](https://github.com/chentsulin/electron-react-boilerplate)**:一个 electron 主进程和渲染进程构建过程的很好的例子。
7070

7171
?> Need to find up to date examples of these webpack targets being used in live code or boilerplates.
72-
73-
***
74-
75-
> 原文:https://webpack.js.org/concepts/targets/

Diff for: src/content/configuration/configuration-languages.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 使用不同语言进行配置(Configuration Languages)
2+
title: 使用不同语言进行配置(configuration languages)
33
sort: 2
44
contributors:
55
- sokra
@@ -174,7 +174,3 @@ export default (
174174
```
175175

176176
W> 如果你在其他地方也使用了 Babel 并且把`模块(modules)`设置为了 `false`,那么你要么同时维护两份单独的 `.babelrc` 文件,要么使用 `conts jsxobj = requrie('jsxobj');` 并且使用 `moduel.exports` 而不是新版本的 `import``export` 语法。这是因为尽管 Node.js 已经支持了许多 ES6 的新特性,然而还无法支持 ES6 模块语法。
177-
178-
***
179-
180-
> 原文:https://webpack.js.org/configuration/configuration-languages/

Diff for: src/content/configuration/configuration-types.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 多种配置类型(Configuration Types)
2+
title: 多种配置类型(configuration types)
33
sort: 3
44
contributors:
55
- sokra
@@ -75,7 +75,3 @@ module.exports = [{
7575
mode: 'production',
7676
}]
7777
```
78-
79-
***
80-
81-
> 原文:https://webpack.js.org/configuration/configuration-types/

Diff for: src/content/configuration/dev-server.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 开发中 Server(DevServer)
2+
title: 开发中 Server(devServer)
33
sort: 9
44
contributors:
55
- sokra
@@ -834,7 +834,3 @@ watchOptions: {
834834
如果这对文件系统来说太重了的话,你可以修改间隔时间(以毫秒为单位),将其设置为一个整数。
835835

836836
查看 [WatchOptions](/configuration/watch) 更多选项。
837-
838-
***
839-
840-
> 原文:https://webpack.js.org/configuration/dev-server/

Diff for: src/content/configuration/devtool.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Devtool
2+
title: devtool
33
sort: 10
44
contributors:
55
- sokra
@@ -114,7 +114,3 @@ W> 你不应将 source map 文件部署到 web 服务器。而是只将其用于
114114
W> 这仍然会暴露反编译后的文件名和结构,但它不会暴露原始代码。
115115

116116
T> 在使用 `uglifyjs-webpack-plugin` 时,你必须提供 `sourceMap:true` 选项来启用 source map 支持。
117-
118-
***
119-
120-
> 原文:https://webpack.js.org/configuration/devtool/

Diff for: src/content/configuration/entry-context.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 入口和上下文(Entry and Context)
2+
title: 入口和上下文(entry and context)
33
sort: 4
44
contributors:
55
- sokra
@@ -62,7 +62,3 @@ entry: () => new Promise((resolve) => resolve(['./demo', './demo2']))
6262
```
6363

6464
当结合 [`output.library`](/configuration/output#output-library) 选项时:如果传入数组,则只导出最后一项。
65-
66-
***
67-
68-
> 原文:https://webpack.js.org/configuration/entry-context/

0 commit comments

Comments
 (0)