-
-
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
set default mode to development #1562
set default mode to development #1562
Conversation
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.
Looks good!
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.
Can we add tests?
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.
While the code is technically correct, I'm not sure this is the right thing to do.
webpack
defaults mode
on production
. I think WDS should do the same. I understand that WDS is a development tool but we should teach our users to specify a mode, not to use the default one. Moreover, webpack
raises a warning about mode
not being specified and being defaulted to production
. With this change, the warning vanishes which is not correct in my opinion.
Hi @ooflorent Personally I think what Webpack's warning is really saying (the reason behind it) is "Hey, I don't know if you want production or development, please specify or the result may be really wrong". That makes sense in Webpack's case, because from running But in this case, from Webpack will still warn when the user wants to build a production build with the I could definitely be missing something though, maybe you're thinking of a specific scenario? EDIT: to be clear it's not my decision in the end, I have no power here hehe, I just added my view on it. |
We need feedback from other developers |
For now there are 78 👍 on #1327
The warning will appear when I heard a lot about “zero configuration” and “sensible defaults”. Is it not sensible for webpack-dev-server to imply a dev enviroment? |
IMHO this sounds like a sane default (so one extra random developer there). @nAndreas: If you rebase, Travis should re-run and hopefully not fail. |
Codecov Report
@@ Coverage Diff @@
## master #1562 +/- ##
==========================================
+ Coverage 74.34% 74.52% +0.18%
==========================================
Files 10 10
Lines 690 691 +1
==========================================
+ Hits 513 515 +2
+ Misses 177 176 -1
Continue to review full report at Codecov.
|
@nAndreas we need add tests and we can merge this |
Hi, |
Hi, Feel free to take this PR anyone who wants to write the tests. Thanks |
Done in master |
For Bugs and Features; did you add new tests?
If this needs any tests I would appreciate some help what type of test, and where to add it
Motivation / Use-Case
Set default
mode
todevelopment
. webpack config and CLI option will override the default if provided.See #1560 and #1327
Breaking Changes
Additional Info
As far as I could tell the devServer options (just below the line changed in this PR) are only picked up from the first array item if the webpack config is an array(?). So I used the same principle for detecting
mode
in the config.