MCPcopy
hub / github.com/webpack/webpack / createCompiler

Function createCompiler

test/Compiler.test.js:481–498  ·  test/Compiler.test.js::createCompiler
(
				/** @type {import("../").Configuration} */ options
			)

Source from the content-addressed store, hash-verified

479 let errored;
480 try {
481 const createCompiler = (
482 /** @type {import(class="st">"../").Configuration} */ options
483 ) =>
484 new Promise((resolve, reject) => {
485 const webpack = require(class="st">"..");
486
487 const c = webpack(options);
488 c.run((err, stats) => {
489 if (err) {
490 reject(err);
491 }
492 if (stats !== undefined && class="st">"errors" in stats) {
493 reject(err);
494 } else {
495 resolve(stats);
496 }
497 });
498 });
499 compiler = await createCompiler({
500 context: __dirname,
501 mode: class="st">"production",

Callers 3

Compiler.test.jsFile · 0.70
nanTestFunction · 0.70
monotonicTestFunction · 0.70

Calls 4

resolveFunction · 0.85
requireFunction · 0.70
webpackFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected