cli: make create-plugin add extension to app if possible

This commit is contained in:
Patrik Oldsberg
2021-01-31 15:12:29 +01:00
parent 8a8882ce06
commit fe3211cf38
4 changed files with 50 additions and 6 deletions
@@ -1,11 +1,11 @@
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { {{ pluginVar }}, ExamplePage } from '../src/plugin';
import { {{ pluginVar }}, {{ extensionName }} } from '../src/plugin';
createDevApp()
.registerPlugin({{ pluginVar }})
.addPage({
element: <ExamplePage />,
element: <{{ extensionName }} />,
title: 'Root Page',
})
.render();
@@ -1 +1 @@
export { {{ pluginVar }} } from './plugin';
export { {{ pluginVar }}, {{ extensionName }} } from './plugin';
@@ -9,7 +9,7 @@ export const {{ pluginVar }} = createPlugin({
},
});
export const ExamplePage = {{ pluginVar }}.provide(
export const {{ extensionName }} = {{ pluginVar }}.provide(
createRoutableExtension({
component: () =>
import('./components/ExampleComponent').then(m => m.ExampleComponent),