WWW vs CRM CSS — performance checklist
Use this when auditing unused CSS, bundle size, and safe cleanup.
Entry points (webpack)
| Bundle | Entry | Notes |
|---|---|---|
| www | client/js/www/www.bundler.js |
Pulls 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. |
| CRM | client/js/crm/crm.index.js |
crm/crm.index.scss → crm/bs.scss (full Bootstrap) + CRM partials |
| Other | wwwHomeStyles, costCalculatorStyles, rpStyles, reports |
Separate CSS entries |
Webpack bundle analysis
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/.
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).
Lighthouse / PSI
- 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.
Chrome DevTools Coverage
- 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.
Bootstrap
- 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.
Font Awesome Pro
- 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.
Orphan SCSS
- Before deleting a file: search for its basename and
@use/@importpaths (rgacrossclient/,app/). - Do not delete shared partials that are only pulled in via index/barrel files unless the whole chain is unused.
PurgeCSS / aggressive tree-shaking
- 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.