Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.37 KB

BP_077_en.md

File metadata and controls

42 lines (28 loc) · 1.37 KB

Minify CSS, JavaScript, HTML, and SVG files

Identifiers

GreenIT V2 V3 V4
12 78 77

Categories

Life cycle Tiers Responsible
4. Production Network Software Architect/Developer

Indications

Priority Implementation difficulty Ecological impact
4 3 4
Saved resources
Network

Description

CSS, Javascript, HTML, and SVG minification tools remove unnecessary spaces, developer comments, line breaks, block delimiters, reducing their size.

Examples

There are different tools available for minification such as:

  • CSS: cssnano, csso or clean-css
  • Javascript: Terser, UglifyJS or Babel-minify
  • HTML: htmlnano, HTMLMinifier
  • SVG: SVGO, minify-xml or equivalent.

Validation rule

The number of ... is equal to or less than
Unminified CSS, JavaScript, HTML, and SVG files 0