Content-Length: 290127 | pFad | https://github.com/flutter/flutter/issues/64106

89 Tree shake unused assets · Issue #64106 · flutter/flutter · GitHub
Skip to content

Tree shake unused assets #64106

@dnfield

Description

@dnfield

In theory, we could probably shake out assets (e.g. fonts, images) from packages that a user isn't using.

In practice, this is actually pretty hard because of the way strings are used in this and level of detection we can use when assets are used dynamically (e.g. get the name of an asset to show from your service, then show it).

This is difficult even for icon fonts, because if you don't have a const reference to the font using IconData, we may not know if you're using it as a regular font or not.

Today, the work around is to just not use packages that have assets you do not need - or, to re-package them to your liking before shipping thea pp.

See also: b/146889328

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: assetsPackaging, accessing, or using assetsa: buildBuilding flutter applications with the toola: sizeReducing IPA/APK/JS sizesc: new featureNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/64106

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy