Skip to content

Commit

Permalink
BREAKING CHANGE: remove CLI default flag values for webpack-cli serve (
Browse files Browse the repository at this point in the history
  • Loading branch information
knagaitsev authored Aug 22, 2020
1 parent 86140c5 commit 289a98f
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 5 deletions.
3 changes: 1 addition & 2 deletions bin/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
{
name: 'live-reload',
type: Boolean,
defaultValue: true,
describe: 'Enables/Disables live reloading on changing files',
},
{
Expand Down Expand Up @@ -57,12 +56,12 @@ module.exports = {
name: 'open-page',
type: String,
describe: 'Open default browser with the specified page',
multiple: true,
},
{
name: 'client-logging',
type: String,
group: DISPLAY_GROUP,
defaultValue: 'info',
describe:
'Log level in the browser (none, error, warn, info, log, verbose)',
},
Expand Down
2 changes: 0 additions & 2 deletions bin/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const options = {
'live-reload': {
type: 'boolean',
describe: 'Enables/Disables live reloading on changing files',
default: true,
},
profile: {
type: 'boolean',
Expand Down Expand Up @@ -56,7 +55,6 @@ const options = {
'client-logging': {
type: 'string',
group: DISPLAY_GROUP,
default: 'info',
describe:
'Log level in the browser (none, error, warn, info, log, verbose)',
},
Expand Down
2 changes: 2 additions & 0 deletions client-src/default/utils/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
const log = require('webpack/lib/logging/runtime');

const name = 'webpack-dev-server';
// default level is set on the client side, so it does not need
// to be set by the CLI or API
const defaultLevel = 'info';

function setLogLevel(level) {
Expand Down
8 changes: 7 additions & 1 deletion lib/utils/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ function createConfig(config, argv, { port }) {
options.bonjour = true;
}

if (argv.host && (argv.host !== 'localhost' || !options.host)) {
// CLI args host takes precedence over devServer host
if (argv.host) {
options.host = argv.host;
}

// host defaults to localhost for CLI if none is provided
if (!options.host) {
options.host = 'localhost';
}

if (argv.allowedHosts) {
options.allowedHosts = argv.allowedHosts.split(',');
}
Expand Down
Loading

0 comments on commit 289a98f

Please sign in to comment.