This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
74 lines (64 loc) · 1.72 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* Robots-JU FLL 2016 Scoreboard
* @author Clark Winkelmann <[email protected]>
* @license MIT
*/
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var fileinclude = require('gulp-file-include');
var bower_path = './bower_components/';
var node_path = './node_modules/';
var src_path = './src/';
var dest_path = './site/';
var assets_dest_path = dest_path + 'assets/';
gulp.task('scripts', function() {
return gulp.src([
node_path + 'react/dist/react-with-addons.min.js',
node_path + 'react-dom/dist/react-dom.min.js',
bower_path + 'fll-robotgame-scorer-2016/src/scorer.js',
src_path + 'js/*.js'
])
.pipe(concat('script.js'))
.pipe(fileinclude({
prefix: '@@',
basepath: src_path + 'data/'
}))
.pipe(uglify())
.pipe(gulp.dest(assets_dest_path));
});
gulp.task('styles', function() {
return gulp.src([
src_path + 'scss/*.scss'
])
.pipe(sass({
outputStyle: 'compressed',
includePaths: [bower_path + 'font-awesome/scss']
}))
.pipe(concat('style.css'))
.pipe(gulp.dest(assets_dest_path));
});
gulp.task('images', function() {
return gulp.src([
src_path + 'img/*.jpg',
src_path + 'img/*.png'
])
.pipe(gulp.dest(assets_dest_path));
});
gulp.task('icons', function() {
return gulp.src([
bower_path + 'font-awesome/fonts/**.*'
])
.pipe(gulp.dest(assets_dest_path));
});
gulp.task('html', function() {
return gulp.src([
src_path + 'html/*.html'
])
.pipe(gulp.dest(dest_path));
});
gulp.task('default', ['scripts', 'styles', 'images', 'icons', 'html']);
gulp.task('watch', ['default'], function() {
gulp.watch(src_path + '**/*', ['default']);
});