cli: fix plugin serve file watching

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-09-27 18:43:16 +02:00
parent 8117926014
commit 3a8704f16b
2 changed files with 11 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Only serve static assets if there is a public folder during `app:serve` and `plugin:serve`. This fixes a common bug that would break `plugin:serve` with an `EBUSY` error.
+6 -4
View File
@@ -50,10 +50,12 @@ export async function serveBundle(options: ServeOptions) {
publicPath: config.output?.publicPath as string,
stats: 'errors-warnings',
},
static: {
publicPath: config.output?.publicPath as string,
directory: paths.targetPublic ?? '/',
},
static: paths.targetPublic
? {
publicPath: config.output?.publicPath as string,
directory: paths.targetPublic,
}
: undefined,
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebookincubator/create-react-app/issues/387.