-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
51 lines (42 loc) · 955 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const gulp = require('gulp');
const cleanCss = require('gulp-clean-css');
const uglify = require('gulp-uglify');
const nodemon = require('gulp-nodemon');
const del = require('del');
const paths = {
styles: {
src: 'public/stylesheets/**/*.css',
dest: 'assets/styles/'
},
scripts: {
src: 'public/javascripts/**/*.js',
dest: 'assets/scripts/'
}
};
function clean() {
return del(['assets']);
}
function styles() {
return gulp.src(paths.styles.src)
.pipe(cleanCss())
.pipe(gulp.dest(paths.styles.dest));
}
function scripts() {
return gulp.src(paths.scripts.src)
.pipe(uglify())
.pipe(gulp.dest(paths.scripts.dest));
}
const build = gulp.series(clean, gulp.parallel(styles, scripts));
gulp.task('nodemon', function() {
return nodemon({
tasks: ['build']
});
});
gulp.task('dev', gulp.series(build, 'nodemon'));
gulp.task('default', build);
module.exports = {
build,
clean,
styles,
scripts
};