From 8ba8b20ca1bcdbb3db931fad86c47c79faefb7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 29 May 2014 16:55:29 +0200 Subject: [PATCH] gulpfile: fix nodemon settings Remove the dependency on packages, provide sensible static configuration that works for all packages and non-packages alike. Ignore `**/test/**` files. Remove no longer used method `findSrc()`. Note: as of #7, there is no `modules/package.json`, thus the previous nodemon configuration was not picking changes made in `modules/*.js`. --- gulpfile.js | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2c62981..ce11dcd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -18,11 +18,16 @@ process.env.NODE_PATH = __dirname + ':' + process.env.NODE_PATH; // run the entire project gulp.task('run', function(cb) { nodemon({ - script: 'app.js', - ext: 'html js ejs', - ignore: ['node_modules/**', 'node_modules/**/node_modules', 'build/**'], - watch: findSrc(), - cwd: path.join(__dirname, 'web'), + script: 'web/app.js', + ext: 'html js ejs json', + ignore: [ + '**/node_modules/**', + 'html5/build/**', + '**/test/**', + '.*' // .git, .idea, etc. + ], + watch: __dirname, + cwd: __dirname, env: {NODE_PATH: process.env.NODE_PATH}, nodeArgs: ['--debug'] }) @@ -64,17 +69,6 @@ function findAndBuild(packageName, cb) { async.each(packages, build, cb); } -function findSrc(package) { - var paths = []; - findPackages(package).forEach(function(pkg) { - paths.push(path.join(__dirname, pkg, '*', '*.js')); - paths.push(path.join(__dirname, pkg, '*', '*.json')); - paths.push(path.join(__dirname, pkg, '*.js')); - paths.push(path.join(__dirname, pkg, '*.json')); - }); - return paths; -} - var packageCache; function findPackages(packageName) {