config-loader,backend-common: refactor config loading to pass in path and use common util for backend

This commit is contained in:
Patrik Oldsberg
2020-08-03 18:21:03 +02:00
parent aa265769d2
commit 62222b543c
20 changed files with 50 additions and 100 deletions
+2 -1
View File
@@ -17,10 +17,11 @@
import { Command } from 'commander';
import { loadConfig } from '@backstage/config-loader';
import { ConfigReader } from '@backstage/config';
import { paths } from '../../lib/paths';
import { buildBundle } from '../../lib/bundler';
export default async (cmd: Command) => {
const appConfigs = await loadConfig();
const appConfigs = await loadConfig({ rootPath: paths.targetRoot });
await buildBundle({
entry: 'src/index',
statsJsonEnabled: cmd.stats,
+2 -1
View File
@@ -17,10 +17,11 @@
import { Command } from 'commander';
import { loadConfig } from '@backstage/config-loader';
import { ConfigReader } from '@backstage/config';
import { paths } from '../../lib/paths';
import { serveBundle } from '../../lib/bundler';
export default async (cmd: Command) => {
const appConfigs = await loadConfig();
const appConfigs = await loadConfig({ rootPath: paths.targetRoot });
const waitForExit = await serveBundle({
entry: 'src/index',
checksEnabled: cmd.check,
+2 -1
View File
@@ -17,10 +17,11 @@
import { ConfigReader } from '@backstage/config';
import { loadConfig } from '@backstage/config-loader';
import { Command } from 'commander';
import { paths } from '../../lib/paths';
import { serveBackend } from '../../lib/bundler/backend';
export default async (cmd: Command) => {
const appConfigs = await loadConfig();
const appConfigs = await loadConfig({ rootPath: paths.targetRoot });
const waitForExit = await serveBackend({
entry: 'src/index',
checksEnabled: cmd.check,
+2 -1
View File
@@ -17,10 +17,11 @@
import { Command } from 'commander';
import { loadConfig } from '@backstage/config-loader';
import { ConfigReader } from '@backstage/config';
import { paths } from '../../lib/paths';
import { buildBundle } from '../../lib/bundler';
export default async (cmd: Command) => {
const appConfigs = await loadConfig();
const appConfigs = await loadConfig({ rootPath: paths.targetRoot });
await buildBundle({
entry: 'dev/index',
statsJsonEnabled: cmd.stats,
+2 -1
View File
@@ -17,10 +17,11 @@
import { Command } from 'commander';
import { loadConfig } from '@backstage/config-loader';
import { ConfigReader } from '@backstage/config';
import { paths } from '../../lib/paths';
import { serveBundle } from '../../lib/bundler';
export default async (cmd: Command) => {
const appConfigs = await loadConfig();
const appConfigs = await loadConfig({ rootPath: paths.targetRoot });
const waitForExit = await serveBundle({
entry: 'dev/index',
checksEnabled: cmd.check,