var fs = require('fs');

if(process.env.EXIT_ON_CHANGES) {
	console.log("In development mode, will exit on file changes in cwd");
	fs.watch('.', {}, function(ev, filename) {
		if(/\.js$/.test(filename)) {
			console.log("Exiting because:", ev, filename);
			process.exit(0);
		}
	})
}

var fs = require('fs');

if(Number(process.env.EXIT_ON_CHANGES)) {
	console.log("[exit-on-changes] EXIT_ON_CHANGES enabled");
	fs.watch('.', {}, function(ev, filename) {
		if(/\.(jsx?|es6?)$/.test(filename)) {
			console.log("[exit-on-changes] Exiting after:", ev, filename);
			process.exit(0);
		}
	})
}

Fix line endings; watch more file extensions; disable on EXIT_ON_CHANGES=0
Fix line endings; watch more file extensions; disable on EXIT_ON_CHANGES=0
