forked from mrvautin/expressCart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (39 loc) · 1.18 KB
/
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
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const minify = require('gulp-minify');
const rename = require('gulp-rename');
gulp.task('compressJS', () => {
return gulp.src(['public/javascripts/*.js', '!public/javascripts/*.min.js'])
.pipe(minify({
ext: {
src: '.js',
min: '.min.js'
}
}))
.pipe(gulp.dest('public/javascripts'));
});
gulp.task('compressCss', () => {
return gulp.src(['public/stylesheets/*.css',
'!public/stylesheets/*.min.css'
])
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(rename({
dirname: 'public/stylesheets',
extname: '.min.css'
}))
.pipe(gulp.dest('./'));
});
gulp.task('compressThemeCss', () => {
return gulp.src(['views/themes/**/*.css',
'!views/themes/**/*.min.css'
])
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('views/themes/'));
});
// run the tasks
gulp.task('deploy', gulp.series('compressJS', 'compressCss', 'compressThemeCss', (done) => {
done();
}));