Swiper JS libraries
-
Hi, I am trying to enqueue swiper js using code snippet, but I got these 2 errors on console log:
-
Uncaught SyntaxError: Unexpected token ‘export’ (at swiper-bundle.esm.browser.min.js?ver=8.4.2:13:147868)
swiper-bundle.esm.min.js?ver=8.4.2:1
Uncaught SyntaxError: Cannot use import statement outside a module (at swiper-bundle.esm.min.js?ver=8.4.2:1:1)and this my code to enqueue the libraries:
wp_enqueue_style( 'swipercss', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.4.2/swiper-bundle.min.css' ); wp_enqueue_script( 'swiperjs', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.4.2/swiper-bundle.min.js',array(),'8.4.2',true); wp_enqueue_script( 'swiperesmb', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.4.2/swiper-bundle.esm.browser.min.js',array(),'8.4.2',true); wp_enqueue_script( 'swiperesm', 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.4.2/swiper-bundle.esm.min.js',array(),'8.4.2',true);
Is it any documentation how to enqueue these libraries correctly to WP?
Thank you
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Swiper JS libraries’ is closed to new replies.