Skip to content

Allow using webpack-hot-middleware as middleware #67

Open
@nickrttn

Description

Currently, when attempting to use webpack-hot-middleware as EleventyDevServer middleware, webpack-hot-middleware's browser client cannot connect to the endpoint exposed by webpack-hot-middleware, for whatever reason.

From what I've been able to figure out myself, webpack-hot-middleware attempts to send headers to the client, but these never arrive, from here: https://github.com/webpack-contrib/webpack-hot-middleware/blob/master/middleware.js#L100

webpack-dev-middleware is working, as the bundled scripts are being served from memory.

I've created a reduced test case where you can see the behavior occur. It would be great if this use case would be supported, so Webpack can be integrated directly into 11ty dev server and there is no need for orchestrating several running processes.

Please see the reproduction here: https://github.com/nickrttn/11ty-webpack, to reproduce:

git clone https://github.com/nickrttn/11ty-webpack
cd 11ty-webpack
npm install
npm run start

Then open http://localhost:8080, and see that /__webpack_hmr cannot be connected to (times out after 20s) and does not receive headers or body content.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions