build(devtools): fix issue where esbuild configs were not being set properly in DevTools (#48762)

Previously, a createConfig helper function was created to consolidate common esbuild configurations for DevTools. This function is asynchronous, but when it was used to set the configuration in various esbuild config files, it was used as if it was synchronous.

This commit fixes this issue by wrapping the output of the function in await, so that it propagates the configurations to esbuild correctly.

PR Close #48762
This commit is contained in:
AleksanderBodurri 2023-01-18 03:50:33 -05:00 committed by Andrew Kushnir
parent 42ca9c0b02
commit 3a688cb5ec
4 changed files with 4 additions and 4 deletions

View file

@ -9,6 +9,6 @@
import createConfig from './esbuild-base.config.mjs';
export default {
...createConfig({enableLinker: true, optimize: true}),
...(await createConfig({enableLinker: true, optimize: true})),
format: 'esm',
};

View file

@ -9,6 +9,6 @@
import createConfig from './esbuild-base.config.mjs';
export default {
...createConfig({enableLinker: true, optimize: false}),
...(await createConfig({enableLinker: true, optimize: false})),
format: 'esm',
};

View file

@ -9,6 +9,6 @@
import createConfig from './esbuild-base.config.mjs';
export default {
...createConfig({enableLinker: false, optimize: false}),
...(await createConfig({enableLinker: false, optimize: false})),
format: 'iife',
};

View file

@ -9,7 +9,7 @@
import createConfig from './esbuild-base.config.mjs';
export default {
...createConfig({enableLinker: true, optimize: false}),
...(await createConfig({enableLinker: true, optimize: false})),
// Use the `iife` format for the test entry-point as tests should run immediately.
// For browser tests which are wrapped in an AMD header and footer, this works as well.
format: 'iife',