Created
October 24, 2014 19:06
-
-
Save vladimirsiljkovic/26200a8d2f6aae082817 to your computer and use it in GitHub Desktop.
gulp + node-sass + rework + autoprefixer
This file contains hidden or 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 sass = require('gulp-sass'); | |
var rework = require('gulp-rework'); | |
var inline = require('rework-plugin-inline'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
gulp.task('default', function () { | |
gulp.src('*.scss') | |
.pipe(sass({ // SASS will just ignore rework functions such as inline() but will print them out | |
onSuccess: function(css){ | |
console.log(css); | |
}, | |
onError: function(error) { | |
console.log(error); | |
} | |
})) | |
.pipe(rework(inline('images/', 'fonts/'))) // starts working with CSS file created by SASS | |
.pipe(autoprefixer({ | |
browsers: ['last 2 versions'] | |
})) | |
.pipe(gulp.dest('dist')); | |
}); |
This file contains hidden or 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": "test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"gulp": "^3.8.9", | |
"gulp-sass": "^1.2.0", | |
"gulp-autoprefixer": "^1.0.1", | |
"gulp-rework": "^1.0.2", | |
"rework-plugin-inline": "^1.0.1" | |
} | |
} |
This file contains hidden or 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
a { | |
color: green; | |
background: inline('npm.png'); | |
p { | |
color: green; | |
display: flex; | |
} | |
} | |
div { | |
@extend a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment