Skip to content

Commit 671d402

Browse files
fix: add cli override support for rspack config path
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
1 parent 799e8f8 commit 671d402

3 files changed

Lines changed: 137 additions & 129 deletions

File tree

lib/compiler/helpers/get-rspack-config-path.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getValueOrDefault } from './get-value-or-default.js';
33

44
/**
55
* Returns the path to the rspack configuration file to use for the given application.
6+
* CLI option `rspackPath` takes precedence over the configuration file.
67
* @param configuration Configuration object.
78
* @param cmdOptions Command line options.
89
* @param appName Application name.
@@ -13,6 +14,10 @@ export function getRspackConfigPath(
1314
cmdOptions: Record<string, any>,
1415
appName: string | undefined,
1516
) {
17+
if (cmdOptions?.rspackPath) {
18+
return cmdOptions.rspackPath as string;
19+
}
20+
1621
const builder = getValueOrDefault<Builder>(
1722
configuration,
1823
'compilerOptions.builder',

0 commit comments

Comments
 (0)