Skip to content

What's the difference between webpack/hot/dev-server and webpack/hot/only-dev-server? #658

Closed
@mrdulin

Description

@mrdulin

Thanks.

Activity

SpaceK33z

SpaceK33z commented on Oct 17, 2016

@SpaceK33z
Member

webpack/hot/dev-server reloads when applying HMR fails. webpack/hot/only-dev-server doesn't reload when applying HMR fails.

mrdulin

mrdulin commented on Oct 17, 2016

@mrdulin
Author

@SpaceK33z Thanks. I wrote a demo to test it. But it seems nothing different.
I made a syntax error to test it . But both of them reload the browser. Am I correct?

SpaceK33z

SpaceK33z commented on Oct 17, 2016

@SpaceK33z
Member

What version of webpack-dev-server are you running? This is not fully supported on webpack v1 yet. Also see #655.

SpaceK33z

SpaceK33z commented on Oct 24, 2016

@SpaceK33z
Member

@mrdulin ping ^

SpaceK33z

SpaceK33z commented on Oct 29, 2016

@SpaceK33z
Member

I'm closing this issue because of inactivity. Feel free to comment, and we can always re-open it again.

r4raziel

r4raziel commented on Jun 25, 2020

@r4raziel

hot/only-dev-server” Vs “/hot/dev-server”
They both are simple JS libraries and provide HMR interface for webpack-dev-server’s client JS(part of WDS) that’s also loaded into the browser(See my Webpack And The HMR for more details).

You can use just one of them. The main difference is as follows:
only-dev-server doesn’t reload the browser upon syntax errors. This is recommended for React apps because it keeps the state.
dev-server tries HMR (default). If there is any issue, it reloads the entire browser.

Link:
https://medium.com/@rajaraodv/webpacks-hmr-react-hot-loader-the-missing-manual-232336dc0d96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @SpaceK33z@r4raziel@mrdulin

        Issue actions

          What's the difference between `webpack/hot/dev-server` and `webpack/hot/only-dev-server`? · Issue #658 · webpack/webpack-dev-server