Skip to content
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

Default mode to development? #1327

Closed
1 of 2 tasks
billyjanitsch opened this issue Mar 1, 2018 · 4 comments
Closed
1 of 2 tasks

Default mode to development? #1327

billyjanitsch opened this issue Mar 1, 2018 · 4 comments

Comments

@billyjanitsch
Copy link
Member

  • Operating System: macOS 10.13.3
  • Node Version: 8.9.4
  • NPM Version: 5.7.1
  • webpack Version: 4.0.1
  • webpack-dev-server Version: 3.1.0
  • This is a bug
  • This is a modification request

Expected Behavior

webpack-dev-server should default mode to "development", since that will be the developer's intention in the vast majority of cases.

Actual Behavior

Currently, mode does not have a default, which causes webpack to default it to "production" and emit a warning.

For Bugs; How can we reproduce the behavior?

For Features; What is the motivation and/or use-case for the feature?

It's understandable for webpack itself to default to production settings if a mode isn't explicitly specified, but since webpack-dev-server is intended only for use in development, it seems reasonable to default to development settings unless the user explicitly overrides them.

@alexander-akait
Copy link
Member

@billyjanitsch no, you should set mode manually or using NODE_ENV, changing mode and env inside in code is bad practice. Exmaple:

cross-env NODE_ENV=development webpack-dev-server

@astorije
Copy link

astorije commented May 7, 2018

I'm with @billyjanitsch here, the default should be development, and I wouldn't deem bad practice to have sensible defaults.
Overriding the default using mode, --mode, or NODE_ENV should still be expected, but the default shouldn't be production IMO.

@paleite
Copy link

paleite commented May 25, 2018

This would be a really nice enhancement.

webpack-dev-server with default mode production is unexpected to me.
If there was a webpack-production-server, I wouldn't expect it to have default mode development, either.

However, if this repo was called webpack-server, I could understand the argument of not having a default mode (even though that probably goes against the zero-conf policy).

@Jokero
Copy link

Jokero commented Aug 12, 2018

@evilebottnawi Are you kidding?) It's absolutely illogical to have mode=production by default in dev-server. Original message now has 48 upvotes and 0 downvotes, it's for a reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants