-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
38 lines (34 loc) · 1.16 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
const gulp = require('gulp');
const watch = require('gulp-watch');
const imagemin = require('gulp-imagemin');
const sass = require('gulp-sass');
const clean = require('gulp-clean-css');
const sourcemaps = require('gulp-sourcemaps');
const uglify = require('gulp-uglify');
const minify = require('gulp-minify-css');
const concat = require('gulp-concat');
const babel = require('gulp-babel');
gulp.task('default', () => {
gulp.src('./assets/css/*')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(clean())
.pipe(sourcemaps.write())
.pipe(minify())
.pipe(gulp.dest('./database-backups/assets/css/'));
gulp.src(['./assets/js/*.js', '!./assets/js/vendor/**/*.js'])
.pipe(sourcemaps.init())
.pipe(babel({
presets: ['env'],
}))
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./database-backups/assets/js'));
// gulp.src('./assets/image/**/*')
// .pipe(imagemin())
// .pipe(gulp.dest('./database-backups/assets/image'));
});
gulp.task('watch',function(){
gulp.watch(['./assets/js/*.js', '!./assets/js/vendor/**/*.js','./assets/css/*'], ['default']);
});