-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
builld is too big #67
Comments
hi @m4rcTr3y, to me it seems that you import all the icons, but sadly the bundler can't shake off unused ones. In order to reduce the build, you could include only the specific icons you use in your build. A bit less convenient, but to my knowledge, it's the only way to deal with this issue in this setup. so instead of going with: import * as mdijs from '@mdi/js'
// .....
createApp(App).use(mdiVue, {
icons: mdijs
}) you could try this: import {
mdiPlayStation,
mdiAccount,
mdiAccessPoint
// etc ...
} from '@mdi/js'
// .....
createApp(App).use(mdiVue, {
icons: {
mdiPlayStation,
mdiAccount,
mdiAccessPoint,
// and so on
}
}) I hope this solves your issues regarding build size, convenience-wise there's little I can do right now. |
@therufa Hi. So what is the point of importing at |
Hi @loxK, The main reason to moving everything to the init state was to reduce the build size of this package. Before we were close to 20Mb which I didn't feel comfortable with (even though this wouldn't translate to the end product) serving several thousand times a month. I hope this clarifies some of your questions. As with everything I'm open for recommendations regarding improvement, every contribution is welcome ;) |
@Zony-Zhao When you build the project, it will be smaller. |
@therufa I think your concern is valid but misplaced. Developers are going to opt for the path of least resistance which is to pull in the entire icon set and that is going to cause bigger bundle sizes on production builds. That should be more concerning than a large bundle size on a library that is going to be largely tree shaken away. It also runs counter to the strategy that @mdi/js takes which is to offer a route where by default code is tree shakeable. |
when project is built in nuxt, the mdijs bundle is big its about 1.+MBs .. how do i reduce it
The text was updated successfully, but these errors were encountered: