Skip to content

Commit 0c44890

Browse files
Jinjiangyyx990803
authored andcommitted
[docs][zh-cn] translated recent updates (#1193)
* [docs][zh-cn] translated recent updates * [docs][zh-cn] updated SUMMARY * [docs][zh-cn] typos * [docs][zh-cn] typos
1 parent c337dc0 commit 0c44890

File tree

3 files changed

+74
-50
lines changed

3 files changed

+74
-50
lines changed

docs/en/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,6 @@ module.exports = {
331331
- type: `boolean`
332332
- default: `false`
333333

334-
Setting this to true enables filesystem-based option caching so that the options for the main `vue-loader` can be properly shared with sub-loaders in other threads.
334+
Setting this to `true` enables filesystem-based option caching so that the options for the main `vue-loader` can be properly shared with sub-loaders in other threads.
335335

336336
Only needed when using together with HappyPack or `thread-loader`.

docs/zh-cn/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
- [postLoaders](options.md#postloaders)
2525
- [postcss](options.md#postcss)
2626
- [postcss.config](options.md#postcssconfig)
27+
- [postcss.useConfigFile](options.md#postcssuseconfigfile)
28+
- [postcss.cascade](options.md#postcsscascade)
2729
- [cssSourceMap](options.md#csssourcemap)
2830
- [esModule](options.md#esmodule)
2931
- [preserveWhitespace](options.md#preservewhitespace)
@@ -33,3 +35,5 @@
3335
- [buble](options.md#buble)
3436
- [extractCSS](options.md#extractcss)
3537
- [optimizeSSR](options.md#optimizessr)
38+
- [hotReload](options.md#hotreload)
39+
- [threadMode](options.md#threadmode)

docs/zh-cn/options.md

Lines changed: 69 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ module.exports = {
160160

161161
注意,这个值会在 webpack 配置中没有 `devtool` 的情况下自动设置为 `false`
162162

163+
### postcss.cascade
164+
165+
> 14.2.0 新增
166+
167+
- 类型:`boolean`
168+
- 默认值:`false`
169+
170+
设置为 `true` 的时候会开启层叠式加载 PostCSS 配置文件。比如,你可以在嵌套的源代码目录下放置额外的 `.postcssrc` 文件来为项目中不同的文件应用不同的 PostCSS 配置。
171+
163172
### esModule
164173

165174
> 这个选项已经从 v14.0 中移除。在 v14.0 及以上版本中,`*.vue` 文件始终暴露为 ES 模块。
@@ -232,62 +241,62 @@ module.exports = {
232241

233242
> 12.0.0 新增
234243

235-
使用 `extract-text-webpack-plugin` 自动提取 CSS。适用于大多数预处理器,且也可在生产环境进行压缩。
244+
使用 `extract-text-webpack-plugin` 自动提取 CSS。适用于大多数预处理器,且也可在生产环境进行压缩。
236245

237-
传入的值可以是 `true`,也可以是插件的一个实例 (这样可以为多个提取的文件使用多个提取插件的实例)。
246+
传入的值可以是 `true`,也可以是插件的一个实例 (这样可以为多个提取的文件使用多个提取插件的实例)。
238247

239-
这应当只用于生产环境,以便可以在开发过程中使用热重载。
248+
这应当只用于生产环境,以便可以在开发过程中使用热重载。
240249

241-
示例:
250+
示例:
242251

243-
``` js
244-
// webpack.config.js
245-
var ExtractTextPlugin = require("extract-text-webpack-plugin")
246-
247-
module.exports = {
248-
// other options...
249-
module: {
250-
rules: [
251-
{
252-
test: /\.vue$/,
253-
loader: 'vue-loader',
254-
options: {
255-
extractCSS: true
252+
``` js
253+
// webpack.config.js
254+
var ExtractTextPlugin = require("extract-text-webpack-plugin")
255+
256+
module.exports = {
257+
// 其它选项……
258+
module: {
259+
rules: [
260+
{
261+
test: /\.vue$/,
262+
loader: 'vue-loader',
263+
options: {
264+
extractCSS: true
265+
}
256266
}
257-
}
267+
]
268+
},
269+
plugins: [
270+
new ExtractTextPlugin("style.css")
258271
]
259-
},
260-
plugins: [
261-
new ExtractTextPlugin("style.css")
262-
]
263-
}
264-
```
272+
}
273+
```
265274

266-
或者传递插件的一个实例:
275+
或者传递插件的一个实例:
267276

268-
``` js
269-
// webpack.config.js
270-
var ExtractTextPlugin = require("extract-text-webpack-plugin")
271-
var plugin = new ExtractTextPlugin("style.css")
272-
273-
module.exports = {
274-
// other options...
275-
module: {
276-
rules: [
277-
{
278-
test: /\.vue$/,
279-
loader: 'vue-loader',
280-
options: {
281-
extractCSS: plugin
277+
``` js
278+
// webpack.config.js
279+
var ExtractTextPlugin = require("extract-text-webpack-plugin")
280+
var plugin = new ExtractTextPlugin("style.css")
281+
282+
module.exports = {
283+
// 其它选项……
284+
module: {
285+
rules: [
286+
{
287+
test: /\.vue$/,
288+
loader: 'vue-loader',
289+
options: {
290+
extractCSS: plugin
291+
}
282292
}
283-
}
293+
]
294+
},
295+
plugins: [
296+
plugin
284297
]
285-
},
286-
plugins: [
287-
plugin
288-
]
289-
}
290-
```
298+
}
299+
```
291300

292301
### optimizeSSR
293302

@@ -296,7 +305,7 @@ module.exports = {
296305
- 类型: `boolean`
297306
- 默认值: 当 webpack 配置中包含 `target: 'node'``vue-template-compiler` 版本号大于等于 2.4.0 时为 `true`
298307

299-
开启 Vue 2.4 服务端渲染的编译优化之后,渲染函数将会把返回的 vdom 树的一部分编译为字符串,以提升服务端渲染的性能。在一些情况下,你可能想要明确的将其关掉,因为该渲染函数只能用于服务端渲染,而不能用于客户端渲染或测试环境。
308+
开启 Vue 2.4 服务端渲染的编译优化之后,渲染函数将会把返回的 vdom 树的一部分编译为字符串,以提升服务端渲染的性能。在一些情况下,你可能想要明确的将其关掉,因为该渲染函数只能用于服务端渲染,而不能用于客户端渲染或测试环境。
300309

301310
### hotReload
302311

@@ -306,5 +315,16 @@ module.exports = {
306315
- 默认值: 在开发环境下是 `true`,在生产环境下或 webpack 配置中有 `target: 'node'` 的时候是 `false`
307316
- 允许的值: `false` (`true` 会强制热重载,即便是生产环境或 `target: 'node'` 时)
308317

309-
是否使用 webpack 的[模块热替换](https://webpack.js.org/concepts/hot-module-replacement/)在浏览器中应用变更而**不重载整个页面**。
310-
用这个选项 (值设为 `false`) 在开发环境下关闭热重载特性。
318+
是否使用 webpack 的[模块热替换](https://webpack.js.org/concepts/hot-module-replacement/)在浏览器中应用变更而**不重载整个页面**。
319+
用这个选项 (值设为 `false`) 在开发环境下关闭热重载特性。
320+
321+
### threadMode
322+
323+
> 14.2.0 新增
324+
325+
- 类型:`boolean`
326+
- 默认值:`false`
327+
328+
设置为 `true` 的时候会开启基于文件系统的选项缓存,使得主 `vue-loader` 的选项可以分享给其它线程中的子 loader。
329+
330+
只在和 HappyPack 或 `thread-loader` 配合使用的时候才用得到。

0 commit comments

Comments
 (0)