Skip to content

WWW vs CRM CSS — performance checklist

Use this when auditing unused CSS, bundle size, and safe cleanup.

BundleEntryNotes
wwwclient/js/www/www.bundler.jsPulls www.index.scss → full Bootstrap (bs.scss), FA Pro, Uppy, large www/03-components/_components.scss barrel. Fancyapps Carousel CSS is lazy-loaded by fancy_carousel_controller.js so it isn’t in the global bundle.
CRMclient/js/crm/crm.index.jscrm/crm.index.scsscrm/bs.scss (full Bootstrap) + CRM partials
OtherwwwHomeStyles, costCalculatorStyles, rpStyles, reportsSeparate CSS entries

Production build with a static treemap report (outputs under tmp/, gitignored). The script uses WEBPACK_OUTPUT_DIR=tmp/webpack-analyze-output so it does not fight the webpack dev server or overwrite public/javascripts/webpack/.

Terminal window
mise exec -- yarn analyze:webpack

Open tmp/webpack-bundle-report.html in a browser after the build finishes. Compiled assets from that run live in tmp/webpack-analyze-output/ (throwaway; not served by Rails).

  • unused-css-rules: Often flags Bootstrap and global components that are used on other routes or dynamically; treat as hints, not a delete list.
  • Re-run after meaningful CSS changes; compare the same URL and device profile.
  • Record a session on representative pages (homepage, blog, quote builder, key CRM screens).
  • Distinguish same-origin stylesheet bytes from third-party widgets.
  • Coverage is a session snapshot — not a substitute for route-by-route review.
  • Today both www and CRM use full Bootstrap via @forward / barrel SCSS.
  • Reducing to partial imports is a large change: verify every utility/component class used in views and Stimulus-controlled DOM.
  • Audit which FA families (solid, regular, light, duotone) and icon names are referenced in HTML/ERB/components.
  • Removing kit CSS slices or subsets requires matching what the markup actually uses.
  • Before deleting a file: search for its basename and @use / @import paths (rg across client/, app/).
  • Do not delete shared partials that are only pulled in via index/barrel files unless the whole chain is unused.
  • Not in use for these bundles; turning it on would need safelists for Bootstrap utilities, dynamic classes, and CMS content. Treat as a separate project with full QA.