You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ several plugins, but parse CSS only once.
8
8
9
9
## Install
10
10
11
-
$ npm install --save-dev gulp-postcss
11
+
$ npm install --save-dev postcss gulp-postcss
12
12
13
13
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.
14
14
@@ -48,6 +48,30 @@ gulp.task('css', function () {
48
48
});
49
49
```
50
50
51
+
## Using with .pcss extension
52
+
53
+
For using gulp-postcss to have input files in .pcss format and get .css output need additional library like gulp-rename.
54
+
55
+
```js
56
+
var postcss =require('gulp-postcss');
57
+
var gulp =require('gulp');
58
+
constrename=require('gulp-rename');
59
+
60
+
gulp.task('css', function () {
61
+
returngulp.src('./src/*.pcss')
62
+
.pipe(postcss())
63
+
.pipe(rename({
64
+
extname:'.css'
65
+
}))
66
+
.pipe(gulp.dest('./dest'));
67
+
});
68
+
```
69
+
70
+
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)
71
+
72
+
> Your plugin should only do one thing, and do it well.
73
+
74
+
51
75
## Passing additional options to PostCSS
52
76
53
77
The second optional argument to gulp-postcss is passed to PostCSS.
@@ -169,6 +193,11 @@ module.exports = function (ctx) {
0 commit comments