Merge branch 'master' of ssh://git.verdnatura.es:/var/lib/git/salix
This commit is contained in:
commit
a151268147
|
@ -17,3 +17,4 @@
|
||||||
coverage
|
coverage
|
||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
db.json
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"db": {
|
"db": {
|
||||||
"name": "db",
|
"name": "db",
|
||||||
"connector": "memory",
|
"connector": "memory",
|
||||||
"file": "myToken.json"
|
"file": "db.json"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,4 +14,4 @@ export const bootstrap = () => {
|
||||||
throw new Error("element is not defined");
|
throw new Error("element is not defined");
|
||||||
}
|
}
|
||||||
ng.bootstrap(_element, [NAME]);
|
ng.bootstrap(_element, [NAME]);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"app": ["buys", "crud"],
|
"app": ["crud"],
|
||||||
"buys": ["crud"],
|
|
||||||
"crud": []
|
"crud": []
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
export * from './src/buys';
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
export * from './spliting';
|
|
|
@ -1,44 +1,25 @@
|
||||||
|
|
||||||
var gulp = require ('gulp');
|
var gulp = require ('gulp');
|
||||||
|
var gutil = require('gulp-util');
|
||||||
var wrap = require('gulp-wrap');
|
var wrap = require('gulp-wrap');
|
||||||
var concat = require ('gulp-concat');
|
var concat = require ('gulp-concat');
|
||||||
var babel = require ('gulp-babel');
|
var babel = require ('gulp-babel');
|
||||||
var fs = require ('fs');
|
var fs = require ('fs');
|
||||||
|
var webpack = require ('webpack-stream');
|
||||||
// Routes
|
var webpackConfig = require ('./webpack.config.js');
|
||||||
|
|
||||||
var fileTpl = '\n"<%=file.relative%>": <%=contents%>';
|
|
||||||
var globalTpl = 'var routes = {<%=contents%>\n}';
|
|
||||||
|
|
||||||
gulp.task ('routes', function ()
|
|
||||||
{
|
|
||||||
return gulp.src ('./crud/**/routes.js')
|
|
||||||
.pipe (wrap (fileTpl))
|
|
||||||
.pipe (concat ('salix.routes.js', {newLine: ','}))
|
|
||||||
.pipe (wrap (globalTpl))
|
|
||||||
.pipe (babel ({presets: ['es2015']}))
|
|
||||||
.pipe (gulp.dest ('./build/public'));
|
|
||||||
});
|
|
||||||
|
|
||||||
// Spliting
|
// Spliting
|
||||||
|
|
||||||
var baseDir = './app/src/spliting';
|
var splitingDir = './app/src/spliting';
|
||||||
var depsFile = baseDir +'/deps.json';
|
var splitingFiles = splitingDir +'/*';
|
||||||
|
|
||||||
function splitingFunc ()
|
gulp.task ('spliting', function ()
|
||||||
{
|
{
|
||||||
try {
|
var jsonDeps = fs.readFileSync (splitingDir +'/deps.json');
|
||||||
var jsonDeps = fs.readFileSync (depsFile);
|
var modules = JSON.parse (jsonDeps);
|
||||||
var modules = JSON.parse (jsonDeps);
|
|
||||||
}
|
var importTpl = fs.readFileSync (splitingDir +'/import.tpl.js', 'utf8');
|
||||||
catch (e)
|
var requireTpl = fs.readFileSync (splitingDir +'/require.tpl.js', 'utf8');
|
||||||
{
|
|
||||||
console.error (e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var importTpl = fs.readFileSync (baseDir +'/import.tpl.js', 'utf8');
|
|
||||||
var requireTpl = fs.readFileSync (baseDir +'/require.tpl.js', 'utf8');
|
|
||||||
|
|
||||||
for (var modName in modules)
|
for (var modName in modules)
|
||||||
{
|
{
|
||||||
|
@ -57,16 +38,44 @@ function splitingFunc ()
|
||||||
fs.appendFileSync (splitFile,
|
fs.appendFileSync (splitFile,
|
||||||
requireTpl.replace (/\$module/g, deps[i]));
|
requireTpl.replace (/\$module/g, deps[i]));
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
gulp.task ('spliting', function ()
|
// Webpack
|
||||||
|
|
||||||
|
gulp.task ('webpack', ['spliting'], function (callback)
|
||||||
{
|
{
|
||||||
splitingFunc ();
|
return gulp.src (['app/index.js', 'login/index.js'])
|
||||||
//gulp.watch (depsFile, splitingFunc);
|
.pipe (webpack (webpackConfig))
|
||||||
|
.pipe (gulp.dest ('build/public/'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Routes
|
||||||
|
|
||||||
|
var routeFiles = './crud/**/routes.js';
|
||||||
|
|
||||||
|
gulp.task ('routes', function ()
|
||||||
|
{
|
||||||
|
var fileTpl = '\n"<%=file.relative%>": <%=contents%>';
|
||||||
|
var globalTpl = 'var routes = {<%=contents%>\n}';
|
||||||
|
|
||||||
|
return gulp.src (routeFiles)
|
||||||
|
.pipe (wrap (fileTpl))
|
||||||
|
.pipe (concat ('salix.routes.js', {newLine: ','}))
|
||||||
|
.pipe (wrap (globalTpl))
|
||||||
|
.pipe (babel ({presets: ['es2015']}))
|
||||||
|
.pipe (gulp.dest ('./build/public'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Watch
|
||||||
|
|
||||||
|
gulp.task ('watch', function ()
|
||||||
|
{
|
||||||
|
gulp.watch (routeFiles, ['routes']);
|
||||||
|
gulp.watch (splitingFiles, ['spliting']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
|
|
||||||
gulp.task ('default', ['routes', 'spliting']);
|
gulp.task ('build', ['routes', 'webpack']);
|
||||||
|
gulp.task ('default', ['watch', 'build']);
|
||||||
|
|
||||||
|
|
|
@ -42,5 +42,18 @@ http {
|
||||||
proxy_pass http://127.0.0.1:3002/$1$is_args$args;
|
proxy_pass http://127.0.0.1:3002/$1$is_args$args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
types {
|
||||||
|
text/html html;
|
||||||
|
application/json json;
|
||||||
|
application/javascript js;
|
||||||
|
text/css css scss;
|
||||||
|
text/xml xml;
|
||||||
|
image/x-icon ico;
|
||||||
|
image/png png;
|
||||||
|
image/svg+xml svg;
|
||||||
|
image/gif gif;
|
||||||
|
image/jpeg jpeg jpg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
"gulp-babel": "^6.1.2",
|
"gulp-babel": "^6.1.2",
|
||||||
"gulp-concat": "^2.6.0",
|
"gulp-concat": "^2.6.0",
|
||||||
"gulp-insert": "^0.5.0",
|
"gulp-insert": "^0.5.0",
|
||||||
|
"gulp-util": "^3.0.7",
|
||||||
"gulp-wrap": "^0.13.0",
|
"gulp-wrap": "^0.13.0",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"node-sass": "^3.11.0",
|
"node-sass": "^3.11.0",
|
||||||
|
@ -37,16 +38,13 @@
|
||||||
"sass-loader": "^4.0.2",
|
"sass-loader": "^4.0.2",
|
||||||
"style-loader": "^0.13.1",
|
"style-loader": "^0.13.1",
|
||||||
"webpack": "^1.13.3",
|
"webpack": "^1.13.3",
|
||||||
"webpack-dev-server": "^1.16.2"
|
"webpack-dev-server": "^1.16.2",
|
||||||
|
"webpack-stream": "^3.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --colors --watch",
|
"build": "webpack --progress --colors --watch",
|
||||||
"dev": "webpack-dev-server --progress --colors --hot",
|
"dev": "webpack-dev-server --progress --colors --hot",
|
||||||
"lint": "eslint ./ --cache --ignore-pattern .gitignore",
|
"lint": "eslint ./ --cache --ignore-pattern .gitignore"
|
||||||
"gulp": "gulp",
|
|
||||||
"express": "node server.js",
|
|
||||||
"nginx": "/usr/sbin/nginx -p . -c nginx.conf",
|
|
||||||
"nginx-stop": "/usr/sbin/nginx -p . -c nginx.conf -s stop"
|
|
||||||
},
|
},
|
||||||
"pre-commit": [
|
"pre-commit": [
|
||||||
"lint"
|
"lint"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
var webpack = require ('webpack');
|
||||||
var path = require ('path');
|
var path = require ('path');
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
|
@ -37,7 +38,13 @@ module.exports =
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
resolve: {
|
/* plugins: [
|
||||||
|
new webpack.optimize.UglifyJsPlugin ({
|
||||||
|
minimize: true,
|
||||||
|
compress: { warnings: false }
|
||||||
|
})
|
||||||
|
],
|
||||||
|
*/ resolve: {
|
||||||
modulesDirectories: [
|
modulesDirectories: [
|
||||||
__dirname,
|
__dirname,
|
||||||
'node_modules'
|
'node_modules'
|
||||||
|
@ -47,6 +54,7 @@ module.exports =
|
||||||
inline: true,
|
inline: true,
|
||||||
host: '0.0.0.0'
|
host: '0.0.0.0'
|
||||||
},
|
},
|
||||||
devtool: 'eval-source-map'
|
devtool: 'source-map',
|
||||||
|
watch: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue