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
jiyinyiyong opened this Issue Feb 10, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@jiyinyiyong

jiyinyiyong 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

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Feb 10, 2015

Owner

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.

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 Feb 16, 2015

@gaearon gaearon reopened this Feb 16, 2015

@gaearon gaearon closed this Feb 16, 2015

@divineSpectrum

This comment has been minimized.

Show comment
Hide comment
@divineSpectrum

divineSpectrum Mar 16, 2017

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

divineSpectrum commented Mar 16, 2017

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