Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid this if possible. We should use the package.json main script instead.

ext: 'html js ejs json',
ignore: [
'**/node_modules/**',
'html5/build/**',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to avoid hard coding package names (eg html5) anywhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. How about */build/** instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that initially and had issues. Maybe I had the wrong ** or pattern.

'**/test/**',
'.*' // .git, .idea, etc.
],
watch: __dirname,
cwd: __dirname,
env: {NODE_PATH: process.env.NODE_PATH},
nodeArgs: ['--debug']
})
Expand Down Expand Up @@ -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) {
Expand Down