-
Notifications
You must be signed in to change notification settings - Fork 26
/
gulpfile.js
50 lines (45 loc) · 1.74 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
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var zip = require('gulp-zip');
gulp.task('build:equation_editor', function() {
gulp.src(['./src/equation_editor/events.coffee',
'./src/equation_editor/view.coffee',
'./src/equation_editor/collapsible_view.coffee',
'./src/equation_editor/button_views.coffee',
'./src/equation_editor/button_group_view.coffee',
'./src/equation_editor/button_view_factory.coffee',
'./src/equation_editor/button_group_view_factory.coffee',
'./src/equation_editor/equation_editor_view.coffee'
])
.pipe(coffee({bare: true}))
.pipe(concat('equation_editor.js'))
.pipe(uglify())
.pipe(gulp.dest('./build/js/'))
});
gulp.task('build:plugin', function() {
gulp.src('./src/plugin.coffee')
.pipe(coffee({bare: true}))
.pipe(concat('plugin.min.js')) // include "min" in the filename to please TinyMCE
.pipe(uglify())
.pipe(gulp.dest('./build/js/'))
});
gulp.task('build:copy_config', function() {
gulp.src('./src/equation_editor/config.json')
.pipe(gulp.dest('./build/'))
});
gulp.task('build:zip', function() {
gulp.src(['./build/fonts/*',
'./build/js/equation_editor.js',
'./build/js/mathquill.min.js',
'./build/js/plugin.min.js',
'./build/equation_editor.css',
'./build/equation_editor.html',
'./build/mathquill.css',
'./src/equation_editor/config.json'
])
.pipe(zip('tinymce_equation_editor.zip'))
.pipe(gulp.dest('./build/'))
});
gulp.task('build', ['build:equation_editor', 'build:plugin', 'build:copy_config', 'build:zip']);