koa-webpack icon indicating copy to clipboard operation
koa-webpack copied to clipboard

Upgrade to webpackv5

Open ynotdraw opened this issue 3 years ago • 9 comments

This is a work-in-progress. I'm going to try some builds out for this.

This PR contains a:

  • [ ] bugfix
  • [X] new feature
  • [ ] code refactor
  • [ ] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

I'd love to start using webpack 5 now that it's been out a while.

Breaking Changes

Still working through this

Additional Info

  • logLevel was removed
    • https://github.com/webpack/webpack-dev-middleware/issues/774#issuecomment-734231560
  • lazy was removed
    • https://github.com/webpack/webpack-dev-middleware/issues/622#issuecomment-617249193

Webpack5 upgrade guide: https://webpack.js.org/migrate/5/

ynotdraw avatar Jul 20 '21 23:07 ynotdraw

Thanks for the PR, but I'm not interested in supporting v5 at the moment.

shellscape avatar Jul 20 '21 23:07 shellscape

Thanks for the PR, but I'm not interested in supporting v5 at the moment.

Ah I see. I read one of your comments that you'd gladly accept a PR upgrading to webpack5, which is why I started on some of this. Is there anything else I can do to help?

ynotdraw avatar Jul 20 '21 23:07 ynotdraw

Yeah, feelings changed. It's just a constant PITA with the buggy releases and the poor webpack-contrib management.

shellscape avatar Jul 20 '21 23:07 shellscape

Ah, no worries about feelings changing. Cheers!

ynotdraw avatar Jul 20 '21 23:07 ynotdraw

I do think quite a lot of people are interested in this though.

@shellscape Are you interested in supporting Webpack 5 eventually?

@ynotdraw Personally I would be interested in using your fork if you get this to work and publish it. No pressure of course. :)

remcohaszing avatar Jul 31 '21 13:07 remcohaszing

Integration with koa isn't something that's really needed anymore. If you take a look at the source in this package, you'll see that it's basically a fancy wrapper around webpack-dev-middleware, with some extra sauce for HMR. Using that as koa middleware is totally unnecessary these days. Take a look at https://github.com/shellscape/webpack-plugin-serve, which is a dev server using the successor components to everything that koa-webpack uses. It's less complicated, has fewer moving parts, and just as easy to turn on and off as koa middleware. I've used that plugin with every koa project I've worked on in the last two years, and haven't used koa-webpack myself since.

shellscape avatar Jul 31 '21 13:07 shellscape

I suppose you’re right. :)

Perhaps it’s time to officially deprecate this project then.

remcohaszing avatar Jul 31 '21 14:07 remcohaszing

No sense is deprecating as it still works with webpack v4 very well. But folks should look to better solutions moving forward.

shellscape avatar Jul 31 '21 14:07 shellscape

@shellscape I think maybe it would be nice to put disclaimer in readme (last two of your comments elaborate it well)? :-) thank you for your work here!

Reeywhaar avatar Dec 20 '21 16:12 Reeywhaar