Skip to content

Commit edc5238

Browse files
committed
update docs for options
1 parent d6bd8e3 commit edc5238

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
- [Linting](workflow/linting.md)
1717
- [Testing](workflow/testing.md)
1818
- [Testing with Mocks](workflow/testing-with-mocks.md)
19+
- [Options Reference](options.md)

docs/options.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Options Reference
2+
3+
### loaders
4+
5+
- type: `Object`
6+
7+
An object specifying Webpack loaders to use for language blocks inside `*.vue` files. The key corresponds to the `lang` attribute for language blocks, if specified. The default `lang` for each type is:
8+
9+
- `<template>`: `html`
10+
- `<script>`: `js`
11+
- `<style>`: `css`
12+
13+
For example, to use `babel-loader` and `eslint-loader` to process all `<script>` blocks:
14+
15+
``` js
16+
// ...
17+
vue: {
18+
loaders: {
19+
js: 'babel!eslint'
20+
}
21+
}
22+
```
23+
24+
### autoprefixer
25+
26+
- type: `Boolean`
27+
- default: `true`
28+
29+
Whether to enable autoprefixer for CSS inside `*.vue` files.
30+
31+
### postcss
32+
33+
- type: `Array` or `Function`
34+
35+
Specify custom PostCSS plugins to be applied to CSS inside `*.vue` files. If using a function, the function will called using the same loader context and should return an Array of plugins.
36+
37+
``` js
38+
// ...
39+
vue: {
40+
// note: do not nest the `postcss` option under `loaders`
41+
postcss: [require('postcss-cssnext')()],
42+
autoprefixer: false,
43+
loaders: {
44+
// ...
45+
}
46+
}
47+
```
48+
49+
### cssSourceMap
50+
51+
- type: `Boolean`
52+
- default: `true`
53+
54+
Whether to enable source maps for CSS. Disabling this can avoid some relative path related bugs in `css-loader` and make the build a bit faster.
55+
56+
Note this is automatically set to `false` if the `devtool` option is not present in the main Webpack config.

0 commit comments

Comments
 (0)