-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGulpfile.js
More file actions
32 lines (26 loc) · 708 Bytes
/
Gulpfile.js
File metadata and controls
32 lines (26 loc) · 708 Bytes
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 elm = require('gulp-elm');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch')
gulp.task('elm-init', elm.init);
gulp.task('watch', function() {
gulp.watch('src/**', ['elm']);
});
gulp.task('elm', ['elm-init'], function(){
return gulp.src('src/Main.elm')
.pipe(plumber())
.pipe(elm())
.pipe(uglify())
.on('error', swallowError)
.pipe(gulp.dest('dist/'));
});
gulp.task('index', function(){
return gulp.src('src/index.html')
.pipe(gulp.dest('dist/'));
});
gulp.task('default', ['elm', 'index']);
swallowError = function(error){
console.log(error.toString());
this.emit('end');
}