PageSpeed Matters
    Speed Audit
    Let's Talk
    PageSpeed Matters
    Book a Call
    Optimization Techniques · Glossary

    Tree Shaking & Minification

    Matt SuffolettoWritten by Matt Suffoletto
    Published June 26, 2026
    Tree Shaking & Minification
    Share

    TL;DR

    Minification removes unnecessary characters (whitespace, comments, long variable names) from HTML, CSS, and JavaScript, while tree shaking is a build-time process that eliminates unused exports from JavaScript modules.

    What is Tree Shaking & Minification?

    Minification removes unnecessary characters (whitespace, comments, long variable names) from HTML, CSS, and JavaScript, while tree shaking is a build-time process that eliminates unused exports from JavaScript modules.

    Learn more in our reducing JavaScript size guide, or work with us through our done-for-you speed optimization service.

    How Tree Shaking & Minification is Measured

    Lighthouse reports the potential savings from minifying CSS and JavaScript and from removing unused JavaScript.

    Related Terms

    Sources