File tree Expand file tree Collapse file tree 6 files changed +69
-3
lines changed Expand file tree Collapse file tree 6 files changed +69
-3
lines changed Original file line number Diff line number Diff line change 3
3
### 🌟 新功能
4
4
5
5
* ** 课题2:** 完成基本构建,js、css打包进html,实现dev跟build环境 ([ 71a6a19] ( https://github.com/luoxue-victor/learn_webpack/commit/71a6a19 ) )
6
+ * ** 新增loader配置:** 增加ts、css、less、sass、postcss、babel配置 ([ 53616f8] ( https://github.com/luoxue-victor/learn_webpack/commit/53616f8 ) )
6
7
* ** 修改了配置文件:** i feat a config ([ 382c60c] ( https://github.com/luoxue-victor/learn_webpack/commit/382c60c ) )
7
8
* ** all:** 初始化一个项目 ([ 336cc13] ( https://github.com/luoxue-victor/learn_webpack/commit/336cc13 ) )
8
9
* ** asdasdasdas:** 你爱哈的 ([ ea12f9c] ( https://github.com/luoxue-victor/learn_webpack/commit/ea12f9c ) )
9
10
* ** config:** add config option ([ 83c9f1e] ( https://github.com/luoxue-victor/learn_webpack/commit/83c9f1e ) )
10
11
* ** daasd:** asdasd ([ 0b6ee85] ( https://github.com/luoxue-victor/learn_webpack/commit/0b6ee85 ) )
11
- * ** feat:** aaaaa ([ 73abf42 ] ( https://github.com/luoxue-victor/learn_webpack/commit/73abf42 ) )
12
+ * ** feat:** asdada ([ 64090c7 ] ( https://github.com/luoxue-victor/learn_webpack/commit/64090c7 ) )
12
13
* ** init:** 项目初始化 ([ d7835fb] ( https://github.com/luoxue-victor/learn_webpack/commit/d7835fb ) )
13
14
* ** webpack:** webpack配置 ([ 9a1d29c] ( https://github.com/luoxue-victor/learn_webpack/commit/9a1d29c ) )
14
15
* 你好 ([ 6e534da] ( https://github.com/luoxue-victor/learn_webpack/commit/6e534da ) )
15
16
* asasdasasd ([ 8f9515f] ( https://github.com/luoxue-victor/learn_webpack/commit/8f9515f ) )
16
17
* asd ([ d278787] ( https://github.com/luoxue-victor/learn_webpack/commit/d278787 ) )
17
- * ** feat:** asdada ([ 64090c7 ] ( https://github.com/luoxue-victor/learn_webpack/commit/64090c7 ) )
18
+ * ** feat:** aaaaa ([ 73abf42 ] ( https://github.com/luoxue-victor/learn_webpack/commit/73abf42 ) )
18
19
19
20
20
21
### 🐛 Bug 修复
Original file line number Diff line number Diff line change @@ -606,4 +606,54 @@ dist/app.css
606
606
background : green ;
607
607
height : 26.66667vw ;
608
608
}
609
+ ```
610
+
611
+ ### 配置 autoprefixer
612
+
613
+ 自动添加 css 前缀
614
+
615
+ postcss.config.js
616
+
617
+ ``` js
618
+ module .exports = {
619
+ plugins: {
620
+ autoprefixer: {
621
+ overrideBrowserslist: [
622
+ ' > 1%' ,
623
+ ' last 3 versions' ,
624
+ ' iOS >= 8' ,
625
+ ' Android >= 4' ,
626
+ ' Chrome >= 40'
627
+ ]
628
+ }
629
+ }
630
+ }
631
+ ```
632
+
633
+ 效果
634
+
635
+ ``` css
636
+ /* index.css */
637
+ .test {
638
+ width : 200px ;
639
+ height : 200px ;
640
+ color : red ;
641
+ display : flex ;
642
+ background-color : orange ;
643
+ }
644
+ ```
645
+ 转换后
646
+
647
+ ``` css
648
+ /* index.css */
649
+ .test {
650
+ width : 26.66667vw ;
651
+ height : 26.66667vw ;
652
+ color : red ;
653
+ display : -webkit-box ;
654
+ display : -webkit-flex ;
655
+ display : -ms-flexbox ;
656
+ display : flex ;
657
+ background-color : orange ;
658
+ }
609
659
```
Original file line number Diff line number Diff line change 3
3
width : 26.66667vw ;
4
4
height : 26.66667vw ;
5
5
color : red;
6
+ display : -webkit-box;
7
+ display : -webkit-flex;
8
+ display : -ms-flexbox;
9
+ display : flex;
6
10
background-color : orange;
7
11
}
8
12
/* app.css */
Original file line number Diff line number Diff line change 35
35
"less" : " ^3.10.3" ,
36
36
"less-loader" : " ^5.0.0" ,
37
37
"ora" : " ^4.0.3" ,
38
- "postcss-loader" : " ^3.0.0" ,
39
38
"rimraf" : " ^3.0.0" ,
40
39
"sass" : " ^1.23.7" ,
41
40
"sass-loader" : " ^8.0.0" ,
44
43
"webpack-dashboard" : " ^3.2.0"
45
44
},
46
45
"devDependencies" : {
46
+ "autoprefixer" : " ^9.7.2" ,
47
47
"commitizen" : " ^4.0.3" ,
48
48
"commitlint" : " ^8.2.0" ,
49
49
"conventional-changelog-cli" : " ^2.0.28" ,
52
52
"html-webpack-plugin" : " ^3.2.0" ,
53
53
"husky" : " ^3.1.0" ,
54
54
"mini-css-extract-plugin" : " ^0.8.0" ,
55
+ "postcss-loader" : " ^3.0.0" ,
55
56
"postcss-px-to-viewport" : " ^1.1.1" ,
56
57
"vue-cli-plugin-commitlint" : " ^1.0.4" ,
57
58
"webpack-chain" : " ^6.0.0" ,
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
plugins : {
3
+ autoprefixer : {
4
+ overrideBrowserslist : [
5
+ '> 1%' ,
6
+ 'last 3 versions' ,
7
+ 'iOS >= 8' ,
8
+ 'Android >= 4' ,
9
+ 'Chrome >= 40'
10
+ ]
11
+ } ,
3
12
'postcss-px-to-viewport' : {
4
13
unitToConvert : 'px' ,
5
14
viewportWidth : 750 ,
Original file line number Diff line number Diff line change 3
3
width : 200px ;
4
4
height : 200px ;
5
5
color : red;
6
+ display : flex;
6
7
background-color : orange;
7
8
}
You can’t perform that action at this time.
0 commit comments