Rails Webpacker seem to take eternity to compile

Viewed 776

Using Capistrano, I notice when there's a symlink created with current -> /var/www/myapp, it takes an eternity to compile. In fact, I waited for ~5 to 10 mins and canceled the process.

It hangs at this part:

00:09 deploy:assets:precompile
      01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 yarn install v0.27.5
      01 [1/4] Resolving packages...
      01 [2/4] Fetching packages...
      01 warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
      01 info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
      01 [3/4] Linking dependencies...
      01 [4/4] Building fresh packages...

If I remove the current symlink, it still takes a while, but it finishes.

00:09 deploy:assets:precompile
      01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 yarn install v0.27.5
      01 [1/4] Resolving packages...
      01 [2/4] Fetching packages...
      01 warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
      01 info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
      01 [3/4] Linking dependencies...
      01 [4/4] Building fresh packages...
      01 Done in 134.00s.
      01 Webpacker is installed  
      01 Using /var/www/html/myapp/releases/20170713104316/config/webpacker.yml file for setting up webpack paths
      01 [Webpacker] Compiling assets 
      01 [Webpacker] Compiled digests for all packs in /var/www/html/myapp/releases/20170713104316/app/javascript/packs:
      01 {"application.css"=>"/packs/application.css", "application.css.map"=>"/packs/application.css.map", "application.js"=>"/packs/application-54a7cd537f4d8d13646…

Took about 134s.

First time using Capistrano and webpacker for deployment, is it normal or is there a solution to reduce the compilation time?

0 Answers
Related