From 287fd05864fd7d46f293e0bdf6dd9a8b44ba4fa0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 6 Oct 2016 11:18:02 +0200 Subject: [PATCH] Concatena JSON de rutas usando Gulp --- @salix/app/src/spliting.js | 2 +- @salix/compras/routing.json | 4 ++++ @salix/ventas/routing.json | 4 ++++ gulpfile.js | 16 ++++++++++++++++ package.json | 4 +++- server.js | 0 webpack.config.js | 5 ++++- 7 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 @salix/compras/routing.json create mode 100644 @salix/ventas/routing.json create mode 100644 gulpfile.js create mode 100644 server.js diff --git a/@salix/app/src/spliting.js b/@salix/app/src/spliting.js index a672cea56..d0cbc59a1 100644 --- a/@salix/app/src/spliting.js +++ b/@salix/app/src/spliting.js @@ -17,4 +17,4 @@ const pagos = () => { require.ensure([], () => { require('@salix/pagos') }, "salix.pagos"); -}; \ No newline at end of file +}; diff --git a/@salix/compras/routing.json b/@salix/compras/routing.json new file mode 100644 index 000000000..ac6307544 --- /dev/null +++ b/@salix/compras/routing.json @@ -0,0 +1,4 @@ +{ + "route": "buys", + "template": "buys.template" +} diff --git a/@salix/ventas/routing.json b/@salix/ventas/routing.json new file mode 100644 index 000000000..ef776755e --- /dev/null +++ b/@salix/ventas/routing.json @@ -0,0 +1,4 @@ +{ + "route": "sales", + "template": "sales.template" +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 000000000..6fbf8aebc --- /dev/null +++ b/gulpfile.js @@ -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')); +}); + diff --git a/package.json b/package.json index 083501fea..20e5a8c38 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/server.js b/server.js new file mode 100644 index 000000000..e69de29bb diff --git a/webpack.config.js b/webpack.config.js index a14c565e9..d1693911e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -22,9 +22,12 @@ module.exports = query: { presets: ['es2015'] } - }, { + },{ test: /\.html$/, loader: 'raw' + },{ + test: /\.json$/, + loader: 'json' } ] },