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

config.devServer.hot doesn't work as expected #123

Closed
skozin opened this issue Mar 6, 2015 · 3 comments
Closed

config.devServer.hot doesn't work as expected #123

skozin opened this issue Mar 6, 2015 · 3 comments

Comments

@skozin
Copy link

skozin commented Mar 6, 2015

Documentation states that config.devServer can be used to configure webpack-dev-server, and that webpack-dev-server accepts the hot option. However, this webpack.config.js doesn't work:

module.exports = {
  entry: [ 'webpack/hot/dev-server', './src/main' ],
  devServer: {
    hot: true
  }
}

Expected result: Hot Replacement Mode is enabled and working.

Actual result: the Uncaught Error: [HMR] Hot Module Replacement is disabled message is printed to the browser console.

The cause is probably this check in webpack/convert-argv.js that adds HotModuleReplacementPlugin only when --hot command-line option is present.

@skozin
Copy link
Author

skozin commented Mar 6, 2015

Ah, now I see this line in the comments:

// Note: this does _not_ add the `HotModuleReplacementPlugin` like the CLI option does.

What's the reason for this behaviour?

@MrOrz
Copy link
Contributor

MrOrz commented Apr 8, 2015

Probably because API has no access to the webpack config:

#106 (comment)

@skozin
Copy link
Author

skozin commented Apr 9, 2015

@MrOrz, thanks! I'm closing this issue in favor of that one you linked.

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

2 participants