@@ -5,12 +5,12 @@ import type {
55} from 'node:http' ;
66import type { ServerOptions } from 'node:https' ;
77import type {
8+ DevServer ,
89 DevServerMiddlewareHandler ,
910 DevServerOpenOptions ,
1011 DevServerStaticItem ,
1112} from '@rspack/core' ;
1213import type { FSWatcher , ChokidarOptions as WatchOptions } from 'chokidar' ;
13- import type { Options as ConnectHistoryApiFallbackOptions } from 'connect-history-api-fallback' ;
1414import type {
1515 Server as ConnectApplication ,
1616 IncomingMessage as ConnectIncomingMessage ,
@@ -29,7 +29,6 @@ export type {
2929 ServerOptions ,
3030 IncomingMessage ,
3131 ConnectApplication ,
32- ConnectHistoryApiFallbackOptions ,
3332} ;
3433export type { IPv6 } from 'ipaddr.js' ;
3534export type { Socket } from 'node:net' ;
@@ -53,6 +52,11 @@ type BasicServer = import('node:net').Server | import('node:tls').Server;
5352/** https://github.com/microsoft/TypeScript/issues/29729 */
5453export type LiteralUnion < T extends U , U > = T | ( U & Record < never , never > ) ;
5554
55+ export type ConnectHistoryApiFallbackOptions = Exclude <
56+ NonNullable < DevServer [ 'historyApiFallback' ] > ,
57+ boolean
58+ > ;
59+
5660// type-level helpers, inferred as util types
5761export type Request < T extends BasicApplication = ConnectApplication > =
5862 T extends ConnectApplication ? ConnectIncomingMessage : IncomingMessage ;
0 commit comments