Created
October 23, 2015 12:55
-
-
Save cikoriicabachkov/5d4aa18dd30b4717d3f9 to your computer and use it in GitHub Desktop.
Postcss startup files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); | |
var autoprefixer = require('autoprefixer'); | |
var precss = require('precss'); | |
var cssnano = require('cssnano'); | |
var watch = require('gulp-watch'); | |
gulp.task('css', function () { | |
var processors = [ | |
autoprefixer, | |
precss, | |
cssnano | |
]; | |
return gulp.src('./src/*.css') | |
.pipe(postcss(processors)) | |
.pipe(gulp.dest('./dest')); | |
}); | |
gulp.task('watch', function(){ | |
watch(['./src/*.css'], function(event, cb) { | |
gulp.start('css'); | |
}); | |
}); | |
gulp.task('default', ['watch']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "postcss-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"devDependencies": { | |
"autoprefixer": "^6.0.3", | |
"cssnano": "^3.3.1", | |
"gulp": "^3.9.0", | |
"gulp-postcss": "^6.0.1", | |
"gulp-watch": "^4.3.5", | |
"precss": "^1.3.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install all npm modules by
npm install
, rungulp
.