Skip to content

Commit

Permalink
Swiper treeshaking fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksydan committed Oct 29, 2023
1 parent 11e0aee commit 16db6f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 6 additions & 2 deletions _dev/js/theme/components/sliders/SwiperSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Swiper from 'swiper';
import { Navigation, Pagination, Autoplay } from 'swiper/modules';
import Swiper from 'swiper/core';

// WE HAVE TO IMPORT IT LIKE THIS, BECOUSE OF NOT WOKRING TREESHAKING
import Navigation from '@node_modules/swiper/modules/navigation.mjs';
import Pagination from '@node_modules/swiper/modules/pagination.mjs';
import Autoplay from '@node_modules/swiper/modules/autoplay.mjs';

import DynamicImportSwiperModule from './DynamicImportSwiperModule';

Expand Down
4 changes: 0 additions & 4 deletions _dev/webpack/webpack.parts.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ exports.extractScss = ({mode = 'production'}) => ({
exports.extractJs = () => ({
module: {
rules: [
{
test: /swiper\.esm\.js/,
sideEffects: false
},
{
test: /\.js$/,
exclude: /(node_modules)/,
Expand Down

0 comments on commit 16db6f7

Please sign in to comment.