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
Add default filename when using through api #103
Conversation
This should be added to the documentation, but I think adding a default to the API is the wrong way. There should be a error message instead when in lazy mode but no |
Would you want to throw an error or just log it? |
Throw it. |
Rebased + updated. |
@@ -14,6 +14,9 @@ var historyApiFallback = require("connect-history-api-fallback"); | |||
function Server(compiler, options) { | |||
// Default options | |||
if(!options) options = {}; | |||
|
|||
if (!options.filename) throw new Error("'filename' option must be set."); |
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.
It's only required in lazy mode. So check of options.lazy
.
Updated! |
Add default filename when using through api
Thanks |
When trying to set-up webpack-dev-server today via the API I ran into an issue that I was unable to ever load the bundle.
The issue was that the
filename
is only given a default when set via the CLI. I updated the wiki to note this requirement however it'd be good to have it built into the code by default.