From cb33f0c0670bd2aaf1a0a751b25646242d5df5f6 Mon Sep 17 00:00:00 2001 From: Daniel Izdebski Date: Tue, 9 Jan 2024 19:36:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20chore(core)?= =?UTF-8?q?:=20Drop=20`console.log`=20when=20compiling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/cli/compileWalletSetupFunctions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/cli/compileWalletSetupFunctions.ts b/packages/core/src/cli/compileWalletSetupFunctions.ts index 9c154bb58..c3f13bac5 100644 --- a/packages/core/src/cli/compileWalletSetupFunctions.ts +++ b/packages/core/src/cli/compileWalletSetupFunctions.ts @@ -29,7 +29,6 @@ export async function compileWalletSetupFunctions(walletSetupDir: string, debug: ) } - // TODO: In this step, modify `console.log` so it prints from which file the log is coming from. await build({ name: 'cli-build', silent: true, @@ -44,6 +43,11 @@ export async function compileWalletSetupFunctions(walletSetupDir: string, debug: external: ['@synthetixio/synpress', '@playwright/test', 'playwright-core', 'esbuild', 'tsup'], banner: { js: FIXES_BANNER + }, + esbuildOptions(options) { + // TODO: In this step, if the debug file is present, we should modify `console.log` so it prints from which file the log is coming from. + // We're dropping `console.log` and `debugger` statements because they do not play nicely with the Playwright Test Runner. + options.drop = debug ? [] : ['console', 'debugger'] } })