_addEntryItem(context, entry, target, options, callback) {
		const { name } = options;
		/** @type {EntryData | undefined} */
		let entryData =
			name !== undefined ? this.entries.get(name) : this.globalEntry;
		if (entryData === undefined) {
			entryData = {
				dependencies: [],
				includeDependencies: [],
				options: {
					name: undefined,
					...options
				}
			};
			entryData[target].push(entry);
			this.entries.set(
				/** @type {NonNullable<EntryOptions["name"]>} */
				(name),
				entryData
			);
		} else {
			entryData[target].push(entry);
			for (const _key of Object.keys(options)) {
				const key = /** @type {keyof EntryOptions} */ (_key);
				if (options[key] === undefined) continue;
				if (entryData.options[key] === options[key]) continue;
				if (
					Array.isArray(entryData.options[key]) &&
					Array.isArray(options[key]) &&
					arrayEquals(entryData.options[key], options[key])
				) {
					continue;
				}
				if (entryData.options[key] === undefined) {
					/** @type {TODO} */
					(entryData.options)[key] =
						/** @type {NonNullable<EntryOptions[keyof EntryOptions]>} */
						(options[key]);
				} else {
					return callback(
						new WebpackError(
							`Conflicting entry option ${key} = ${entryData.options[key]} vs ${options[key]}`
						)
					);
				}
			}
		}

		this.hooks.addEntry.call(entry, options);

		this.addModuleTree(
			{
				context,
				dependency: entry,
				contextInfo: entryData.options.layer
					? { issuerLayer: entryData.options.layer }
					: undefined
			},
			(err, module) => {
				if (err) {
					this.hooks.failedEntry.call(entry, options, err);
					return callback(err);
				}
				this.hooks.succeedEntry.call(
					entry,
					options,
					/** @type {Module} */
					(module)
				);
				return callback(null, module);
			}
		);
	}
@param {string} context context path for entry
@param {Dependency} entry entry dependency that should be followed
@param {"dependencies" | "includeDependencies"} target type of entry
@param {EntryOptions} options options
@param {ModuleCallback} callback callback function
@returns {void} returns