-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
32 lines (27 loc) · 925 Bytes
/
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
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var gutil = require('gulp-util');
var coffee = require('gulp-coffee');
// browserify bundle for direct browser use.
gulp.task("bundle", function(){
bundler = browserify('./src/mathjax_processor.coffee',
{
transform: ['coffeeify'],
standalone: 'mathjaxProcessor',
extensions: ['.coffee'],
debug: false
});
return bundler.bundle()
.pipe(source('mathjax_processor.js'))
.pipe(gulp.dest('dist'));
});
// simple transpile if you want to bundle it yourself
// using this can reduce the size of your own bundle
gulp.task("transpile", function(){
gulp.src('./src/**/*.coffee')
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest('./lib/'))
});
gulp.task("build", ["bundle", "transpile"]);
gulp.task("default", ["build"]);