MCPcopy
hub / github.com/webpack/webpack / getTargetProperties

Function getTargetProperties

lib/config/target.js:515–529  ·  view source on GitHub ↗
(target, context)

Source from the content-addressed store, hash-verified

513 * @returns {TargetProperties} target properties
514 */
515const getTargetProperties = (target, context) => {
516 for (const [, , regExp, handler] of TARGETS) {
517 const match = regExp.exec(target);
518 if (match) {
519 const [, ...args] = match;
520 const result = handler(...args, context);
521 if (result) return /** @type {TargetProperties} */ (result);
522 }
523 }
524 throw new Error(
525 `Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(
526 ([name, description]) => `* ${name}: ${description}`
527 ).join("\n")}`
528 );
529};
530
531/**
532 * Merges target properties.

Callers 4

getTargetsPropertiesFunction · 0.85
isUniversalTargetMethod · 0.85

Calls 2

execMethod · 0.80
handlerFunction · 0.50

Tested by

no test coverage detected