-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
30 lines (26 loc) · 697 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
const gulp = require('gulp');
const minifyJS = require('gulp-minify');
const cleanCSS = require('gulp-clean-css');
const rename = require('gulp-rename');
const path = {
js: 'app/js/*.js',
css: 'app/css/main.css'
};
// JS main minified
gulp.task('minify-js', () => {
return gulp.src(path.js)
.pipe(minifyJS())
.pipe(gulp.dest('public/js'));
});
// CSS main minified
gulp.task('minify-css', () => {
return gulp.src(path.css)
.pipe(cleanCSS())
.pipe(rename('main.min.css'))
.pipe(gulp.dest('public/css'));
});
// Listening to changes
gulp.task('default', () => {
gulp.watch(path.js, gulp.series('minify-js'));
gulp.watch(path.css, gulp.series('minify-css'));
});