MCPcopy Index your code
hub / github.com/developit/optimize-plugin / statsWithAssets

Function statsWithAssets

test/_util.js:102–115  ·  view source on GitHub ↗
(stats)

Source from the content-addressed store, hash-verified

100}
101
102export async function statsWithAssets (stats) {
103 const assets = Object.keys(stats.compilation.assets);
104 const basePath = stats.compilation.outputOptions.path;
105 const contents = {};
106
107 await Promise.all(assets.map(async (asset) => {
108 const assetPath = path.join(basePath, asset);
109 const content = await fs.readFile(assetPath, 'utf8');
110
111 contents[asset] = content;
112 }));
113
114 stats.assets = contents;
115}
116
117function run (runner, console) {
118 return new Promise((resolve, reject) => {

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected