Skip to content

Commit a945fca

Browse files
committed
docs: update new options
1 parent b22db1d commit a945fca

File tree

2 files changed

+71
-49
lines changed

2 files changed

+71
-49
lines changed

docs/en/SUMMARY.md

Lines changed: 2 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)

docs/en/options.md

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

162162
Note this is automatically set to `false` if the `devtool` option is not present in the main webpack config.
163163

164+
### postcss.cascade
165+
166+
> New in 14.2.0
167+
168+
- type: `boolean`
169+
- default: `false`
170+
171+
Set this to `true` to enable cascading PostCSS config file loading. For example, you can have extra `.postcssrc` files in nested source directories to apply different PostCSS configs to different files in your project.
172+
164173
### esModule
165174

166175
> This option has been removed in v14.0. In v14.0 and above, `*.vue` files always expose ES modules.
@@ -238,62 +247,62 @@ module.exports = {
238247
- type: `boolean`
239248
- default: `false`
240249

241-
Automatically extracts the CSS using `extract-text-webpack-plugin`. Works for most pre-processors out of the box, and handles minification in production as well.
250+
Automatically extracts the CSS using `extract-text-webpack-plugin`. Works for most pre-processors out of the box, and handles minification in production as well.
242251

243-
The value passed in can be `true`, or an instance of the plugin (so that you can use multiple instances of the extract plugin for multiple extracted files).
252+
The value passed in can be `true`, or an instance of the plugin (so that you can use multiple instances of the extract plugin for multiple extracted files).
244253

245-
This should be only used in production so that hot-reload works during development.
254+
This should be only used in production so that hot-reload works during development.
246255

247-
Example:
256+
Example:
248257

249-
``` js
250-
// webpack.config.js
251-
var ExtractTextPlugin = require("extract-text-webpack-plugin")
252-
253-
module.exports = {
254-
// other options...
255-
module: {
256-
rules: [
257-
{
258-
test: /\.vue$/,
259-
loader: 'vue-loader',
260-
options: {
261-
extractCSS: true
258+
``` js
259+
// webpack.config.js
260+
var ExtractTextPlugin = require("extract-text-webpack-plugin")
261+
262+
module.exports = {
263+
// other options...
264+
module: {
265+
rules: [
266+
{
267+
test: /\.vue$/,
268+
loader: 'vue-loader',
269+
options: {
270+
extractCSS: true
271+
}
262272
}
263-
}
273+
]
274+
},
275+
plugins: [
276+
new ExtractTextPlugin("style.css")
264277
]
265-
},
266-
plugins: [
267-
new ExtractTextPlugin("style.css")
268-
]
269-
}
270-
```
278+
}
279+
```
271280

272-
Or passing in an instance of the plugin:
281+
Or passing in an instance of the plugin:
273282

274-
``` js
275-
// webpack.config.js
276-
var ExtractTextPlugin = require("extract-text-webpack-plugin")
277-
var plugin = new ExtractTextPlugin("style.css")
278-
279-
module.exports = {
280-
// other options...
281-
module: {
282-
rules: [
283-
{
284-
test: /\.vue$/,
285-
loader: 'vue-loader',
286-
options: {
287-
extractCSS: plugin
283+
``` js
284+
// webpack.config.js
285+
var ExtractTextPlugin = require("extract-text-webpack-plugin")
286+
var plugin = new ExtractTextPlugin("style.css")
287+
288+
module.exports = {
289+
// other options...
290+
module: {
291+
rules: [
292+
{
293+
test: /\.vue$/,
294+
loader: 'vue-loader',
295+
options: {
296+
extractCSS: plugin
297+
}
288298
}
289-
}
299+
]
300+
},
301+
plugins: [
302+
plugin
290303
]
291-
},
292-
plugins: [
293-
plugin
294-
]
295-
}
296-
```
304+
}
305+
```
297306

298307
### optimizeSSR
299308

@@ -302,7 +311,7 @@ module.exports = {
302311
- type: `boolean`
303312
- default: `true` when the webpack config has `target: 'node'` and `vue-template-compiler` is at version 2.4.0 or above.
304313

305-
Enable Vue 2.4 SSR compilation optimization that compiles part of the vdom trees returned by render functions into plain strings, which improves SSR performance. In some cases you might want to explicitly turn it off because the resulting render functions can only be used for SSR and cannot be used for client-side rendering or testing.
314+
Enable Vue 2.4 SSR compilation optimization that compiles part of the vdom trees returned by render functions into plain strings, which improves SSR performance. In some cases you might want to explicitly turn it off because the resulting render functions can only be used for SSR and cannot be used for client-side rendering or testing.
306315

307316
### hotReload
308317

@@ -312,5 +321,16 @@ Enable Vue 2.4 SSR compilation optimization that compiles part of the vdom trees
312321
- default: `true` in development mode, `false` in production mode or when the webpack config has `target: 'node'`.
313322
- allowed value: `false` (`true` will not force Hot Reload neither in production mode nor when `target: 'node'`)
314323

315-
Whether to use webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) to apply changes in the browser **without reloading the page**.
316-
Use this option (value `false`) to disable the Hot Reload feature in development mode.
324+
Whether to use webpack [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/) to apply changes in the browser **without reloading the page**.
325+
Use this option (value `false`) to disable the Hot Reload feature in development mode.
326+
327+
### threadMode
328+
329+
> New in 14.2.0
330+
331+
- type: `boolean`
332+
- default: `false`
333+
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.
335+
336+
Only needed when using together with HappyPack or `thread-loader`.

0 commit comments

Comments
 (0)