Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit 3a62a49

Browse files
committed
add autoprefixer
1 parent 4d7ff45 commit 3a62a49

File tree

4 files changed

+70
-1
lines changed

4 files changed

+70
-1
lines changed

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"@types/serialize-javascript": "1.5.0",
8080
"@types/webpack": "4.4.19",
8181
"@types/webpack-env": "1.13.6",
82+
"autoprefixer": "9.3.1",
8283
"babel-loader": "8.0.4",
8384
"babel-plugin-transform-react-remove-prop-types": "0.4.20",
8485
"concurrently": "4.0.1",
@@ -92,6 +93,7 @@
9293
"mini-css-extract-plugin": "0.4.4",
9394
"node-sass": "4.10.0",
9495
"nodemon": "1.18.6",
96+
"postcss-loader": "3.0.0",
9597
"rimraf": "2.6.2",
9698
"robotstxt-webpack-plugin": "4.0.1",
9799
"sass-loader": "7.1.0",

postcss.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: {
3+
'autoprefixer': {}
4+
}
5+
};

webpack.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const HtmlWebpackHardDiskPlugin = require('html-webpack-harddisk-plugin');
88
const WriteFilePlugin = require('write-file-webpack-plugin');
99
const RobotstxtPlugin = require('robotstxt-webpack-plugin').default;
1010
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
11+
const autoprefixer = require('autoprefixer');
1112
const pkg = require('./package.json');
1213

1314
const PORT = process.env.PORT || 3000;
@@ -70,6 +71,12 @@ const webpackConfig = {
7071
sourceMap: !isProduction
7172
},
7273
},
74+
{
75+
loader: 'postcss-loader',
76+
options: {
77+
sourceMap: !isProduction
78+
},
79+
},
7380
{
7481
loader: 'sass-loader',
7582
options: {
@@ -103,6 +110,14 @@ const webpackConfig = {
103110
: 'assets/styles/[name].[hash].css',
104111
}),
105112

113+
new webpack.LoaderOptionsPlugin({
114+
options: {
115+
postcss: [
116+
autoprefixer()
117+
]
118+
}
119+
}),
120+
106121
isDevelopment
107122
? new webpack.HotModuleReplacementPlugin() // enable HMR globally
108123
: null,

yarn.lock

+48-1
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ atob@^2.1.1:
14731473
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
14741474
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
14751475

1476-
autoprefixer@^9.0.0:
1476+
autoprefixer@9.3.1, autoprefixer@^9.0.0:
14771477
version "9.3.1"
14781478
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.3.1.tgz#71b622174de2b783d5fd99f9ad617b7a3c78443e"
14791479
integrity sha512-DY9gOh8z3tnCbJ13JIWaeQsoYncTGdsrgCceBaQSIL4nvdrLxgbRSBPevg2XbX7u4QCSfLheSJEEIUUSlkbx6Q==
@@ -2427,6 +2427,16 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
24272427
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
24282428
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
24292429

2430+
cosmiconfig@^4.0.0:
2431+
version "4.0.0"
2432+
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc"
2433+
integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ==
2434+
dependencies:
2435+
is-directory "^0.3.1"
2436+
js-yaml "^3.9.0"
2437+
parse-json "^4.0.0"
2438+
require-from-string "^2.0.1"
2439+
24302440
cosmiconfig@^5.0.0:
24312441
version "5.0.7"
24322442
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.7.tgz#39826b292ee0d78eda137dfa3173bd1c21a43b04"
@@ -4333,6 +4343,13 @@ immutable@^3.8.1:
43334343
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
43344344
integrity sha1-wkOZUUVbs5kT2vKBN28VMOEErfM=
43354345

4346+
import-cwd@^2.0.0:
4347+
version "2.1.0"
4348+
resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9"
4349+
integrity sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=
4350+
dependencies:
4351+
import-from "^2.1.0"
4352+
43364353
import-fresh@^2.0.0:
43374354
version "2.0.0"
43384355
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
@@ -4341,6 +4358,13 @@ import-fresh@^2.0.0:
43414358
caller-path "^2.0.0"
43424359
resolve-from "^3.0.0"
43434360

4361+
import-from@^2.1.0:
4362+
version "2.1.0"
4363+
resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1"
4364+
integrity sha1-M1238qev/VOqpHHUuAId7ja387E=
4365+
dependencies:
4366+
resolve-from "^3.0.0"
4367+
43444368
import-lazy@^2.1.0:
43454369
version "2.1.0"
43464370
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
@@ -6554,6 +6578,24 @@ postcss-less@^3.0.1:
65546578
dependencies:
65556579
postcss "^7.0.3"
65566580

6581+
postcss-load-config@^2.0.0:
6582+
version "2.0.0"
6583+
resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.0.0.tgz#f1312ddbf5912cd747177083c5ef7a19d62ee484"
6584+
integrity sha512-V5JBLzw406BB8UIfsAWSK2KSwIJ5yoEIVFb4gVkXci0QdKgA24jLmHZ/ghe/GgX0lJ0/D1uUK1ejhzEY94MChQ==
6585+
dependencies:
6586+
cosmiconfig "^4.0.0"
6587+
import-cwd "^2.0.0"
6588+
6589+
postcss-loader@3.0.0:
6590+
version "3.0.0"
6591+
resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d"
6592+
integrity sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==
6593+
dependencies:
6594+
loader-utils "^1.1.0"
6595+
postcss "^7.0.0"
6596+
postcss-load-config "^2.0.0"
6597+
schema-utils "^1.0.0"
6598+
65576599
postcss-markdown@^0.34.0:
65586600
version "0.34.0"
65596601
resolved "https://registry.yarnpkg.com/postcss-markdown/-/postcss-markdown-0.34.0.tgz#7a043e6eee3ab846a4cefe3ab43d141038e2da79"
@@ -7390,6 +7432,11 @@ require-directory@^2.1.1:
73907432
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
73917433
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
73927434

7435+
require-from-string@^2.0.1:
7436+
version "2.0.2"
7437+
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
7438+
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
7439+
73937440
require-main-filename@^1.0.1:
73947441
version "1.0.1"
73957442
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"

0 commit comments

Comments
 (0)