-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (41 loc) · 1.41 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
44
45
46
47
(() => {
'use strict';
const gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
minify = require('gulp-minify-css'),
livereload = require('gulp-livereload'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify');
// CSS
const cssFiles = ['./node_modules/bootstrap/dist/css/bootstrap.min.css',
'./node_modules/lightbox2/dist/css/lightbox.min.css',
'./sources/css/**/*.scss'];
gulp.task('sass', () => {
return gulp.src(cssFiles)
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(concat('./sources/css/styles.css'))
.pipe(minify())
.pipe(gulp.dest('./'))
.pipe(livereload({ quiet: true }));
});
// JS
const jsFiles = [
'./node_modules/prefixfree/prefixfree.min.js',
'./node_modules/conic-gradient/conic-gradient.js',
'./node_modules/lightbox2/dist/js/lightbox-plus-jquery.min.js'];
gulp.task('js-modules', () => {
return gulp.src(jsFiles)
.pipe(concat('modules.js'))
.pipe(gulp.dest('./sources/js/'))
.pipe(rename('modules.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./sources/js/'));
});
// Defaults and Watchers
gulp.task('watch', () => {
livereload.listen({ quiet: true });
gulp.watch('./sources/css/**/*.scss', gulp.series('sass'));
});
gulp.task('default', gulp.series(gulp.parallel('sass', 'js-modules')));
})();