lib/entries.js
async function getBuildConfig() {
	const entries = await $C(vinyl.src(path.join(entry(), '*.js'), {read: false}))
		.async
		.to({})
		.reduce((res, el) => {
			const
				src = el.path,
				name = path.basename(src, '.js');

			let source;
			function getSource() {
				source = source || fs.readFileSync(src, 'utf-8');
				return source;
			}

			res[name] = {
				path: src,

				get source() {
					return getSource();
				},

				get parent() {
					return $C(getEntryParents(getSource())).one.get();
				},

				get parents() {
					return getEntryParents(getSource());
				},

				getRuntimeDependencies({cache} = {}) {
					return getEntryRuntimeDependencies(path.dirname(src), getSource(), {cache});
				}
			};

			return res;
		});

	function factory(entries) {
		function filter(cb) {
			return factory($C(entries).filter(cb).map());
		}

		return {
			entries,
			filter,
			getUnionEntryPoints({cache} = {}) {
				return getUnionEntryPoints(entries, {cache});
			}
		};
	}

	return factory(entries);
}
async function getBuildConfig() {
	const entries = await $C(vinyl.src(path.join(entry(), '*.js'), {read: false}))
		.async
		.to({})
		.reduce((res, el) => {
			const
				src = el.path,
				name = path.basename(src, '.js');

			let source;
			function getSource() {
				source = source || fs.readFileSync(src, 'utf-8');
				return source;
			}

			res[name] = {
				path: src,

				get source() {
					return getSource();
				},

				get parent() {
					return $C(getEntryParents(getSource())).one.get();
				},

				get parents() {
					return getEntryParents(getSource());
				},

				getRuntimeDependencies({cache} = {}) {
					return getEntryRuntimeDependencies(path.dirname(src), getSource(), {cache});
				}
			};

			return res;
		});

	function factory(entries) {
		function filter(cb) {
			return factory($C(entries).filter(cb).map());
		}

		return {
			entries,
			filter,
			getUnionEntryPoints({cache} = {}) {
				return getUnionEntryPoints(entries, {cache});
			}
		};
	}

	return factory(entries);
}
async function getBuildConfig ( ) { const entries = await $C ( vinyl . src ( path . join ( entry ( ) , '*.js' ) , { read : false } ) ) . async . to ( { } ) . reduce ( ( res , el ) => { const src = el . path , name = path . basename ( src , '.js' ) ; let source ; function getSource ( ) { source = source || fs . readFileSync ( src , 'utf-8' ) ; return source ; } res [ name ] = { path : src , get source ( ) { return getSource ( ) ; } , get parent ( ) { return $C ( getEntryParents ( getSource ( ) ) ) . one . get ( ) ; } , get parents ( ) { return getEntryParents ( getSource ( ) ) ; } , getRuntimeDependencies ( { cache } = { } ) { return getEntryRuntimeDependencies ( path . dirname ( src ) , getSource ( ) , { cache } ) ; } } ; return res ; } ) ; function factory ( entries ) { function filter ( cb ) { return factory ( $C ( entries ) . filter ( cb ) . map ( ) ) ; } return { entries , filter , getUnionEntryPoints ( { cache } = { } ) { return getUnionEntryPoints ( entries , { cache } ) ; } } ; } return factory ( entries ) ; }
Returns build config for entries
@returns {!Promise<!{entries, dependencies, commons}>}
Returns build config for entries