Skip to content

Commit 16db6f7

Browse files
committed
Swiper treeshaking fix
1 parent 11e0aee commit 16db6f7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

_dev/js/theme/components/sliders/SwiperSlider.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import Swiper from 'swiper';
2-
import { Navigation, Pagination, Autoplay } from 'swiper/modules';
1+
import Swiper from 'swiper/core';
2+
3+
// WE HAVE TO IMPORT IT LIKE THIS, BECOUSE OF NOT WOKRING TREESHAKING
4+
import Navigation from '@node_modules/swiper/modules/navigation.mjs';
5+
import Pagination from '@node_modules/swiper/modules/pagination.mjs';
6+
import Autoplay from '@node_modules/swiper/modules/autoplay.mjs';
37

48
import DynamicImportSwiperModule from './DynamicImportSwiperModule';
59

_dev/webpack/webpack.parts.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ exports.extractScss = ({mode = 'production'}) => ({
9292
exports.extractJs = () => ({
9393
module: {
9494
rules: [
95-
{
96-
test: /swiper\.esm\.js/,
97-
sideEffects: false
98-
},
9995
{
10096
test: /\.js$/,
10197
exclude: /(node_modules)/,

0 commit comments

Comments
 (0)