Skip to content

Commit 2bf550d

Browse files
committed
perf: remove schema-utils dependency and validation
1 parent 4872210 commit 2bf550d

4 files changed

Lines changed: 2 additions & 15 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
"launch-editor": "^2.6.1",
118118
"open": "^10.0.3",
119119
"p-retry": "^6.2.0",
120-
"schema-utils": "^4.2.0",
121120
"selfsigned": "^2.4.1",
122121
"serve-index": "^1.9.1",
123122
"sockjs": "^0.3.24",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import * as path from 'node:path';
1414
import * as url from 'node:url';
1515
import * as util from 'node:util';
1616
import * as ipaddr from 'ipaddr.js';
17-
import { validate } from 'schema-utils';
1817
import schema from './options.json';
1918
import type {
2019
BasicApplication,
@@ -49,7 +48,6 @@ import type {
4948
Stats,
5049
MultiStats,
5150
DevServer,
52-
Schema,
5351
StatsOptions,
5452
NetworkInterfaceInfo,
5553
WebSocketURL,
@@ -188,11 +186,6 @@ class Server<
188186
stats: Stats | MultiStats | undefined;
189187

190188
constructor(options: DevServer, compiler: Compiler | MultiCompiler) {
191-
validate(schema as Schema, options, {
192-
name: 'Dev Server',
193-
baseDataPath: 'options',
194-
});
195-
196189
this.compiler = compiler;
197190
this.logger = this.compiler.getInfrastructureLogger('webpack-dev-server');
198191
this.options = options as unknown as Configuration<A, S>;
@@ -204,8 +197,8 @@ class Server<
204197
this.currentHash = undefined;
205198
}
206199

207-
static get schema(): Schema {
208-
return schema as Schema;
200+
static get schema() {
201+
return schema;
209202
}
210203

211204
static get DEFAULT_STATS(): StatsOptions {

src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ import type {
3838
} from 'http-proxy-middleware';
3939
export type { RequestHandler };
4040
export type { IPv6 } from 'ipaddr.js';
41-
// biome-ignore lint/suspicious/noExplicitAny: Schema type from schema-utils
42-
export type Schema = Record<string, any>;
4341
import type { Options as ServeIndexOptions } from 'serve-index';
4442
export type { ServeIndexOptions };
4543
import type { ServeStaticOptions } from 'serve-static';

0 commit comments

Comments
 (0)