-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
33 lines (28 loc) · 951 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
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const paths = {
scssCore : ['css/scss/**/*.scss', 'css/'],
jsBackend: ['js/dolicar.js', 'js/modules/*.js']
};
/** Core */
gulp.task('scssCore', function() {
return gulp.src(paths.scssCore[0])
.pipe(sass({outputStyle: 'compressed'}, '').on('error', sass.logError))
.pipe(rename('./dolicar.min.css'))
.pipe(gulp.dest(paths.scssCore[1]));
});
gulp.task('jsBackend', function () {
return gulp.src(paths.jsBackend)
.pipe(concat('dolicar.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./js/')); // It will create folder client.min.js
});
/** Watch */
gulp.task('default', function() {
gulp.watch(paths.scssCore[0], gulp.series('scssCore'));
gulp.watch(paths.jsBackend[1], gulp.series('jsBackend'));
});