-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CLI doesn't behave like Node API #106
Comments
The node.js API has no access to the webpack options. You just pass an This has the effect that you have to do many things manually, i. e. The CLI can do this things because it has access to the webpack options. |
Is there a reason Compiler can't expose its options? |
It does expose it, but by design you shouldn't access it.
by design. This way we can write other compilers that work with the webpack-dev-server, i. e. the MultiCompiler... |
We can make |
In general I think one of the usability issues with Webpack is it isn't strict enough in the configuration. For example you can write |
Another difference between CLI and Node API: with CLI, I can omit |
I can't use the inline option as well :(
|
This is a very old issue, but I still want to fix this. Looking at @sokra, do you think it makes sense to remove the default
This is probably getting fixed in #337. |
Closing in favor of #616. |
A lot of times when somebody has problems with webpack-dev-server CLI, I suggest them use Node API instead and their problem disappears. Here's two recent issues I've seen.
Take this sample project from gaearon/react-hot-loader#77.
Run
node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --hot --port 8080
. Change a file. HMR will work but will outputUncaught RangeError: Maximum call stack size exceeded
on every update.Then add a
server.js
that should by all means be identical to the call above:Magically, this doesn't work at all. The reason is because WebpackDevServer doesn't read
publicPath
from Webpack config. I always end up passing it manually. Why is this necessary?Okay, let's pass it manually:
Voila!
RangeError
is gone.RangeError
, another one works.publicPath
from Webpack config?The text was updated successfully, but these errors were encountered: