Closed popuguytheparrot closed 4 years ago
React's toolchain has tree shaking built in, so double check you're importing the icons correctly.
import { mdiAccount } from '@mdi/js';
and not all of them.
@Templarian its not working. In bundle i see all of icons
Yeah, not sure what's going on. Probably something in the specific project you have.
Not something I'm going to be able to fix as its webpack, roll-up, etc handle this.
its in production bundle. For example, @material-ui/icons
its tree shakes, but it package not.
That is weird. Search your full project for @mdi/js
and double check it's only importing them by name.
Beyond that try and recreate in a new app.
Still not being able to tree shaking either. Any ideas?
Same issue in 2021 with a next.js application. Full 2MB package @mdi/js package ends up in the bundle eventhough I'm only importing a few icons :')
how to tree shake icon? Now loading all icons from package