Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue.js hot reload over ..apache?

Tags:

vue.js

So my backend is PHP based (processwire), served by trusty old MAMP (localhost:8888/mysite). I'd like to serve my vue.js app from the same server, as well.

npm run dev starts a local server on localhost:8080, that works for doing the front end stuff, hot reloading and all.

With npm run build i can build my app so it can be served from MAMP.

But how can I get hot reloading working over MAMP so I can keep developing through apache (using localhost:8888/mysite)? Is this possible?

thank you!

like image 293
joe_g Avatar asked Oct 11 '16 13:10

joe_g


1 Answers

I tried but couldn't get hot loading to work by proxying through Apache. The other way around wasn't so hard, in webpack.config.js:

proxy: {
      '/mysite/api/**': {
        target: 'http://localhost:8888',
        secure: false,
        "changeOrigin": true
      }
    }
like image 51
joe_g Avatar answered Oct 21 '22 20:10

joe_g