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

What's the difference in the entry config? #73

Closed
tiye opened this issue Feb 10, 2015 · 2 comments
Closed

What's the difference in the entry config? #73

tiye opened this issue Feb 10, 2015 · 2 comments

Comments

@tiye
Copy link

tiye commented Feb 10, 2015

This loader uses config:

entry: [
  'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
  'webpack/hot/only-dev-server',
  './scripts/index' // Your appʼs entry point
]

while the official docs suggests:
http://webpack.github.io/docs/webpack-dev-server.html

 entry: {
    app: ['webpack/hot/dev-server', './app/main.js']
  },

Why is this different?

@gaearon
Copy link
Owner

gaearon commented Feb 10, 2015

IIRC webpack/hot/dev-server will reload page if HMR can't be cleanly updated, webpack/hot/only-dev-server won't: webpack/webpack#418 (comment). I find F5-reloading very distracting and rarely want it so I suggest to have that turned off by default.

As for not needing webpack-dev-server/client — docs suggest you use --inline mode in CLI which injects this script automatically. I don't use inline mode (it seems unsupported from Node API) so I write it explicitly. I also prefer it being explicit so I better understand the complete picture of what's going on.

@gaearon gaearon closed this as completed Feb 16, 2015
@gaearon gaearon reopened this Feb 16, 2015
@gaearon gaearon closed this as completed Feb 16, 2015
@LuanMiao
Copy link

Hello, I don't seem to understand,Can your make it clear? Thank your!

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

3 participants