MCPcopy
hub / github.com/babel/babel / buildBabel

Function buildBabel

Gulpfile.ts:276–308  ·  view source on GitHub ↗
(useWorker: boolean, ignore: PackageInfo[] = [])

Source from the content-addressed store, hash-verified

274}
275
276async function buildBabel(useWorker: boolean, ignore: PackageInfo[] = []) {
277 const worker = await createWorker(useWorker);
278 const files = new Glob(defaultSourcesGlob, {
279 ignore: ignore.map(p => `${p.src}/**`),
280 posix: true,
281 });
282
283 const promises = [];
284 for await (const file of files) {
285 // @example ./packages/babel-parser/src/index.js
286 const dest = "./" + mapSrcToLib(file);
287 promises.push(
288 worker.transform(file, dest, {
289 sourceMaps: !file.endsWith(".d.ts"),
290 })
291 );
292 }
293 return Promise.allSettled(promises)
294 .then(results => {
295 results.forEach(result => {
296 if (result.status === "rejected") {
297 if (process.env.WATCH_SKIP_BUILD) {
298 console.error(result.reason);
299 } else {
300 throw result.reason;
301 }
302 }
303 });
304 })
305 .finally(() => {
306 worker.end?.();
307 });
308}
309
310/**
311 * Resolve a nested dependency starting from the given file

Callers 1

Gulpfile.tsFile · 0.85

Calls 6

createWorkerFunction · 0.85
mapSrcToLibFunction · 0.85
mapMethod · 0.80
transformMethod · 0.65
pushMethod · 0.45
endsWithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…