MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / makeAssetSizesObject

Method makeAssetSizesObject

lib/models/asset-size-printer.js:50–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 async makeAssetSizesObject() {
51 let files = this.findFiles();
52 let testFileRegex = /(test-(loader|support))|(testem)/i;
53
54 // create a dedicated worker
55 const pool = workerPool(`${__dirname}/worker.js`);
56
57 try {
58 let assets = files
59 // Skip test files
60 .filter((file) => {
61 let filename = path.basename(file);
62 return !testFileRegex.test(filename);
63 })
64 // Print human-readable file sizes (including gzipped)
65 .map((file) => {
66 return pool.exec('gzipStats', [file]);
67 });
68
69 return await Promise.all(assets);
70 } finally {
71 pool.terminate(); // terminate all workers when done
72 }
73 }
74
75 findFiles() {
76 let outputPath = this.outputPath;

Callers 3

printMethod · 0.95
printJSONMethod · 0.95

Calls 2

findFilesMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected