31 lines
925 B
JavaScript
31 lines
925 B
JavaScript
|
const gulp = require('gulp');
|
||
|
const sass = require('gulp-sass')(require('node-sass'));
|
||
|
const coffee = require('gulp-coffee');
|
||
|
const nodemon = require('gulp-nodemon');
|
||
|
|
||
|
gulp.task('styles', function() {
|
||
|
return gulp.src('public/stylesheets/*.sass')
|
||
|
.pipe(sass({indentedSyntax: true}).on('error', sass.logError))
|
||
|
.pipe(gulp.dest('public/stylesheets/'));
|
||
|
});
|
||
|
|
||
|
gulp.task('coffee', function() {
|
||
|
return gulp.src('public/scripts/*.coffee')
|
||
|
.pipe(coffee({bare: true}))
|
||
|
.pipe(gulp.dest('public/scripts/'));
|
||
|
});
|
||
|
|
||
|
exports.watch = function() {
|
||
|
// rerun asset compilation as needed
|
||
|
gulp.watch(['public/stylesheets/*.sass'], { ignoreInitial: false }, gulp.series('styles'));
|
||
|
gulp.watch(['public/scripts/*.coffee'], { ignoreInitial: false }, gulp.series('coffee'));
|
||
|
|
||
|
// start the node server through nodemon
|
||
|
nodemon({
|
||
|
script: 'index.js',
|
||
|
config: 'nodemon.json'
|
||
|
});
|
||
|
};
|
||
|
|
||
|
exports.default = exports.watch;
|