packages/oss-report-builder/index.js
function findRuntimeDependencies(webpackModules) {
	const runtimeDependencies = {}
	webpackModules.forEach(module => {
		const name = module.name
		if (
			name.startsWith('./~/') ||
			name.startsWith('./node_modules/') ||
			name.startsWith('./lib/')
		) {
			const components = name.split('/')
			let i = 2
			let moduleName = ''
			let moduleComponent = components[i++]
			while (moduleComponent.startsWith('@')) {
				moduleName += moduleComponent + '/'
				moduleComponent = components[i++]
			}
			moduleName += moduleComponent
			runtimeDependencies[moduleName] = module.built && module.cacheable
		}
	})
	return Object.assign({}, runtimeDependencies, alwaysRuntimeDependencies)
}
function findRuntimeDependencies(webpackModules) {
	const runtimeDependencies = {}
	webpackModules.forEach(module => {
		const name = module.name
		if (
			name.startsWith('./~/') ||
			name.startsWith('./node_modules/') ||
			name.startsWith('./lib/')
		) {
			const components = name.split('/')
			let i = 2
			let moduleName = ''
			let moduleComponent = components[i++]
			while (moduleComponent.startsWith('@')) {
				moduleName += moduleComponent + '/'
				moduleComponent = components[i++]
			}
			moduleName += moduleComponent
			runtimeDependencies[moduleName] = module.built && module.cacheable
		}
	})
	return Object.assign({}, runtimeDependencies, alwaysRuntimeDependencies)
}
function findRuntimeDependencies ( webpackModules ) { const runtimeDependencies = { } webpackModules . forEach ( module => { const name = module . name if ( name . startsWith ( './~/' ) || name . startsWith ( './node_modules/' ) || name . startsWith ( './lib/' ) ) { const components = name . split ( '/' ) let i = 2 let moduleName = '' let moduleComponent = components [ i ++ ] while ( moduleComponent . startsWith ( '@' ) ) { moduleName += moduleComponent + '/' moduleComponent = components [ i ++ ] } moduleName += moduleComponent runtimeDependencies [ moduleName ] = module . built && module . cacheable } } ) return Object . assign ( { } , runtimeDependencies , alwaysRuntimeDependencies ) }
Finds the runtime dependencies in the given webpack modules and adds the dependencies defined in the
`alwaysRuntimeDependencies` object.

@method findRuntimeDependencies
@param {Object} webpackModules - An object containing the dependencies as obtaining from compiling the project using webpack.
@returns {Object}
Finds the runtime dependencies in the given webpack modules and adds the dependencies defined in the alwaysRuntimeDependencies object .