react-dynamic-swiper icon indicating copy to clipboard operation
react-dynamic-swiper copied to clipboard

Tree Shaking?

Open MovingGifts opened this issue 4 years ago • 0 comments

Hi @nickpisacane,

When importing Swiper as suggested like this:

import { Swiper, Slide } from 'react-dynamic-swiper'

then analyzing the vendor.js bundle, we see a big size:

Screen Shot 2020-04-02 at 11 37 38 AM

We tried to tree shake by changing the import statement above to:

import Swiper from 'react-dynamic-swiper/lib/Swiper'
import Slide from 'react-dynamic-swiper/lib/Slide'

but that still results in the same big size and does not tree shake. It looks like on the swiper releases on github here version 5.0.0, it mentions: Improved es module "tree-shake-ability" as a new feature.

Any idea how we can use react-dynamic-swiper and get tree shaking done to only include Swiper/Slide from swiper.js so we can reduce our vendor.js bundle size?

MovingGifts avatar Apr 02 '20 15:04 MovingGifts