@@ -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,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user