简体   繁体   English

webpack服务器实时重新加载

[英]webpack server live reload

I'm building a react-rails app with rails 5.2 . 我正在构建带有rails 5.2react-rails应用程序。

react-rails-hot-loader is not compatible with rails 5.2 , the live reloding would work with react_on_rails and I am trying to understand how to configure webpacker to live-reload react-rails-hot-loaderrails 5.2不兼容,实时拆装将与react_on_rails一起react_on_rails ,我正在尝试了解如何将webpacker配置为实时重新加载

I had a read at the following issue 我阅读了以下杂志

I run ./bin/webpack-dev-server --inline=false and my rails s in a separate terminal instance, but I can not display the site on webpacker localhost:3035/movies . 我在单独的终端实例中运行./bin/webpack-dev-server --inline=falserails s ,但无法在webpacker localhost:3035/movies上显示该站点。 The output in the browser is Cannot GET /movies 浏览器中的输出为Cannot GET /movies

I just created the repository , do not know webpacker and would really appreciate any input. 我刚刚创建了存储库 ,不知道webpacker ,并且非常感谢任何输入。

webpacker 3.3.5 supports hot reloading webpacker 3.3.5支持热重载

running ./bin/webpack-dev-server and rails s in a different terminal allows you to use hot reloading features 在另一个终端上运行./bin/webpack-dev-serverrails s允许您使用hot reloading features

My understanding is that webpacker development server will provide the js , css and image assets to the rails server. 我的理解是, webpacker开发服务器将向webpacker服务器提供jscssimage资产。

The application is available at localhost:3000 (from the rails server ) for development with hot reloading. 该应用程序可从localhost:3000 (从rails server )获得,用于通过热重载进行开发。 I started the webpacker dev server before my rails s 我开始webpacker在我开发服务器rails s

Some more article explains more in details how to configure the webpacker server 更多文章详细说明了如何配置webpacker server

https://medium.com/statuscode/introducing-webpacker-7136d66cddfb https://medium.com/rubyinside/hot-module-reloading-with-webpacker-b663643a60b1https://github.com/justisb/react_on_rails/blob/master/docs/additional-reading/hot-reloading-rails-development.md https://learnetto.com/tutorials/hot-module-replacement https://medium.com/statuscode/introducing-webpacker-7136d66cddfb https://medium.com/rubyinside/hot-module-reloading-with-webpacker-b663643a60b1https://github.com/justisb/react_on_rails/blob/master /docs/additional-reading/hot-reloading-rails-development.md https://learnetto.com/tutorials/hot-module-replacement

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM