Skip to content

Commit

Permalink
Add PostCSS and autoprefixer
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsde committed Oct 5, 2017
1 parent 4ce285c commit b051cb5
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 deletions.
10 changes: 10 additions & 0 deletions build/webpack.build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,22 @@ module.exports = (cwd) => {
{
loader: 'css-loader',
options: {
importLoaders: 2,
minimize: {
safe: true
},
sourceMap: true
}
},
{
loader: 'postcss-loader',
options: {
config: {
path: path.resolve(cwd, 'postcss.config.js')
},
sourceMap: true
}
},
{
loader: 'sass-loader',
options: {
Expand Down
15 changes: 14 additions & 1 deletion build/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,24 @@ module.exports = (cwd) => {
],
use: [
{
loader: 'style-loader'
loader: 'style-loader',
options: {
sourceMap: true
}
},
{
loader: 'css-loader',
options: {
importLoaders: 2,
sourceMap: true
}
},
{
loader: 'postcss-loader',
options: {
config: {
path: path.resolve(cwd, 'postcss.config.js')
},
sourceMap: true
}
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"imagemin-webpack-plugin": "^1.5.2",
"node-sass": "^4.5.3",
"nunjucks": "^3.0.1",
"postcss-loader": "^2.0.6",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"stylelint-webpack-plugin": "^0.9.0",
Expand All @@ -68,6 +69,7 @@
"webpack-hot-middleware": "^2.19.1"
},
"devDependencies": {
"autoprefixer": "^7.1.4",
"ava": "^0.22.0",
"babel-plugin-istanbul": "^4.1.5",
"babel-preset-env": "^1.6.0",
Expand Down
5 changes: 5 additions & 0 deletions test/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
'autoprefixer': {}
}
}
48 changes: 46 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ autoprefixer@^6.3.1:
postcss "^5.2.16"
postcss-value-parser "^3.2.3"

autoprefixer@^7.1.2:
autoprefixer@^7.1.2, autoprefixer@^7.1.4:
version "7.1.4"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.1.4.tgz#960847dbaa4016bc8e8e52ec891cbf8f1257a748"
dependencies:
Expand Down Expand Up @@ -1893,7 +1893,7 @@ [email protected], core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"

cosmiconfig@^2.1.3:
cosmiconfig@^2.1.0, cosmiconfig@^2.1.1, cosmiconfig@^2.1.3:
version "2.2.2"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-2.2.2.tgz#6173cebd56fac042c1f4390edf7af6c07c7cb892"
dependencies:
Expand Down Expand Up @@ -5670,6 +5670,38 @@ postcss-less@^1.1.0:
dependencies:
postcss "^5.2.16"

postcss-load-config@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-1.2.0.tgz#539e9afc9ddc8620121ebf9d8c3673e0ce50d28a"
dependencies:
cosmiconfig "^2.1.0"
object-assign "^4.1.0"
postcss-load-options "^1.2.0"
postcss-load-plugins "^2.3.0"

postcss-load-options@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/postcss-load-options/-/postcss-load-options-1.2.0.tgz#b098b1559ddac2df04bc0bb375f99a5cfe2b6d8c"
dependencies:
cosmiconfig "^2.1.0"
object-assign "^4.1.0"

postcss-load-plugins@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/postcss-load-plugins/-/postcss-load-plugins-2.3.0.tgz#745768116599aca2f009fad426b00175049d8d92"
dependencies:
cosmiconfig "^2.1.1"
object-assign "^4.1.0"

postcss-loader@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-2.0.6.tgz#8c7e0055a3df1889abc6bad52dd45b2f41bbc6fc"
dependencies:
loader-utils "^1.1.0"
postcss "^6.0.2"
postcss-load-config "^1.2.0"
schema-utils "^0.3.0"

postcss-media-query-parser@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz#27b39c6f4d94f81b1a73b8f76351c609e5cef244"
Expand Down Expand Up @@ -5885,6 +5917,14 @@ postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.3, postcss@^6.0.6,
source-map "^0.5.7"
supports-color "^4.4.0"

postcss@^6.0.2:
version "6.0.13"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.13.tgz#b9ecab4ee00c89db3ec931145bd9590bbf3f125f"
dependencies:
chalk "^2.1.0"
source-map "^0.6.1"
supports-color "^4.4.0"

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down Expand Up @@ -6686,6 +6726,10 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, sour
version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"

source-map@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"

sparkles@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3"
Expand Down

0 comments on commit b051cb5

Please sign in to comment.