Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var sassPaths = [];
gulp.task('sass', function() {
return gulp.src('scss/app.scss')
.pipe($.sourcemaps.init())
.pipe($.sass({
includePaths: sassPaths,
outputStyle: 'expanded' // compressed or use expanded for dev
})
.on('error', $.sass.logError))
.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('css'));
});
gulp.task('minify-css', function() {
return gulp.src('css/app.css')
.pipe($.cleanCss())
.pipe($.rename({suffix: '.min'}))
.pipe(gulp.dest('css'));
});
gulp.task('default', ['sass'], function() {
gulp.watch(['scss/**/*.scss'], ['sass']);
});
gulp.task('build', ['sass', 'minify-css'], function() {
console.log('Building minified css files');
});
{
"name": "",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"scripts": {
"start": "gulp",
"build": "gulp build"
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "",
"bugs": {
"url": ""
},
"homepage": "",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.1.0",
"gulp-load-plugins": "^1.5.0",
"gulp-sass": "^3.1.0",
"normalize.css": "^7.0.0",
"gulp-clean-css": "^3.9.2",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^2.6.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.