Merge pull request #2207 from spotify/eide/plugin-route-in-isolation-fix

devApp: Add non-legacy routes too
This commit is contained in:
Marcus Eide
2020-09-01 11:26:33 +02:00
committed by GitHub
2 changed files with 17 additions and 8 deletions
@@ -2,13 +2,13 @@ import { createPlugin, createRouteRef } from '@backstage/core';
import ExampleComponent from './components/ExampleComponent';
export const rootRouteRef = createRouteRef({
path: '/{{ id }}',
title: '{{ id }}',
path: '/{{ id }}',
title: '{{ id }}',
});
export const plugin = createPlugin({
id: '{{ id }}',
register({ router }) {
router.addRoute(rootRouteRef, ExampleComponent);
},
id: '{{ id }}',
register({ router }) {
router.addRoute(rootRouteRef, ExampleComponent);
},
});
+11 -2
View File
@@ -199,8 +199,17 @@ class DevAppBuilder {
for (const plugin of plugins) {
for (const output of plugin.output()) {
if (output.type === 'legacy-route') {
paths.push(output.path);
switch (output.type) {
case 'legacy-route': {
paths.push(output.path);
break;
}
case 'route': {
paths.push(output.target.path);
break;
}
default:
break;
}
}
}