Skip to content
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

lazy: true won't ever trigger rebuild without undocumented option "filename" set. #25

Closed
grrowl opened this issue Feb 5, 2015 · 3 comments

Comments

@grrowl
Copy link

grrowl commented Feb 5, 2015

I have it narrowed down to line 135 of middleware.js:

if(options.lazy && filename === pathJoin(compiler.outputPath, options.filename))

When the undocumented option filename isn't set, it will attempt to match /Users/tom/Documents/somewebsite/dist/undefined, fail, and the request will fall through to the next handler, regardless of the file.

Setting { lazy: true, filename: "client.js" } in the dev-middleware config allows it to handle the request, but this won't work for webpack configurations with multiple entry points.

@grrowl grrowl changed the title lazy: true won't ever trigger rebuild without undocumented option set. lazy: true won't ever trigger rebuild without undocumented option "filename" set. Feb 5, 2015
@grrowl
Copy link
Author

grrowl commented Feb 6, 2015

It's also worth mentioning in the readme that lazy compilation is incompatible with Hot Module Replacement (although in hindsight, it should have been moderately obvious)

@hswolff
Copy link

hswolff commented Feb 8, 2015

Ran into same issue from the dev server: webpack/webpack-dev-server#103

@SpaceK33z
Copy link
Member

Closing this very old issue, since it appears to have been fixed a while ago. filename is now a documented option, and this middleware also works if you don't define it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants