Created
July 1, 2018 13:08
-
-
Save webberig/924df3c5a20a6bbe30344aad964f75b6 to your computer and use it in GitHub Desktop.
Gulp configuration for using Nucleus (with browser sync)
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
const gulp = require('gulp'); | |
const sass = require('gulp-sass'); | |
const run = require('gulp-run'); | |
const browserSync = require('browser-sync').create(); | |
gulp.task('css', function () { | |
return gulp.src('src/style.scss') | |
.pipe(sass()) | |
.pipe(gulp.dest('styleguide/css')); | |
}); | |
gulp.task('nucleus', function() { | |
return run('nucleus').exec(); | |
}); | |
gulp.task('build', ['css', 'nucleus']); | |
gulp.task('default', ['build', 'serve']); | |
// Start Browser sync | |
gulp.task('serve', function() { | |
// Watch .scss files | |
gulp.watch('src/**/*.scss', ['css', 'nucleus']).on('change', browserSync.reload); | |
browserSync.init({ | |
server: { | |
baseDir: "./styleguide" | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment