Skip to content

Instantly share code, notes, and snippets.

@kgoedecke
Created April 16, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgoedecke/f3b02e7c7ae4e4e96f1915b77b57e188 to your computer and use it in GitHub Desktop.
Save kgoedecke/f3b02e7c7ae4e4e96f1915b77b57e188 to your computer and use it in GitHub Desktop.
Very simple Gulp 4.0 file to watch and run SASS
var gulp = require('gulp');
var sass = require('gulp-sass');
var sassConfig = {
inputDirectory: 'scss/**/*.scss',
outputDirectory: 'css',
options: {
outputStyle: 'expanded'
}
}
gulp.task('build-css', function() {
return gulp
.src(sassConfig.inputDirectory)
.pipe(sass(sassConfig.options).on('error', sass.logError))
.pipe(gulp.dest(sassConfig.outputDirectory));
});
gulp.task('watch', function() {
gulp.watch('scss/**/*.scss', gulp.series('build-css'));
});
{
"name": "gulp-example",
"version": "1.0.0",
"description": "Very Simple Gulp File",
"main": "index.js",
"repository": "github.com/kgoedecke",
"author": "Kevin Goedecke <goedecke@net-studios.de>",
"license": "MIT",
"devDependencies": {
"gulp": "^4.0.0"
},
"dependencies": {
"gulp-sass": "^4.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment