Skip to content

[zh-cn] synced from #eb748f2 to #5e549cb #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/zh-cn/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [CSS Modules](features/css-modules.md)
- [PostCSS](features/postcss.md)
- [热重载](features/hot-reload.md)
- [函数式组件](features/functional.md)
- 配置
- [预处理器](configurations/pre-processors.md)
- [资源路径处理](configurations/asset-url.md)
Expand All @@ -23,6 +24,7 @@
- [preLoaders](options.md#preloaders)
- [postLoaders](options.md#postloaders)
- [postcss](options.md#postcss)
- [postcss.config](options.md#postcssconfig)
- [cssSourceMap](options.md#csssourcemap)
- [esModule](options.md#esmodule)
- [preserveWhitespace](options.md#preservewhitespace)
Expand All @@ -32,3 +34,4 @@
- [buble](options.md#buble)
- [extractCSS](options.md#extractcss)
- [optimizeSSR](options.md#optimizessr)
- [cacheBusting](options.md#cachebusting)
34 changes: 34 additions & 0 deletions docs/zh-cn/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,31 @@ module.exports = {
}
```

### postcss.config

> 13.2.1 新增

- 类型:`Object`
- 默认值:`undefined`

这个字段允许用 [postcss-loader](https://github.com/postcss/postcss-loader#config-1) 同样的方式自定义 PostCSS 插件。

- **postcss.config.path**

指定一个加载 PostCSS 配置文件的路径 (文件或目录)。

``` js
postcss: {
config: {
path: path.resolve('./src')
}
}
```

- **postcss.config.ctx**

向 PostCSS 插件提供上下文。详见 [postcss-loader 文档](https://github.com/postcss/postcss-loader#context-ctx)。

### cssSourceMap

- 类型: `Boolean`
Expand Down Expand Up @@ -272,3 +297,12 @@ module.exports = {
- 默认值: 当 webpack 配置中包含 `target: 'node'` 且 `vue-template-compiler` 版本号大于等于 2.4.0 时为 `true`。

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

### cacheBusting

> 13.2.0 新增

- 类型:`boolean`
- 默认值:在开发环境下是 `true`,在生产环境下是 `false`。

是否通过给文件名后加哈希查询值来避免生成的 source map 被缓存。关掉这一选项有益于 source map 调试。
2 changes: 1 addition & 1 deletion docs/zh-cn/workflow/testing-with-mocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ it('should render', () => {
'test': ExampleWithMocks
}
}).$mount()
expect(vm.$el.querySelector('.msg').textContent).toBe('Hello from a mocked service!')
expect(vm.$el.querySelector('.msg').textContent).to.equal('Hello from a mocked service!')
})
```