core-api: workaround for backend:dev port conflict issue

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-03-03 01:12:18 +01:00
parent 1b8b40cfee
commit 11c6208fe2
2 changed files with 12 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Fixed an issue where the `backend:dev` command would get stuck executing the backend process multiple times, causing port conflict issues.
+7
View File
@@ -14,10 +14,17 @@
* limitations under the License.
*/
import fs from 'fs-extra';
import { Command } from 'commander';
import { paths } from '../../lib/paths';
import { serveBackend } from '../../lib/bundler/backend';
export default async (cmd: Command) => {
// Cleaning dist/ before we start the dev process helps work around an issue
// where we end up with the entrypoint executing multiple times, causing
// a port bind conflict among other things.
await fs.remove(paths.resolveTarget('dist'));
const waitForExit = await serveBackend({
entry: 'src/index',
checksEnabled: cmd.check,