Created
October 20, 2015 18:11
-
-
Save mchavezi/edd8a30f237371b4be2b to your computer and use it in GitHub Desktop.
Gulp file for compiling multiple Elm files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Path = require('path'); | |
var Gulp = require('gulp'); | |
var Elm = require('gulp-elm'); | |
var Concat = require('gulp-concat'); | |
var Newer = require('gulp-newer'); | |
Gulp.task('elm-init', Elm.init); | |
Gulp.task('elm', ['elm-init'], function () { | |
var bundleConfigs = [{ | |
entries: './client/pages/home/home.elm', | |
dest: './public/pages/home', | |
outputName: 'home.js' | |
}, { | |
entries: './client/pages/bingo/bingo.elm', | |
dest: './public/pages/bingo', | |
outputName: 'bingo.js' | |
}]; | |
return bundleConfigs.map(function (bundleConfig) { | |
return Gulp.src(bundleConfig.entries) | |
.pipe(Newer(Path.join(bundleConfig.dest, bundleConfig.outputName))) | |
.pipe(Concat(bundleConfig.outputName)) | |
.pipe(Elm()) | |
.pipe(Gulp.dest(bundleConfig.dest)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment