From b9048ee2c52263a4834e70b3247508355e8dee7c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 19 Jun 2023 14:59:46 -0700 Subject: [PATCH] Fix files not being copied on first esbuild watch (#185618) --- extensions/esbuild-webview-common.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/esbuild-webview-common.js b/extensions/esbuild-webview-common.js index 8a2a7d07a2d..c7a20839947 100644 --- a/extensions/esbuild-webview-common.js +++ b/extensions/esbuild-webview-common.js @@ -62,9 +62,8 @@ async function tryBuild(options, didBuild) { * @param {string[]} args * @param {(outDir: string) => unknown} [didBuild] */ -module.exports.run = function (config, args, didBuild) { +module.exports.run = async function (config, args, didBuild) { let outdir = config.outdir; - const outputRootIndex = args.indexOf('--outputRoot'); if (outputRootIndex >= 0) { const outputRoot = args[outputRootIndex + 1]; @@ -81,7 +80,7 @@ module.exports.run = function (config, args, didBuild) { const isWatch = args.indexOf('--watch') >= 0; if (isWatch) { - tryBuild(resolvedOptions); + await tryBuild(resolvedOptions, didBuild); const watcher = require('@parcel/watcher'); watcher.subscribe(config.srcDir, () => tryBuild(resolvedOptions, didBuild));