vuejs / laravel-elixir-vue-2

Laravel Elixir Vue 2.0 support plugin
105 stars 20 forks source link

Hot Module Reload #14

Closed strebl closed 7 years ago

strebl commented 7 years ago

I have no idea where to start. Thats why I ask here. Is it possible to use the hmr feature of the Vue single component files with Laravel elixir? If yes, can someone push me in the right direction?

gilbitron commented 7 years ago

Has anyone worked out how to do this? Preferably using webpack.

yyx990803 commented 7 years ago

HMR is a bit complicated because it involves a Node.js development server that compiles with Webpack on the fly, and a client-side library that talks to the server and listen for updates. The most tricky part is integrating all this properly with the Laravel server and the Elixir workflow.

Unfortunately, I don't really have time to properly look into this as of now, and that's unlikely going to happen for this particular plugin. Maybe Jeffrey Way can tackle this in his recent rewrite of Elixir.

strebl commented 7 years ago

Thanks Evan for your explanation! Hoping @JeffreyWay will tackle this!

JeffreyWay commented 7 years ago

Yes, I got HMR working last night in fact. It's not too rough.

@strebl Basically, you'll have two servers running: the Webpack dev server, and your standard Laravel one. Then, your HTML should reference the dev server script, and that should do it. I'll post more details soon, but it's done.

strebl commented 7 years ago

Thanks @JeffreyWay !

g0ld3lux commented 7 years ago

Bump @JeffreyWay Ive been Looking Into This Ever since... The Only Solution i got is this https://github.com/dolbex/webpack-laravel Im excited that you will soon Try to Tackle this >;D

strebl commented 7 years ago

He has done it! It works, and its so covenient! Love it! Check out Laravel Mix, the successor of Laravel Elixir. webpack run hmr and it works🎉 In Laravel 5.4, Mix is the default. Thanks Jeffrey!