SimonDegraeve / hapi-webpack-plugin

Webpack middleware for Hapi. Supports HMR.
57 stars 25 forks source link

HMR check route is 404 #15

Closed PavelPolyakov closed 7 years ago

PavelPolyakov commented 7 years ago

Hi @mashaalmemon,

I believe I need some help. I had a webpack config with HMR which worked with the webpack-dev-server. Now I want to bundle it with hapi, so I found your neat plugin. And integration went pretty easy, with the exception that HMR doesn't work for now :(

I register the plugin via Glue, and it looks as simple as:

{
    plugin: {
        register: 'hapi-webpack-plugin',
        options: 'webpack.config.js'
    }
}

While in my webpack config I have the next:

entry: {
        app: [
            'react-hot-loader/patch',
            // activate HMR for React
            'webpack-dev-server/client?reload=true',
            //bundle the client for hot reloading
            //only- means to only hot reload for successful updates
            './app/client/index.js']
    }

So on the load everything works fine, but in the Chrome console I see that any attempt to know if something we updated hits the 404: image

I also tried to use blipp in order to check if some routes were registered, but no - I do not see any.

I use webpack 2.

Would be very happy to know your thoughts, in which direction I should look.

Regards,

PavelPolyakov commented 7 years ago

Ok,

This was solved in the next way:

        app: [
            'react-hot-loader/patch',
            // activate HMR for React
            'webpack-hot-middleware/client?reload=true',
            //bundle the client for hot reloading
            //only- means to only hot reload for successful updates,
            './app/client/index.js']

Here it's stated that as of version 2.0 the options should be set via webpack-hot-middleware/client.

Hope it helps to somebody.