How to reduce swiper bundle size in an Angular project #7438
Unanswered
marshall86
asked this question in
Q&A
Replies: 1 comment
-
Would love to reduce it too, on a Nuxt project |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to reduce the bundle size of the Swiper integration in my Angular project. Analyzing the project bundle, I can see there are many ".mjs" files like zoom, mousewheel ecc that I don't need and I'd like to remove.
Is there a way to achieve this?
Below the integration using Swiper 11.0.6
`
import { register } from 'swiper/element/bundle';
import { Swiper, SwiperOptions } from 'swiper/types';
register();
@component({.... })
export class MyComponent {
swiperInstance: Swiper;
sliderOptions: SwiperOptions = { ...sliderSettings.default, spaceBetween: 20, slidesPerView: 'auto' };
}
`
<swiper-container #swiper [spaceBetween]="sliderOptions.spaceBetween" [slidesPerView]="sliderOptions.slidesPerView"> <swiper-slide> ... </swiper-slide> </swiper-container>
Beta Was this translation helpful? Give feedback.
All reactions