MCPcopy
hub / github.com/microsoft/vscode-js-debug / incrementalEsbuild

Function incrementalEsbuild

gulpfile.js:115–133  ·  view source on GitHub ↗
(/** @type {esbuild.BuildOptions} */ options)

Source from the content-addressed store, hash-verified

113
114const cachedBuilds = new Map();
115const incrementalEsbuild = async (/** @type {esbuild.BuildOptions} */ options) => {
116 const key = JSON.stringify(options);
117 if (cachedBuilds.has(key)) {
118 return cachedBuilds.get(key).rebuild();
119 }
120
121 if (!isWatch) {
122 const r = await esbuild.build(options);
123 if (r.metafile) {
124 console.log(await esbuild.analyzeMetafile(r.metafile));
125 }
126 return;
127 }
128
129 const ctx = await esbuild.context(options);
130 cachedBuilds.set(key, ctx);
131
132 await ctx.rebuild();
133};
134
135gulp.task('compile:build-scripts', async () =>
136 incrementalEsbuild({

Callers 2

gulpfile.jsFile · 0.85
compileTsFunction · 0.85

Calls 5

buildMethod · 0.80
hasMethod · 0.65
getMethod · 0.65
logMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected