Skip to content

Commit

Permalink
Merge pull request #1 from postcss/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
alkorlos committed Nov 1, 2020
2 parents 5f92ee0 + 94170d6 commit a073cf4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,7 +1,8 @@
sudo: false
language: node_js
node_js:
- stable
- 6
- node
- "12"
- "10"
after_success:
- "npm run coveralls"
31 changes: 30 additions & 1 deletion README.md
Expand Up @@ -8,7 +8,7 @@ several plugins, but parse CSS only once.

## Install

$ npm install --save-dev gulp-postcss
$ npm install --save-dev postcss gulp-postcss

Install required [postcss plugins](https://www.npmjs.com/browse/keyword/postcss-plugin) separately. E.g. for autoprefixer, you need to install [autoprefixer](https://github.com/postcss/autoprefixer) package.

Expand Down Expand Up @@ -48,6 +48,30 @@ gulp.task('css', function () {
});
```

## Using with .pcss extension

For using gulp-postcss to have input files in .pcss format and get .css output need additional library like gulp-rename.

```js
var postcss = require('gulp-postcss');
var gulp = require('gulp');
const rename = require('gulp-rename');

gulp.task('css', function () {
return gulp.src('./src/*.pcss')
.pipe(postcss())
.pipe(rename({
extname: '.css'
}))
.pipe(gulp.dest('./dest'));
});
```

This is done for more explicit transformation. According to [gulp plugin guidelines](https://github.com/gulpjs/gulp/blob/master/docs/writing-a-plugin/guidelines.md#guidelines)

> Your plugin should only do one thing, and do it well.

## Passing additional options to PostCSS

The second optional argument to gulp-postcss is passed to PostCSS.
Expand Down Expand Up @@ -169,6 +193,11 @@ module.exports = function (ctx) {

## Changelog

* 9.0.0
* Bump PostCSS to 8.0
* Drop Node 6 support
* PostCSS is now a peer dependency

* 8.0.0
* Bump PostCSS to 7.0
* Drop Node 4 support
Expand Down
11 changes: 7 additions & 4 deletions package.json
Expand Up @@ -13,11 +13,11 @@
"all": true,
"check-coverage": true
},
"version": "8.0.0",
"version": "9.0.0",
"description": "PostCSS gulp plugin",
"main": "index.js",
"engines": {
"node": ">=6"
"node": "^10 || ^12 || >=14"
},
"scripts": {
"coveralls": "coveralls < coverage/lcov.info",
Expand All @@ -43,8 +43,7 @@
"dependencies": {
"fancy-log": "^1.3.3",
"plugin-error": "^1.0.1",
"postcss": "^7.0.14",
"postcss-load-config": "^2.0.0",
"postcss-load-config": "^2.1.1",
"vinyl-sourcemaps-apply": "^0.2.1"
},
"devDependencies": {
Expand All @@ -53,8 +52,12 @@
"gulp-sourcemaps": "^2.6.5",
"mocha": "^5.2.0",
"nyc": "^12.0.2",
"postcss": "^8.0.0",
"proxyquire": "^2.1.0",
"sinon": "^6.3.5",
"vinyl": "^2.2.0"
},
"peerDependencies": {
"postcss": "^8.0.0"
}
}

0 comments on commit a073cf4

Please sign in to comment.