Skip to content

Instantly share code, notes, and snippets.

@webberig
Created July 1, 2018 13:08
Show Gist options
  • Save webberig/924df3c5a20a6bbe30344aad964f75b6 to your computer and use it in GitHub Desktop.
Save webberig/924df3c5a20a6bbe30344aad964f75b6 to your computer and use it in GitHub Desktop.
Gulp configuration for using Nucleus (with browser sync)
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