Skip to content

Commit 6afe1d3

Browse files
authoredMay 7, 2023
perf: simplify logic, reduce extra loops and perf (#3767)
1 parent 10165f8 commit 6afe1d3

File tree

7 files changed

+225
-144
lines changed

7 files changed

+225
-144
lines changed
 

‎packages/serve/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class ServeCommand {
193193
for (const path in problemsByPath) {
194194
const problems = problemsByPath[path];
195195

196-
problems.forEach((problem: Problem) => {
196+
for (const problem of problems) {
197197
cli.logger.error(
198198
`${cli.capitalizeFirstLetter(problem.type.replace(/-/g, " "))}${
199199
problem.value ? ` '${problem.value}'` : ""
@@ -205,7 +205,7 @@ class ServeCommand {
205205
if (problem.expected) {
206206
cli.logger.error(`Expected: '${problem.expected}'`);
207207
}
208-
});
208+
}
209209
}
210210

211211
process.exit(2);

‎packages/webpack-cli/src/types.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ interface WebpackCLIConfig {
100100
interface WebpackCLICommand extends Command {
101101
pkg: string | undefined;
102102
forHelp: boolean | undefined;
103-
options: WebpackCLICommandOption[];
104103
_args: WebpackCLICommandOption[];
105104
}
106105

@@ -187,10 +186,7 @@ type Callback<T extends unknown[]> = (...args: T) => void;
187186
/**
188187
* Webpack
189188
*/
190-
type WebpackConfiguration = Configuration & {
191-
// TODO add extends to webpack types
192-
extends?: string | string[];
193-
};
189+
type WebpackConfiguration = Configuration;
194190
type ConfigOptions = PotentialPromise<WebpackConfiguration | CallableOption>;
195191
type CallableOption = (env: Env | undefined, argv: Argv) => WebpackConfiguration;
196192
type WebpackCompiler = Compiler | MultiCompiler;
@@ -209,7 +205,6 @@ type FileSystemCacheOptions = WebpackConfiguration & {
209205

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

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

215210
interface WebpackRunOptions extends WebpackOptionsNormalized {
@@ -339,7 +334,6 @@ export {
339334
Instantiable,
340335
JsonExt,
341336
ModuleName,
342-
MultipleCompilerStatsOptions,
343337
PackageInstallOptions,
344338
PackageManager,
345339
Path,

0 commit comments

Comments
 (0)
Please sign in to comment.