Concatena JSON de rutas usando Gulp

This commit is contained in:
Juan Ferrer Toribio 2016-10-06 11:18:02 +02:00
parent d1a86633fc
commit 287fd05864
7 changed files with 32 additions and 3 deletions

View File

@ -17,4 +17,4 @@ const pagos = () => {
require.ensure([], () => {
require('@salix/pagos')
}, "salix.pagos");
};
};

View File

@ -0,0 +1,4 @@
{
"route": "buys",
"template": "buys.template"
}

View File

@ -0,0 +1,4 @@
{
"route": "sales",
"template": "sales.template"
}

16
gulpfile.js Normal file
View File

@ -0,0 +1,16 @@
var gulp = require ('gulp');
var jsoncombine = require ('gulp-jsoncombine');
function combineFunc (data)
{
return new Buffer (JSON.stringify (data));
}
gulp.task ('default', function ()
{
var json = gulp.src ('./@salix/**/routing.json')
.pipe (jsoncombine ('salix.routes.json', combineFunc))
.pipe (gulp.dest ('./build'));
});

View File

@ -19,7 +19,9 @@
"babel-core": "*",
"babel-preset-es2015": "*",
"babel-loader": "*",
"raw-loader": "*"
"raw-loader": "*",
"gulp": "^3.9.1",
"gulp-jsoncombine": "^1.0.3"
},
"scripts": {
"dev": "webpack --progress --colors --watch"

0
server.js Normal file
View File

View File

@ -22,9 +22,12 @@ module.exports =
query: {
presets: ['es2015']
}
}, {
},{
test: /\.html$/,
loader: 'raw'
},{
test: /\.json$/,
loader: 'json'
}
]
},