cds-snc / c19-benefits-node

Answer some questions to find which federal programs can help you https://covid-benefits.alpha.canada.ca/. - Répondez à quelques questions pour trouver quels programmes d’aide financière fédéraux s’offrent à vous https://covid-prestations.alpha.canada.ca/.
MIT License
2 stars 4 forks source link

Use TailwindCSS purge option instead of purgecss directly #370

Closed dsamojlenko closed 4 years ago

dsamojlenko commented 4 years ago

TailwindCSS 1.4 introduced a new purge option which integrates with PurgeCSS to delete unused styles.

Using the Tailwind option rather than PurgeCSS has the the benefit of running only against the Tailwind-generated styles, so no need to maintain a whitelist, and also simplifies our build pipeline.

To test, run the service locally in dev mode and check the Network tab in Chrome and note the size of styles.css. Purge doesn't run in dev mode, so you should see something around 1.9Mb.

Next run the service in production mode (npm run start) and check the size of styles.css - should be greatly reduced, somewhere around 21Kb.

CalvinRodo commented 4 years ago

CSS is a tiny bit bigger then before but less then a kb so should be good, an a cursory glance shows that everything still works.