Skip to content
Snippets Groups Projects
Commit edb1bc09 authored by Lucas Gabriel Lima's avatar Lucas Gabriel Lima
Browse files

add compile function gulpfile and nodemon task

parent a7a2123e
No related branches found
No related tags found
2 merge requests!10Gulp,!7Refactor enrollments route to include query building
Pipeline #
var gulp = require('gulp'); const gulp = require('gulp');
var mocha = require('gulp-mocha'); const mocha = require('gulp-mocha');
var nodemon = require('gulp-nodemon'); const nodemon = require('gulp-nodemon');
const babel = require('gulp-babel');
const eslint = require('gulp-eslint');
gulp.task('default', ['browser-sync'], function() { /**
* Compile source files
*/
function compile() {
// run ESLint
gulp.src('src/**/*.js')
.pipe(eslint())
.pipe(eslint.format());
// compile source to ES5
gulp.src('src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('build'));
// copy configuration file to build directory
gulp.src('config.json')
.pipe(gulp.dest('build'));
}
gulp.task('default', function() {
}); });
...@@ -18,9 +40,14 @@ gulp.task('test', function(){ ...@@ -18,9 +40,14 @@ gulp.task('test', function(){
}) })
}); });
gulp.task('watch', [], () => {
compile();
});
gulp.task('run', function () { gulp.task('run', function () {
nodemon({ nodemon({
script: 'server.js', script: 'server.js',
tasks: ['watch'],
ext: 'js html', ext: 'js html',
env: { 'NODE_ENV': 'development' } env: { 'NODE_ENV': 'development' }
}) })
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
"chai": "^3.5.0", "chai": "^3.5.0",
"chai-http": "^3.0.0", "chai-http": "^3.0.0",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-eslint": "^3.0.1",
"gulp-mocha": "^3.0.1", "gulp-mocha": "^3.0.1",
"gulp-nodemon": "^2.1.0", "gulp-nodemon": "^2.1.0",
"gulp-plumber": "^1.1.0", "gulp-plumber": "^1.1.0",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment