Skip to content

Treeshake Icon contents #42

@panoply

Description

@panoply

Hey @vrimar

The feather icon pack contributes 50kb of weight to distribution bundles, I'm having trouble tree-shaking those imports. The JSON Mapping of svg contents provided via feather seems the cause. Providing Icons contents as a series of exports would allow svg contents to be cherry picked when bundling for production, I noticed the current approach it to map icon contents to property value but mapping to a vnode would be just as effective, eg:

// some defaults
const some defaults = { viewBox:'0 0 24 24' }

export const icon = (attrs = {}) => m('svg', { ...attrs, ...defaults }, m.trust('d="M0 27.73v27."'))
export const another_icon = (attrs = {}) => m('svg', { ...attrs, ...defaults }, m.trust('d="M0 27.73v27."'))

Are PRs welcome on the project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions