MCPcopy Create free account
hub / github.com/TheLarkInn/virtual-dependency-loader / runWebpackExampleInMemory

Function runWebpackExampleInMemory

test/test-utils.js:56–80  ·  view source on GitHub ↗

* * * @param {string} exampleName - name of example inside of examples folder * @returns

(exampleName)

Source from the content-addressed store, hash-verified

54 * @returns
55 */
56async function runWebpackExampleInMemory(exampleName) {
57 const webpackConfig = getExampleConfig(exampleName);
58 const compiler = webpack(webpackConfig);
59
60 compiler.outputFileSystem = fs;
61
62 const run = Promise.promisify(compiler.run, { context: compiler });
63 const stats = await run();
64
65
66 const { compilation } = stats;
67 const { errors, warnings, assets, entrypoints, chunks, modules } = compilation;
68 const statsJson = stats.toJson();
69
70 return {
71 assets,
72 entrypoints,
73 errors,
74 warnings,
75 stats,
76 chunks,
77 modules,
78 statsJson,
79 };
80}
81
82export { getExampleConfig, runWebpackExampleInMemory, fs, getFixtureResource, getLoader, getFixture };

Callers

nothing calls this directly

Calls 1

getExampleConfigFunction · 0.85

Tested by

no test coverage detected