File tree Expand file tree Collapse file tree 4 files changed +47
-8
lines changed
Expand file tree Collapse file tree 4 files changed +47
-8
lines changed Original file line number Diff line number Diff line change 4848 "@rspack/dev-middleware" : " ^2.0.0" ,
4949 "@types/ws" : " ^8.18.1" ,
5050 "chokidar" : " ^5.0.0" ,
51- "connect-history-api-fallback" : " ^2.0.0" ,
5251 "connect-next" : " ^4.0.0" ,
5352 "ws" : " ^8.20.0"
5453 },
5958 "@rspack/core" : " 2.0.0-rc.0" ,
6059 "@rspack/plugin-react-refresh" : " 1.6.1" ,
6160 "@rstest/core" : " ^0.9.5" ,
61+ "@types/connect-history-api-fallback" : " ^1.5.4" ,
6262 "@types/mime-types" : " 3.0.1" ,
6363 "@types/node" : " ^24.12.0" ,
6464 "@types/serve-static" : " ^2.2.0" ,
6565 "@types/trusted-types" : " ^2.0.7" ,
6666 "@types/ws" : " 8.18.1" ,
67+ "connect-history-api-fallback" : " ^2.0.0" ,
6768 "cross-env" : " ^10.1.0" ,
6869 "css-loader" : " ^7.1.4" ,
6970 "express" : " ^5.2.1" ,
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ export default defineConfig({
88 dts : true ,
99 output : {
1010 externals : {
11- 'connect-history-api-fallback' :
12- 'commonjs connect-history-api-fallback' ,
1311 selfsigned : 'commonjs selfsigned' ,
1412 } ,
1513 } ,
Original file line number Diff line number Diff line change @@ -1865,7 +1865,9 @@ class Server<
18651865 }
18661866
18671867 if ( this . options . historyApiFallback ) {
1868- const connectHistoryApiFallback = require ( 'connect-history-api-fallback' ) ;
1868+ const { default : connectHistoryApiFallback } = await import (
1869+ /* webpackChunkName: "connect-history-api-fallback" */ 'connect-history-api-fallback'
1870+ ) ;
18691871
18701872 const { historyApiFallback } = this . options ;
18711873
@@ -1885,7 +1887,7 @@ class Server<
18851887 name : 'connect-history-api-fallback' ,
18861888 middleware : connectHistoryApiFallback (
18871889 historyApiFallback as ConnectHistoryApiFallbackOptions ,
1888- ) ,
1890+ ) as DevServerMiddlewareHandler ,
18891891 } ) ;
18901892
18911893 // include our middleware to ensure
You can’t perform that action at this time.
0 commit comments