-
-
Notifications
You must be signed in to change notification settings - Fork 380
refactor: use express recommended api #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #727 +/- ##
=======================================
Coverage 99.57% 99.57%
=======================================
Files 10 10
Lines 234 235 +1
Branches 71 71
=======================================
+ Hits 233 234 +1
Misses 1 1
Continue to review full report at Codecov.
|
thanks, but is this necessary changes? |
@hiroppy In v4.0.0-rc.3 if I hack with koa: const expressMiddleware = require('webpack-dev-middleware').default;
module.exports = (compiler, options) => {
const middleware = expressMiddleware(compiler, options);
const devMiddleware = async (ctx, next) => {
const locals = ctx.state;
const set = ctx.set.bind(ctx);
const get = ctx.get.bind(ctx);
const send = content => (ctx.body = content);
await middleware(ctx.request, { set, get, send, locals, setHeader: set }, next);
};
Object.keys(middleware).forEach(key => {
devMiddleware[key] = middleware[key];
});
return devMiddleware;
};
#617 might be a better solution! |
@nuintun sorry we never support |
@evilebottnawi This PR is only for unified API usage, not for compatibility with koa! webpack-dev-middleware/src/middleware.js Line 64 in 49a1203
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, yes, thanks for the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR contains a:
Motivation / Use-Case
Breaking Changes
Additional Info