cleaning up.

Signed-off-by: Aramis Sennyey <sennyeya@amazon.com>
This commit is contained in:
Aramis Sennyey
2022-11-22 15:26:19 -05:00
parent 63310e3987
commit aa14a5453d
3 changed files with 4 additions and 8 deletions
-2
View File
@@ -213,8 +213,6 @@ Options:
--experimental-type-build
--skip-build-dependencies
--stats
--public-path <path>
--backend-url <url>
--config <path>
-h, --help
```
@@ -18,17 +18,16 @@ import fs from 'fs-extra';
import { resolve as resolvePath } from 'path';
import { buildBundle } from '../../lib/bundler';
import { getEnvironmentParallelism } from '../../lib/parallel';
import { loadCliConfig, CliConfigOptions } from '../../lib/config';
import { loadCliConfig } from '../../lib/config';
interface BuildAppOptions {
targetDir: string;
writeStats: boolean;
cliOptions?: CliConfigOptions;
configPaths: string[];
}
export async function buildFrontend(options: BuildAppOptions) {
const { targetDir, writeStats, configPaths, cliOptions } = options;
const { targetDir, writeStats, configPaths } = options;
const { name } = await fs.readJson(resolvePath(targetDir, 'package.json'));
await buildBundle({
targetDir,
@@ -38,7 +37,6 @@ export async function buildFrontend(options: BuildAppOptions) {
...(await loadCliConfig({
args: configPaths,
fromPackage: name,
cliOptions,
})),
});
}
+2 -2
View File
@@ -157,7 +157,7 @@ function useConfigLoader(
let configReader = ConfigReader.fromConfigs(config.value ?? []);
const resolveRelativeUrl = (relativeUrl: string) => {
// Backend.baseUrl should always be defined.
// relativeUrl should always be defined.
let url;
try {
url = new URL(relativeUrl, document.location.origin).href.replace(
@@ -165,7 +165,7 @@ function useConfigLoader(
'',
);
} catch (err) {
// Backend.baseUrl was not a valid URL. This should be caught during the build process.
// relativeUrl was not a valid URL. This should be caught during the build process.
}
return url;
};