From 08adb5972c2a691d62cf22006fb3c87bff2e6444 Mon Sep 17 00:00:00 2001 From: Jinjiang Date: Tue, 17 Oct 2017 22:06:33 +0800 Subject: [PATCH 1/2] [zh-cn] sync --- docs/zh-cn/SUMMARY.md | 3 ++ docs/zh-cn/options.md | 34 +++++++++++++++++++++++ docs/zh-cn/workflow/testing-with-mocks.md | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/zh-cn/SUMMARY.md b/docs/zh-cn/SUMMARY.md index 7b9a44a95..1874ba71c 100644 --- a/docs/zh-cn/SUMMARY.md +++ b/docs/zh-cn/SUMMARY.md @@ -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) @@ -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) @@ -32,3 +34,4 @@ - [buble](options.md#buble) - [extractCSS](options.md#extractcss) - [optimizeSSR](options.md#optimizessr) + - [cacheBusting](options.md#cachebusting) diff --git a/docs/zh-cn/options.md b/docs/zh-cn/options.md index 65207f952..f390ee2a5 100644 --- a/docs/zh-cn/options.md +++ b/docs/zh-cn/options.md @@ -113,6 +113,31 @@ module.exports = { } ``` +### postcss.config + +> New in 13.2.1 + +- type: `Object` +- default: `undefined` + + This field allows customizing PostCSS config in the same way as [postcss-loader](https://github.com/postcss/postcss-loader#config-1). + + - **postcss.config.path** + + Specify a path (file or directory) to load the PostCSS config file from. + + ``` js + postcss: { + config: { + path: path.resolve('./src') + } + } + ``` + + - **postcss.config.ctx** + + Provide context to PostCSS plugins. See [postcss-loader docs](https://github.com/postcss/postcss-loader#context-ctx) for more details. + ### cssSourceMap - 类型: `Boolean` @@ -272,3 +297,12 @@ module.exports = { - 默认值: 当 webpack 配置中包含 `target: 'node'` 且 `vue-template-compiler` 版本号大于等于 2.4.0 时为 `true`。 开启 Vue 2.4 服务端渲染的编译优化之后,渲染函数将会把返回的 vdom 树的一部分编译为字符串,以提升服务端渲染的性能。在一些情况下,你可能想要明确的将其关掉,因为该渲染函数只能用于服务端渲染,而不能用于客户端渲染或测试环境。 + +### cacheBusting + +> New in 13.2.0 + +- type: `boolean` +- default: `true` in development mode, `false` in production mode. + +Whether generate source maps with cache busting by appending a hash query to the file name. Turning this off can help with source map debugging. diff --git a/docs/zh-cn/workflow/testing-with-mocks.md b/docs/zh-cn/workflow/testing-with-mocks.md index 00a793013..4203bd146 100644 --- a/docs/zh-cn/workflow/testing-with-mocks.md +++ b/docs/zh-cn/workflow/testing-with-mocks.md @@ -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!') }) ``` From 930d9dccc4285405996caa26d325d27178797532 Mon Sep 17 00:00:00 2001 From: Jinjiang Date: Tue, 17 Oct 2017 22:05:09 +0800 Subject: [PATCH 2/2] [zh-cn] translation --- docs/zh-cn/options.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/zh-cn/options.md b/docs/zh-cn/options.md index f390ee2a5..615324ea0 100644 --- a/docs/zh-cn/options.md +++ b/docs/zh-cn/options.md @@ -114,17 +114,17 @@ module.exports = { ``` ### postcss.config - -> New in 13.2.1 -- type: `Object` -- default: `undefined` +> 13.2.1 新增 - This field allows customizing PostCSS config in the same way as [postcss-loader](https://github.com/postcss/postcss-loader#config-1). +- 类型:`Object` +- 默认值:`undefined` + + 这个字段允许用 [postcss-loader](https://github.com/postcss/postcss-loader#config-1) 同样的方式自定义 PostCSS 插件。 - **postcss.config.path** - Specify a path (file or directory) to load the PostCSS config file from. + 指定一个加载 PostCSS 配置文件的路径 (文件或目录)。 ``` js postcss: { @@ -136,7 +136,7 @@ module.exports = { - **postcss.config.ctx** - Provide context to PostCSS plugins. See [postcss-loader docs](https://github.com/postcss/postcss-loader#context-ctx) for more details. + 向 PostCSS 插件提供上下文。详见 [postcss-loader 文档](https://github.com/postcss/postcss-loader#context-ctx)。 ### cssSourceMap @@ -299,10 +299,10 @@ module.exports = { 开启 Vue 2.4 服务端渲染的编译优化之后,渲染函数将会把返回的 vdom 树的一部分编译为字符串,以提升服务端渲染的性能。在一些情况下,你可能想要明确的将其关掉,因为该渲染函数只能用于服务端渲染,而不能用于客户端渲染或测试环境。 ### cacheBusting - -> New in 13.2.0 -- type: `boolean` -- default: `true` in development mode, `false` in production mode. +> 13.2.0 新增 + +- 类型:`boolean` +- 默认值:在开发环境下是 `true`,在生产环境下是 `false`。 -Whether generate source maps with cache busting by appending a hash query to the file name. Turning this off can help with source map debugging. +是否通过给文件名后加哈希查询值来避免生成的 source map 被缓存。关掉这一选项有益于 source map 调试。