Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: simplify logic, reduce extra loops and perf #3767

Merged
merged 18 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/serve/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
for (const path in problemsByPath) {
const problems = problemsByPath[path];

problems.forEach((problem: Problem) => {
for (const problem of problems) {

Check warning on line 196 in packages/serve/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/serve/src/index.ts#L196

Added line #L196 was not covered by tests
cli.logger.error(
`${cli.capitalizeFirstLetter(problem.type.replace(/-/g, " "))}${
problem.value ? ` '${problem.value}'` : ""
Expand All @@ -205,7 +205,7 @@
if (problem.expected) {
cli.logger.error(`Expected: '${problem.expected}'`);
}
});
}
}

process.exit(2);
Expand Down
8 changes: 1 addition & 7 deletions packages/webpack-cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ interface WebpackCLIConfig {
interface WebpackCLICommand extends Command {
pkg: string | undefined;
forHelp: boolean | undefined;
options: WebpackCLICommandOption[];
_args: WebpackCLICommandOption[];
}

Expand Down Expand Up @@ -187,10 +186,7 @@ type Callback<T extends unknown[]> = (...args: T) => void;
/**
* Webpack
*/
type WebpackConfiguration = Configuration & {
// TODO add extends to webpack types
extends?: string | string[];
};
type WebpackConfiguration = Configuration;
type ConfigOptions = PotentialPromise<WebpackConfiguration | CallableOption>;
type CallableOption = (env: Env | undefined, argv: Argv) => WebpackConfiguration;
type WebpackCompiler = Compiler | MultiCompiler;
Expand All @@ -209,7 +205,6 @@ type FileSystemCacheOptions = WebpackConfiguration & {

type ProcessedArguments = Record<string, BasicPrimitive | RegExp | (BasicPrimitive | RegExp)[]>;

type MultipleCompilerStatsOptions = StatsOptions & { children: StatsOptions[] };
type CommandAction = Parameters<WebpackCLICommand["action"]>[0];

interface WebpackRunOptions extends WebpackOptionsNormalized {
Expand Down Expand Up @@ -339,7 +334,6 @@ export {
Instantiable,
JsonExt,
ModuleName,
MultipleCompilerStatsOptions,
PackageInstallOptions,
PackageManager,
Path,
Expand Down