Skip to content

Commit

Permalink
fix: support custom middleware on dev server (#6520)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia authored Sep 7, 2023
1 parent 1e4b20a commit b748810
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-planets-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ice/rspack-config': patch
---

fix: support custom middleware on dev server
2 changes: 2 additions & 0 deletions packages/rspack-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '');
Expand Down Expand Up @@ -161,6 +162,7 @@ const getConfig: GetConfig = (options) => {
logging: 'info',
},
...devServer,
setupMiddlewares: middlewares,
},
};
return config;
Expand Down

0 comments on commit b748810

Please sign in to comment.