Merge branch 'master' of ssh://git.verdnatura.es:/var/lib/git/salix

This commit is contained in:
nelo 2016-10-06 15:17:12 +02:00
commit 4d6ad1a910
8 changed files with 74 additions and 21 deletions

View File

@ -18,4 +18,4 @@ export 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

@ -4,14 +4,13 @@
<title>Salix</title>
</head>
<body>
<div id="app">
<div ui-view></div>
<a ui-sref="index">index</a>
<a ui-sref="add">add</a>
<a ui-sref="edit">edit</a>
<a ui-sref="delete">delete</a>
</div>
<script type="text/javascript" src="build/salix.app.js" selector="#app"></script>
<div id="app">
<div ui-view></div>
<a ui-sref="index">index</a>
<a ui-sref="add">add</a>
<a ui-sref="edit">edit</a>
<a ui-sref="delete">delete</a>
</div>
<script type="text/javascript" src="build/salix.app.js" selector="#app"></script>
</body>
</html>

View File

@ -11,18 +11,21 @@
"dependencies": {
"angular": "^1.5.8",
"angular-ui-router": "^1.0.0-beta.3",
"express": "^4.14.0",
"material-design-lite": "^1.2.1",
"oclazyload": "^0.6.3"
},
"devDependencies": {
"babel-core": "*",
"babel-loader": "*",
"babel-preset-es2015": "*",
"css-loader": "^0.25.0",
"raw-loader": "*",
"style-loader": "^0.13.1",
"gulp": "^3.9.1",
"gulp-jsoncombine": "^1.0.3",
"webpack": "*",
"webpack-dev-server": "*"
"webpack-dev-server": "*",
"raw-loader": "*",
"css-loader": "^0.25.0",
"style-loader": "^0.13.1",
"babel-loader": "*",
"babel-core": "*",
"babel-preset-es2015": "*"
},
"scripts": {
"build": "webpack --progress --colors --watch"

24
server.js Normal file
View File

@ -0,0 +1,24 @@
var express = require ('express');
function getRoutes (req, res)
{
var routes = require ('./build/salix.routes.json');
res.send (JSON.stringify (routes));
}
function getDefault (res, res)
{
res.sendStatus (404);
}
function onListen ()
{
console.log ('HTTP server started.');
}
var app = express ();
app.get ('/routes.json', getRoutes);
app.all (/.*/, getDefault);
app.listen (8080, onListen);

View File

@ -1,6 +1,6 @@
var webpack = require('webpack');
var path = require('path');
var webpack = require ('webpack');
var path = require ('path');
module.exports =
{
@ -22,10 +22,13 @@ module.exports =
query: {
presets: ['es2015']
}
}, {
},{
test: /\.html$/,
loader: 'raw'
}, {
},{
test: /\.json$/,
loader: 'json'
},{
test: /\.css$/,
loader: 'style!css'
}