1 year ago

#181419

test-img

Luca Reghellin

How to enable hot module replacement with webpack + browsersync + mamp pro?

I'm currently trying to configure webpack to have browser sync and HMR work with wordpress under mamp pro.

Currently my configuration is this, and it's working, except that at this point, I'm quite stuck since I'm using a proxy config to tell browsersync to use an external server (mamp), and since this server is not webpack-dev-server, I'm not sure how to add HMR in this situation. Any idea?

  plugins: [

    new BrowserSyncPlugin({
      proxy: { // mydomain and dev-subdirectory are fakes use for this example 
        target: 'http://staging.mydomain.com/dev-subdirectory', // this is where wordpress is installed. MAMP PRO host is currently setted to staging.mydomain.com
      },
      
      port: 5759, // this is because sometimes I use 
    })
  ],

webpack

mamp

webpack-dev-server

browser-sync

mamp-pro

0 Answers

Your Answer

Accepted video resources