How we manage icons in Rocket.Chat?

How we manage icons in Rocket.Chat?

  • 2020-3-6
  1. Add a new SVG icon file into app/ui-master/public/icons folder
  2. Run the automation script node ../generateSprite.js to generate icons.svg from those SVG files in the above folder. (the SVG's filename is exactly the icons' identifier)
  3. In the meteor.startup callback function, using Asset.getText to download icons.svg file as plain text to the client first, and then with the help of injectIntoBody function to insert the entire content as raw text into the body.

Note: the generated icons.svg the file contains multiple icons, where we use the tag symbol as a delimiter.