File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1212 "vue" : " ^2.2.6"
1313 },
1414 "devDependencies" : {
15+ "autoprefixer" : " ^6.7.7" ,
1516 "babel-core" : " ^6.24.1" ,
1617 "babel-loader" : " ^6.4.1" ,
1718 "babel-preset-es2015" : " ^6.24.1" ,
2526 "glob" : " ^7.1.1" ,
2627 "html-loader" : " ^0.4.5" ,
2728 "html-webpack-plugin" : " ^2.28.0" ,
29+ "postcss-loader" : " ^1.3.3" ,
2830 "style-loader" : " ^0.16.1" ,
2931 "url-loader" : " ^0.5.8" ,
3032 "vue-loader" : " ^11.3.4" ,
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ plugins : [
3+ require ( 'autoprefixer' ) ( )
4+ ]
5+ }
Original file line number Diff line number Diff line change 11<template >
22 <div id =" app" >
3+ <h1 >Use PostCSS</h1 >
34 <modal ></modal >
45 <div class =" dd" >
56 Index
@@ -36,8 +37,13 @@ export default {
3637}
3738 </script >
3839
39- <style >
40+ <style lang="postcss" >
4041 body {
4142 background-color : #f5f5f5 ;
4243 }
44+ :root h1 {
45+ --color : red;
46+ display : flex;
47+ color : var (--color );
48+ }
4349 </style >
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ const config = {
3939 css : ExtractTextPlugin . extract ( {
4040 use : 'css-loader' ,
4141 fallback : 'style-loader'
42+ } ) ,
43+ postcss : ExtractTextPlugin . extract ( {
44+ use : [ 'css-loader' , 'postcss-loader' ] ,
45+ fallback : 'style-loader'
4246 } )
4347 }
4448 }
@@ -51,8 +55,8 @@ const config = {
5155 {
5256 test : / \. c s s $ / ,
5357 use : ExtractTextPlugin . extract ( {
54- fallback : 'style -loader',
55- use : 'css -loader'
58+ use : [ 'css -loader', 'postcss-loader' ] ,
59+ fallback : 'style -loader'
5660 } )
5761 } ,
5862 {
You can’t perform that action at this time.
0 commit comments