-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
Way icons are imported #7940
Comments
Wouldn't this greatly increase the bundle size and not take advantage of tree shaking? specifically this:
Or are the bundlers now smart enough to only import what was used? |
@nenadalm As far as I know, you can already do the described pattern. It's supported. |
@oliviertassinari then you know it wrong :) import * as i from 'material-ui-icons'; $ ./node_modules/.bin/webpack
...
ERROR in [at-loader] ./src/browser/components/component/view.tsx:14:20
TS2306: File '/var/www/html/project/node_modules/material-ui-icons/index.d.ts' is not a module.
... some versions:
|
@sebald Is this a typescript issue? |
ok, thanks. |
Each icon needs to be imported separetely. E.g.:
Wouldn't it be better if all icons could be in signle alias and then used:
Or if somebody doesn't like aliases, they could still list all imports like:
?
In order to do that, typings would have to be written like
instead of:
The text was updated successfully, but these errors were encountered: