MCPcopy
hub / github.com/webpack/webpack-dev-server / isWebTarget

Method isWebTarget

lib/Server.js:591–603  ·  view source on GitHub ↗

* @private * @param {Compiler} compiler compiler * @returns {boolean} true when target is `web` or `universal`, otherwise false

(compiler)

Source from the content-addressed store, hash-verified

589 * @returns {boolean} true when target is `web` or `universal`, otherwise false
590 */
591 static isWebTarget(compiler) {
592 const { platform } = compiler;
593
594 // A `web` or universal target (`web` and `node` both `null`) injects the
595 // client. `target: false` is `null` everywhere, so it is excluded.
596 return Boolean(
597 platform.web ||
598 /** @type {{ universal?: boolean | null }} */ (platform)?.universal ||
599 (compiler.options.target !== false &&
600 platform.web === null &&
601 platform.node === null),
602 );
603 }
604
605 /**
606 * @private

Callers 3

addAdditionalEntriesMethod · 0.80
getCompilerOptionsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected