Insane loading time after adding Webpacker to Rail

2019-08-22 22:50发布

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 ? Print of my console

1条回答
该账号已被封号
2楼-- · 2019-08-22 23:19

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

查看更多
登录 后发表回答