salix/gulpfile.js

21 lines
548 B
JavaScript

var gulp = require ('gulp');
var concat = require ('gulp-concat');
var insert = require ('gulp-insert');
var babel = require ('gulp-babel');
var wrap = require("gulp-wrap");
var template = '"<%=file.path%>": <%=contents%>';
gulp.task ('default', function ()
{
var js = gulp.src ('./@salix/**/routes.js')
.pipe (wrap (template))
.pipe (concat ('salix.routes.js', {newLine: ','}))
.pipe (insert.prepend ('var routes = {'))
.pipe (insert.append ('};'))
.pipe (babel ({presets: ['es2015']}))
.pipe (gulp.dest ('./build/private'));
});