MCPcopy
hub / github.com/webpack/webpack / compile

Function compile

test/Stats.test.js:12–29  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

10 * @returns {Promise<import("../").Stats>} stats
11 */
12const compile = (options) =>
13 /** @type {Promise<import("../").Stats>} */ (
14 new Promise((resolve, reject) => {
15 const webpack = require("..");
16
17 const compiler = /** @type {import("../").Compiler} */ (webpack(options));
18 compiler.outputFileSystem = /** @type {EXPECTED_ANY} */ (
19 createFsFromVolume(new Volume())
20 );
21 compiler.run((err, stats) => {
22 if (err) {
23 reject(err);
24 } else {
25 resolve(/** @type {import("../").Stats} */ (stats));
26 }
27 });
28 })
29 );
30
31expectNoDeprecations();
32

Callers 1

Stats.test.jsFile · 0.70

Calls 4

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

Tested by

no test coverage detected