Created
April 16, 2018 20:24
-
-
Save kgoedecke/f3b02e7c7ae4e4e96f1915b77b57e188 to your computer and use it in GitHub Desktop.
Very simple Gulp 4.0 file to watch and run SASS
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 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')); | |
}); |
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": "gulp-example", | |
"version": "1.0.0", | |
"description": "Very Simple Gulp File", | |
"main": "index.js", | |
"repository": "github.com/kgoedecke", | |
"author": "Kevin Goedecke <[email protected]>", | |
"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