function onBundle( error, bundle ) {
		if ( error ) {
			debug( 'Encountered an error when generating bundle: %s', error.message );
			return done( error );
		}
		debug( 'Finished creating bundle: %s', b.name );
		tmp = bundle; // parent scope

		if ( b.raw ) {
			return writeBundle( bundle, false );
		}
		if ( minify ) {
			return minifyBundle( bundle );
		}
		// NOTE: we assume that, if we are supposed to neither write a "raw" bundle to file nor minify a generated bundle, then the generated bundle was minified during generation.
		writeBundle( bundle, true );
	}
Callback invoked upon generating a bundle.

@private
@param {(Error|null)} error - error object
@param {(string|Buffer)} [bundle] - output bundle
@returns {void}