Skip to content

[Refactor] migrate all assets to webpacker (JS CSS and images)

jjf21 requested to merge refactor/remove-sprockets into master

change list:

  • all CSS, JS and images moved from app/assets to app/webpacker
  • stylesheet_link_tag becomes stylesheet_pack_tag
  • image_tag becomes image_pack_tag
  • for SCSS packs to be created, they NEED to have a JS pack associated to it.
  • FontAwesome upgraded from 4 to 5:
    • some icons changed names
    • old icons with -o suffix like .fa.envelope-o become .far.envelope
  • print stylesheet was included independently in the app/views/common/_meta partial, I've moved it to be imported and bundled together with the main application stylesheet. it's tiny
  • explode require 'rails/all' into separate requires in order to exclude sprockets (even though it still seems to be loading

upon releasing :

  • extensive test of the app on demo:
    • fonts
    • all layouts:
      • administrate
      • landing
      • application
      • application_users
      • mail
    • images, images inserted through CSS, favicon etc
    • FA icons
    • js interactions
      • timepickers
    • recheck lighthouse score (current on demo: 73)

comparison of bundle sizes before and after seems constant (but way too high) for application and landing packs (done using SECRET_KEY_BASE=test RAILS_ENV=production rails assets:precompile on both master and this branch):

Screenshot 2020-04-16 at 17 28 14

Merge request reports