fix: support custom middleware on dev server (#6520)

This commit is contained in:
ClarkXia 2023-09-07 15:13:15 +08:00 committed by GitHub
parent 1e4b20af84
commit b748810588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
'@ice/rspack-config': patch
---
fix: support custom middleware on dev server

View File

@ -54,6 +54,7 @@ const getConfig: GetConfig = (options) => {
proxy,
devServer = {},
plugins = [],
middlewares,
} = taskConfig || {};
const absoluteOutputDir = path.isAbsolute(outputDir) ? outputDir : path.join(rootDir, outputDir);
const hashKey = hash === true ? 'hash:8' : (hash || '');
@ -161,6 +162,7 @@ const getConfig: GetConfig = (options) => {
logging: 'info',
},
...devServer,
setupMiddlewares: middlewares,
},
};
return config;