File tree Expand file tree Collapse file tree 4 files changed +12
-24
lines changed Expand file tree Collapse file tree 4 files changed +12
-24
lines changed Original file line number Diff line number Diff line change 1
1
# PostCSS
2
2
3
- This default settings for ` postcss-loader ` in Vuepack:
3
+ By default we only use ` autoprefixer ` and ` postcss-nested ` in PostCSS,
4
+ you can update ` postcss ` field in ` package.json ` to use custom plugins.
4
5
5
- ``` js
6
- [
7
- require (' autoprefixer' )({
8
- // Vue does not support ie 8 and below
9
- browsers: [' last 2 versions' , ' ie > 8' ]
10
- }),
11
- require (' postcss-nested' )
12
- ]
13
- ```
6
+ ## Autoprefixer
14
7
15
- You can update it in ` ./build/config.js ` .
8
+ Autoprefixer respects the ` browserslist ` field in ` package.json ` , the default value we use is: ` ['ie > 8', 'last 2 versions'] `
Original file line number Diff line number Diff line change @@ -6,15 +6,7 @@ module.exports = {
6
6
title : '{{name}}' ,
7
7
// when you use electron please set to relative path like ./
8
8
// otherwise only set to absolute path when you're using history mode
9
- publicPath : '{{#if electron}}.{{/if}}/' ,
10
- postcss : [
11
- // add prefix via postcss since it's faster
12
- require ( 'autoprefixer' ) ( {
13
- // Vue does not support ie 8 and below
14
- browsers : [ 'last 2 versions' , 'ie > 8' ]
15
- } ) ,
16
- require ( 'postcss-nested' )
17
- ] , { { #if electron } }
9
+ publicPath : '{{#if electron}}.{{/if}}/' , { { #if electron } }
18
10
electron: true , { { / i f } } { { # i f j s x } }
19
11
cssModules : true ,
20
12
jsx : true { { / i f } }
Original file line number Diff line number Diff line change @@ -53,11 +53,7 @@ _.loadersOptions = () => {
53
53
options : {
54
54
// css-loader relies on context
55
55
context : process . cwd ( ) ,
56
- // postcss plugins apply to .css files
57
- postcss : config . postcss ,
58
56
vue : {
59
- // postcss plugins apply to css in .vue files
60
- postcss : config . postcss ,
61
57
loaders : {
62
58
css : generateLoader ( [ ] ) ,
63
59
sass : generateLoader ( [ 'sass-loader?indentedSyntax&sourceMap' ] ) ,
Original file line number Diff line number Diff line change 27
27
}]
28
28
]
29
29
},
30
+ "postcss" : {
31
+ "plugins" : {
32
+ "autoprefixer" : {},
33
+ "postcss-nested" : {}
34
+ }
35
+ },
36
+ "browserslist" : [" last 2 versions" , " ie > 8" ],
30
37
"dependencies" : {
31
38
"babel-runtime" : " ^6.18.0" ,
32
39
"promise-polyfill" : " ^6.0.2" ,
You can’t perform that action at this time.
0 commit comments