* * * @param {string} exampleName - name of example inside of examples folder * @returns
(exampleName)
| 54 | * @returns |
| 55 | */ |
| 56 | async 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 | |
| 82 | export { getExampleConfig, runWebpackExampleInMemory, fs, getFixtureResource, getLoader, getFixture }; |
nothing calls this directly
no test coverage detected