-
-
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
fix(cli): use webpack-cli@4 #2845
Conversation
preprocess() { | ||
process.argv.splice(2, 0, 'serve'); | ||
}, |
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.
This file is copied from webpack/bin/webpack.js and these lines were added.
Codecov Report
@@ Coverage Diff @@
## v4 #2845 +/- ##
==========================================
- Coverage 93.01% 92.62% -0.39%
==========================================
Files 39 38 -1
Lines 1302 1247 -55
Branches 355 326 -29
==========================================
- Hits 1211 1155 -56
Misses 87 87
- Partials 4 5 +1
Continue to review full report at Codecov.
|
196f706
to
dedd67b
Compare
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.
We need improve this, but yes, it is very good job
I need to go home (tired 😞 ), let's finish tomorrow, do you have time? Just ping me when it will be ready for review |
@evilebottnawi No worries, whenever you want. This PR is ready for review. |
Just note - let's add test on output using snapshot, we need to make sure your console output looks good, just start server via CLI do snapshot, change something and do snapshot again, I am afraid we can have some incompatibilities with webpack-cli |
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.
Good job, thanks, I found a lot of strange deps like - find-cache-dir
/util
/url
/many be other, can you look at code and maybe remove some of them, because I found them are unnecessary
@evilebottnawi webpack-dev-server/lib/utils/getCertificate.js Lines 11 to 15 in ccdce35
util and url are polyfills of Node modules for browsers.
|
Thank you for the review! |
@ylemkimon Found other bug(s) with CLI, we have https://github.com/webpack/webpack-dev-server/blob/master/bin/cli-flags.js and https://github.com/webpack/webpack-dev-server/blob/master/bin/options.js, |
webpack-dev-server/bin/cli-flags.js Lines 53 to 55 in ccdce35
|
Oh, yes , I see, anyway we have one extra file, let's remove it |
Where was |
For Bugs and Features; did you add new tests?
Yes
Motivation / Use-Case
setupExitSignals
option. Takes aboolean
and iftrue
(default on CLI), the server will close and exit the process onSIGINT
andSIGTERM
server.listen()
will find free port ifthis.options.port
is not set andport
argument is not passedoptions.port
andport
passed as an argument is differentwebpack serve
.Breaking Changes
server.listen()
now returns a Promise, which will resolve toserver.listeningApp
, after finding the free port.webpack-dev-server
CLI,utils/createConfig
, andutils/processOptions
are removed.Additional Info
webpack-cli PR: webpack/webpack-cli#2126