'Do unused imports effect bundle sizes
Simple question really, was just wondering does an import which is not used effect bundle sizes or does it get treeshaken out, I am building experience in this area, thanks
Solution 1:[1]
Yes, all imports have impact on bundle sizes.
An other tip :
When you import something try to do like this :
import last from 'lodash/last'
and not like this :
import { last } from 'lodash'
In the first case you just import the part of package you will use.
In the second case, you import all of package.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pterrat |
