Skip to content

Commit

Permalink
fix(cli): wrong entry defaults from cli (#7541)
Browse files Browse the repository at this point in the history
  • Loading branch information
xc2 authored Aug 12, 2024
1 parent e311871 commit bea8415
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions packages/rspack-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ import type {
RspackCLILogger,
RspackCLIOptions
} from "./types";
import findConfig from "./utils/findConfig";
import { type LoadedRspackConfig, loadRspackConfig } from "./utils/loadConfig";
import { normalizeEnv } from "./utils/options";

type Command = "serve" | "build";

const defaultEntry = "src/index";
export class RspackCLI {
colors: RspackCLIColors;
program: yargs.Argv;
Expand Down Expand Up @@ -131,13 +129,6 @@ export class RspackCLI {
item.entry = {
main: options.entry.map(x => path.resolve(process.cwd(), x))[0] // Fix me when entry supports array
};
} else if (!item.entry) {
const defaultEntryBase = path.resolve(process.cwd(), defaultEntry);
const defaultEntryPath =
findConfig(defaultEntryBase) || `${defaultEntryBase}.js`; // default entry is js
item.entry = {
main: defaultEntryPath
};
}
// to set output.path
item.output = item.output || {};
Expand Down

2 comments on commit bea8415

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs ❌ failure
_selftest ✅ success
nx ❌ failure
rspress ✅ success
rsbuild ✅ success
examples ✅ success

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-08-12 a7844d9) Current Change
10000_development-mode + exec 2.31 s ± 26 ms 2.32 s ± 32 ms +0.38 %
10000_development-mode_hmr + exec 697 ms ± 10 ms 695 ms ± 7.1 ms -0.27 %
10000_production-mode + exec 2.86 s ± 21 ms 2.86 s ± 39 ms -0.04 %
arco-pro_development-mode + exec 1.86 s ± 57 ms 1.88 s ± 97 ms +1.13 %
arco-pro_development-mode_hmr + exec 433 ms ± 1.1 ms 433 ms ± 2.7 ms -0.06 %
arco-pro_production-mode + exec 3.45 s ± 74 ms 3.44 s ± 119 ms -0.37 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.54 s ± 88 ms 3.52 s ± 49 ms -0.65 %
threejs_development-mode_10x + exec 1.7 s ± 12 ms 1.7 s ± 19 ms -0.02 %
threejs_development-mode_10x_hmr + exec 821 ms ± 5.6 ms 816 ms ± 6.8 ms -0.60 %
threejs_production-mode_10x + exec 5.48 s ± 32 ms 5.5 s ± 39 ms +0.37 %

Please sign in to comment.