-
-
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
Minimalize differences between CLI and Node.js API and move CLI in webpack-cli
#616
Comments
You marked it for version 3. Might it be possible to earlier make more clear what the CLI attaches/changes at the configuration? Still have issues with public path, my webpack config works fine with CLI but not with the Node API :( |
@axe312ger, #615 will introduce config validation. Feel free to join that discussion if you have more ideas for validation. We're also working on better docs, which will be released with v2. |
This definitely needs to be addressed. For example, look at the official docs on Also, speaking of config differences, I can see people starting out with CLI and then switching to programmatic use, doing something like |
any progress ? |
@wesleymostien none yet. this is planned for the v3 work. protip: if there were commits against this issue/task, you'd see github list those referenced commits in this issue along with the comments - they make it easy to know if there's been progress without having to post follow-up comments 😄 |
I've tried to run WDS from my own CLI, but I can't make it behave the same way as running the binary directly. Using the |
#994 is still an issue, lack of uniformity between cli and node api is a huge issue for webpack noobs like me |
Please, feel free to do some nice works and time for it. |
webpack-cli
We should move CLI logic to
Feel free to discussion |
So after hours and lots of comment reading here is what I found. This is my minimal config modifier that makes it work with a existing build config. But yeah way to many differences and not in open place. Because there are a lot of moving parts when you add in HMR.
|
@navstev0 Can you create minimum reproducible test repo |
Sure I will do that later tonight. |
Close in favor #1960 |
There are some differences between the CLI and Node.js API that make webpack-dev-server a lot harder to use for people. Most differences are documented in the wiki, but users often don't look at this. They also shouldn't have to.
The first problem is that the CLI in
inline
modus (which is the default since v2), automatically adds an entry to the webpack config. When you use the API, you need to do this manually. What makes it more confusing is that there is is ainline
option, but that only has effect when using the CLI.The second problem is that, when using
--hot
, the CLI adds an entry to the webpack config and adds theHotModuleReplacementPlugin
. In the API, you need to add those two things yourself, as well as sethot: true
.The idea was that the API shouldn't mutate the webpack config. This is indeed iffy, but perhaps there are other ways to do this without mutating the config. Or if there is not, maybe it's worth it to mutate the config? The current situation causes many issues with users.
Related to #106, but that discussion is quite old and not all points are valid anymore.
cc @bebraw
The text was updated successfully, but these errors were encountered: