Skip to content

Commit 2db8c0a

Browse files
committed
docs: update for 13.6.0
1 parent a255926 commit 2db8c0a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

docs/en/features/postcss.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ Any CSS output processed by `vue-loader` is piped through [PostCSS](https://gith
44

55
## Using a Config File
66

7-
Starting in 11.0 `vue-loader` supports auto-loading the same PostCss config files supported by [`postcss-loader`](https://github.com/postcss/postcss-loader#usage):
7+
`vue-loader` supports auto-loading the same PostCss config files supported by [`postcss-loader`](https://github.com/postcss/postcss-loader#usage):
88

99
- `postcss.config.js`
1010
- `.postcssrc`
1111
- `postcss` field in `package.json`
1212

1313
Using a config file allows you to share the same config between your normal CSS files processed by `postcss-loader` and the CSS inside `*.vue` files, and is recommended.
1414

15+
## Using with `postcss-loader`
16+
17+
Since `vue-loader` handles PostCSS on its styles internally, you only need to apply `postcss-loader` to standalone CSS files. There's no need to specify `lang="postcss"` on a style block if there is a PostCSS config file in your project.
18+
19+
Sometimes the user may want to use `lang="postcss"` only for syntax highlighting purposes. Starting in 13.6.0, if no loader has been explicitly configured for the following common PostCSS extensions (via `vue-loader`'s own `loaders` option), they will simply go through `vue-loader`'s default PostCSS transforms:
20+
21+
- `postcss`
22+
- `pcss`
23+
- `sugarss`
24+
- `sss`
25+
1526
## Inline Options
1627

1728
Alternatively, you can specify postcss config specifically for `*.vue` files using the `postcss` option for `vue-loader`.
@@ -66,3 +77,17 @@ In addition to providing an Array of plugins, the `postcss` option also accepts:
6677
}
6778
}
6879
```
80+
81+
### Disabling Auto Config File Loading
82+
83+
In `13.6.0+`, auto postcss config file loading can be disabled by specifying `postcss.useConfigFile: false`:
84+
85+
``` js
86+
postcss: {
87+
useConfigFile: false,
88+
plugins: [/* ... */],
89+
options: {/* ... */}
90+
}
91+
```
92+
93+
This allows the postcss configuration inside `*.vue` files to be entirely controlled by the inline config.

docs/en/options.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ module.exports = {
137137

138138
Provide context to PostCSS plugins. See [postcss-loader docs](https://github.com/postcss/postcss-loader#context-ctx) for more details.
139139

140+
### postcss.useConfigFile
141+
142+
> New in 13.6.0
143+
144+
- type: `boolean`
145+
- default: `true`
146+
147+
Set this to `false` to disable auto-loading of postcss config files.
148+
140149
### cssSourceMap
141150

142151
- type: `boolean`

0 commit comments

Comments
 (0)