Insane loading time after adding Webpacker to Rails App

做~自己de王妃 提交于 2019-12-13 03:19:23

问题


I ran a Ruby on Rail's app, and everything was OK until I installed Webpacker.

Now the loading time is between 180 000ms and 400 000ms, when I try to render any page. Removing the yield cause exacly the same problem. As I'm using Turbolinks I have a fast loading time when navigating in my app.

I use Ruby 2.6.3, Rails 6.0.0.rc1.

I installed Webpack via webpacker 4.0.7 gem, and Yarn, and then installed React.

I ran ./bin/webpack-dev-server then launched rails server .

Unfortunately, I haven't any clue on what to do or search... This questions is related to this : webpacker: after installation pages in the application began to load for a very long time, which has no answer


EDIT


I uninstalled all, deleted old package.json, and reinstalled only Webpack. My app now needs between 30 and 50 sec to load. I'm wondering, if it's normal that 7 556 736 allocations are loading, related to node_modules folder I guess ?


回答1:


Did you make sure that, in config/webpacker.yml, compile is set to false in dev?

development:
  <<: *default
  compile: false

Otherwise it will compile your assets on demand



来源:https://stackoverflow.com/questions/57038000/insane-loading-time-after-adding-webpacker-to-rails-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!