-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (29 loc) · 898 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const gulp = require("gulp");
const sass = require('gulp-sass');
const nodemon = require('gulp-nodemon');
const imagemin = require('gulp-imagemin');
const livereload = require('gulp-livereload');
livereload({ start: true });
gulp.task('default', ['watch', "imagemin", "nodemon"]);
gulp.task('sass', function () {
return gulp.src('./src/sass/style.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(gulp.dest('./public/stylesheets'))
.pipe(livereload());
});
gulp.task('watch', function () {
livereload.listen();
gulp.watch('./src/sass/**/*.scss', ['sass']);
});
gulp.task('imagemin', () =>
gulp.src('./src/images/*')
.pipe(imagemin())
.pipe(gulp.dest('./public/images'))
);
gulp.task('nodemon', function () {
nodemon({
script: './bin/www'
, ext: 'js pug'
, env: { 'NODE_ENV': 'development' }
})
});