-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
113 lines (95 loc) · 3.48 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
var gulp = require('gulp');
var glibs = require('gulp-load-plugins')({
pattern: ['gulp-*', 'gulp.*', 'main-bower-files'],
camelize: true,
});
var path = require('path');
var tinylr = require('tiny-lr');
var server = tinylr();
var livereload = require('gulp-livereload');
var compass = require('gulp-compass');
var csso = require('gulp-csso');
var cleanCSS = require('gulp-clean-css');
var rename = require("gulp-rename");
var SegfaultHandler = require('segfault-handler');
SegfaultHandler.registerHandler();
gulp.task('watch', function () {
server.listen(35729, function (err) {
if (err) {
return console.log(err);
}
gulp.watch('static/scss/**/*.scss', ['css']);
gulp.watch('static/js-src/**/*.js', ['js']);
});
});
gulp.task('fonts', function() {
return gulp
.src(path.join(__dirname, 'node_modules', 'font-awesome', 'fonts/*'))
.pipe(gulp.dest('static/fonts/'))
.pipe( livereload(server));
});
gulp.task('js', function() {
var project_js_files = [
'./node_modules/jquery/dist/jquery.js',
'./static/js-src/libs/jquery-ui.js',
'./node_modules/underscore/underscore.js',
'./node_modules/underscore.string/lib/underscore.string.js',
'./node_modules/backbone/backbone.js',
'./node_modules/backbone.radio/build/backbone.radio.js',
'./node_modules/backbone-relational/backbone-relational.js',
'./node_modules/backbone.marionette/lib/backbone.marionette.js',
'./node_modules/tether/dist/js/tether.js',
'./node_modules/bootstrap/dist/js/bootstrap.js',
'./node_modules/d3/d3.js',
'./node_modules/intro.js/intro.js',
'./node_modules/moment/moment.js',
'./node_modules/sifter/sifter.js',
'./node_modules/@rq/sly-scrolling/dist/sly.js',
'./node_modules/sigma/build/sigma.min.js',
'./node_modules/sigma/build/plugins/sigma.parsers.json.min.js',
'./node_modules/sigma/build/plugins/sigma.plugins.filter.min.js',
'./node_modules/sigma/build/plugins/sigma.layout.forceAtlas2.min.js',
'./node_modules/sigma/build/plugins/sigma.plugins.animate.min.js',
'./node_modules/raven-js/dist/raven.js',
//-- Training Libraries
'./static/js-src/training/training.js',
'./static/js-src/training/ner.js',
'./static/js-src/training/re.js',
'./static/js-src/tasks/relation-data-var-assigned.js',
'./static/js-src/tasks/relation-synopsis.js',
'./static/js-src/libs/leaderboard.js',
'./static/js-src/libs/ner.js',
'./static/js-src/libs/re.js',
'./static/js-src/pages/dashboard.js',
'./static/js-src/pages/ner-group.js',
'./static/js-src/pages/landing.js',
'./static/js-src/pages/talk.js',
];
return gulp.src(project_js_files)
// .pipe(glibs.uglify())
.pipe(glibs.concat('mark2cure.min.js'))
.pipe(gulp.dest('./static/js/'))
.on('error', function(err) {
console.error('Error in compress task', err.toString());
});
});
gulp.task('css', ['fonts'], function() {
return gulp.src('./static/scss/style.scss')
.pipe(compass({
project: path.join(__dirname, 'static'),
sass: 'scss',
import_path: [
path.join(__dirname, 'node_modules', 'bootstrap', 'scss'),
path.join(__dirname, 'node_modules', 'font-awesome', 'scss'),
],
time: true,
debug: true
}))
.pipe(csso())
.pipe(livereload(server))
// .on('error', sass.logError)
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('css/'));
});
gulp.task('default', ['js']);