2016-10-06 09:18:02 +00:00
|
|
|
|
|
|
|
var gulp = require ('gulp');
|
2016-10-07 09:44:24 +00:00
|
|
|
var concat = require ('gulp-concat');
|
2016-10-10 09:15:05 +00:00
|
|
|
var insert = require ('gulp-insert');
|
2016-10-07 09:44:24 +00:00
|
|
|
var babel = require ('gulp-babel');
|
2016-10-10 09:15:05 +00:00
|
|
|
var wrap = require("gulp-wrap");
|
|
|
|
|
|
|
|
var template = '"<%=file.path%>": <%=contents%>';
|
2016-10-06 09:18:02 +00:00
|
|
|
|
|
|
|
gulp.task ('default', function ()
|
|
|
|
{
|
2016-10-10 09:15:05 +00:00
|
|
|
var js = gulp.src ('./@salix/**/routes.js')
|
|
|
|
.pipe (wrap (template))
|
|
|
|
.pipe (concat ('salix.routes.js', {newLine: ','}))
|
|
|
|
.pipe (insert.prepend ('var routes = {'))
|
|
|
|
.pipe (insert.append ('};'))
|
2016-10-07 09:44:24 +00:00
|
|
|
.pipe (babel ({presets: ['es2015']}))
|
|
|
|
.pipe (gulp.dest ('./build/private'));
|
2016-10-06 09:18:02 +00:00
|
|
|
});
|
|
|
|
|