webpack-dev-middleware icon indicating copy to clipboard operation
webpack-dev-middleware copied to clipboard

enable use other than express

Open noahehall opened this issue 3 years ago • 12 comments

  • Operating System: ubuntu
  • Node Version: latest
  • NPM Version: latest
  • webpack Version: latest
  • webpack-dev-middleware Version: latest

Feature Proposal

enable use of other backends. similar to my hacky approach here

if I could just say 'hey use this middleware instead of the default one' that would make my life really easier

thx!

Feature Use Case

i want to use koa, and koa-webpack doesnt work with webpack5

noahehall avatar Jun 19 '21 01:06 noahehall

Seems fair, if there are no means already to support this, @alexander-akait what do you think?

anshumanv avatar Jun 19 '21 04:06 anshumanv

Yes, why not, PR welcome

alexander-akait avatar Jun 21 '21 11:06 alexander-akait

We already support connect, express and fastify https://github.com/webpack/webpack-dev-middleware#fastify

alexander-akait avatar Jun 21 '21 11:06 alexander-akait

Yes, why not, PR welcome

will PR 👍

anshumanv avatar Jun 21 '21 11:06 anshumanv

Don't forget to add tests :smile:

alexander-akait avatar Jun 21 '21 11:06 alexander-akait

yep, any better name for option?

anshumanv avatar Jun 21 '21 12:06 anshumanv

No need option, it is internal changes, maybe it will work already, maybe we need to use other API to get headers or something else

alexander-akait avatar Jun 21 '21 12:06 alexander-akait

Example of pure API and express https://github.com/webpack/webpack-dev-middleware/blob/master/src/middleware.js#L105

alexander-akait avatar Jun 21 '21 12:06 alexander-akait

you guys are awesome. @alexander-akait

im planning on testing this tonight. sorry for the delay

noahehall avatar Aug 09 '21 23:08 noahehall

Hi, in my understanding, using fastify-express essentially means that you run an express server inside of fastify. I'd really like to use actual fastify. Does anyone know of any options to do this? Edit, I came across https://github.com/gajus/fastify-webpack-hot which looks promising.

IanVS avatar Jun 16 '22 03:06 IanVS

I can accept PR for adding fastify here and for dev server too

alexander-akait avatar Jun 16 '22 11:06 alexander-akait

We want to move webpack-dev-middleware to webpack-dev-server (and make it monorepo, so all packages related to dev server will be in one place), so I want to close this in favor https://github.com/webpack/webpack-dev-server/issues/4741, we still consider it (and I think we will implement this after the next major release)

alexander-akait avatar May 02 '23 22:05 alexander-akait