-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (45 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
48
49
50
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const sass = require('gulp-sass');
const cleanCSS = require('gulp-clean-css');
const flatten = require('gulp-flatten');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
function javascript() {
return gulp.src([
'node_modules/jquery/dist/jquery.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/jplayer/dist/jplayer/jquery.jplayer.js',
'node_modules/typeahead.js/dist/typeahead.bundle.js',
'src/js/clippy.js',
'src/js/sndtst.js'], { base: '.' })
.pipe(uglify())
.pipe(concat('sndtst.min.js'))
.pipe(gulp.dest('static/js/'));
}
function css() {
return gulp.src('src/style/sndtst.scss')
.pipe(sass({
paths: [ '.' ]
}))
.pipe(cleanCSS())
.pipe(rename('sndtst.min.css'))
.pipe(gulp.dest('static/css/'));
}
function jplayer() {
return gulp.src([
'node_modules/jplayer/dist/jplayer/*.swf'], { base: './' })
.pipe(flatten())
.pipe(gulp.dest('static/js/'));
}
function fonts() {
return gulp.src([
'node_modules/font-awesome/fonts/*'], { base: './' })
.pipe(flatten())
.pipe(gulp.dest('static/fonts/'));
}
exports.default = gulp.series(javascript, css, fonts, jplayer);
exports.watch = function() {
gulp.watch(['src/js/*.js', 'src/css/*.scss'], gulp.series(javascript, css, fonts));
}