aboutsummaryrefslogtreecommitdiffhomepage
path: root/gulpfile.js
diff options
context:
space:
mode:
authoreric <thul.eric@gmail.com>2015-04-12 11:35:25 -0400
committereric <thul.eric@gmail.com>2015-04-12 11:35:25 -0400
commit7d58cf78c770ef95858f90c6e89bd18653657a82 (patch)
treeebae7549b1a1b14e11fd5e2ad4dd66d901af81c8 /gulpfile.js
parent18ced1e0f031df444a5d85d72cd6843d826fef38 (diff)
parent94a23e744896b4440794de5d6cffedff1a1a2d56 (diff)
downloadpurs-loader-7d58cf78c770ef95858f90c6e89bd18653657a82.tar.gz
purs-loader-7d58cf78c770ef95858f90c6e89bd18653657a82.tar.zst
purs-loader-7d58cf78c770ef95858f90c6e89bd18653657a82.zip
Merge pull request #8 from ethul/topic/purescript-rewrite
Topic/purescript rewrite
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js68
1 files changed, 68 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 0000000..e217480
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,68 @@
1'use strict';
2
3var path = require('path');
4
5var gulp = require('gulp');
6
7var gutil = require('gulp-util');
8
9var plumber = require('gulp-plumber');
10
11var purescript = require('gulp-purescript');
12
13var sequence = require('run-sequence');
14
15var del = require('del');
16
17var config = { del: ['build', 'index.js']
18 , purescript: { src: [ 'bower_components/purescript-*/src/**/*.purs*'
19 , 'src/**/*.purs'
20 ]
21 , dest: 'build'
22 , docs: 'MODULE.md'
23 }
24 }
25 ;
26
27function error(e) {
28 gutil.log(gutil.colors.magenta('>>>> Error <<<<') + '\n' + e.toString().trim());
29 this.emit('end');
30}
31
32gulp.task('del', function(cb){
33 del(config.del, cb);
34});
35
36gulp.task('make', function(){
37 return gulp.src(config.purescript.src).
38 pipe(plumber()).
39 pipe(purescript.pscMake({output: config.purescript.dest})).
40 on('error', error);
41});
42
43gulp.task('psci', function(){
44 return gulp.src(config.purescript.src).
45 pipe(plumber()).
46 pipe(purescript.dotPsci()).
47 on('error', error);
48});
49
50gulp.task('docs', function(){
51 return gulp.src(config.purescript.src[1]).
52 pipe(plumber()).
53 pipe(purescript.pscDocs()).
54 on('error', error).
55 pipe(gulp.dest(config.purescript.docs));
56});
57
58gulp.task('watch', function(){
59 gulp.watch(config.purescript.src, ['make']);
60});
61
62gulp.task('default', function(callback){
63 sequence('del', 'make', ['psci', 'docs'], callback);
64});
65
66gulp.task('build', function(callback){
67 sequence('del', 'make', callback);
68});