index.js
function handleChange(bundleName) {
	const bundle = module.exports.find(bundleName);

	/* istanbul ignore if: It's rare for `bundle` to be undefined here, but it can happen when using black/whitelisting. */
	if (!bundle) {
		return;
	}

	if (backoffTimer) {
		log.debug('Backoff active, delaying processing of change detected in', bundleName);
		hasChanged[bundleName] = true;
		resetBackoffTimer();
	} else {
		log.debug('Processing change event for', bundleName);
		resetBackoffTimer();

		let reparsedBundle;
		const bundleCfgPath = path.join(root, '/cfg/', bundleName + '.json');
		if (fs.existsSync(bundleCfgPath)) {
			reparsedBundle = parseBundle(bundle.dir, bundleCfgPath);
		} else {
			reparsedBundle = parseBundle(bundle.dir);
		}

		module.exports.add(reparsedBundle);
		emitter.emit('bundleChanged', reparsedBundle);
	}
}
function handleChange(bundleName) {
	const bundle = module.exports.find(bundleName);

	/* istanbul ignore if: It's rare for `bundle` to be undefined here, but it can happen when using black/whitelisting. */
	if (!bundle) {
		return;
	}

	if (backoffTimer) {
		log.debug('Backoff active, delaying processing of change detected in', bundleName);
		hasChanged[bundleName] = true;
		resetBackoffTimer();
	} else {
		log.debug('Processing change event for', bundleName);
		resetBackoffTimer();

		let reparsedBundle;
		const bundleCfgPath = path.join(root, '/cfg/', bundleName + '.json');
		if (fs.existsSync(bundleCfgPath)) {
			reparsedBundle = parseBundle(bundle.dir, bundleCfgPath);
		} else {
			reparsedBundle = parseBundle(bundle.dir);
		}

		module.exports.add(reparsedBundle);
		emitter.emit('bundleChanged', reparsedBundle);
	}
}
function handleChange ( bundleName ) { const bundle = module . exports . find ( bundleName ) ; /* istanbul ignore if: It's rare for `bundle` to be undefined here, but it can happen when using black/whitelisting. */ if ( ! bundle ) { return ; } if ( backoffTimer ) { log . debug ( 'Backoff active, delaying processing of change detected in' , bundleName ) ; hasChanged [ bundleName ] = true ; resetBackoffTimer ( ) ; } else { log . debug ( 'Processing change event for' , bundleName ) ; resetBackoffTimer ( ) ; let reparsedBundle ; const bundleCfgPath = path . join ( root , '/cfg/' , bundleName + '.json' ) ; if ( fs . existsSync ( bundleCfgPath ) ) { reparsedBundle = parseBundle ( bundle . dir , bundleCfgPath ) ; } else { reparsedBundle = parseBundle ( bundle . dir ) ; } module . exports . add ( reparsedBundle ) ; emitter . emit ( 'bundleChanged' , reparsedBundle ) ; } }
Emits a `bundleChanged` event for the given bundle.
@param bundleName {String}
Emits a bundleChanged event for the given bundle .