SwiperJS w/ SyntaxError: Cannot use import statement outside a module error

Solution:

I believe that you don’t need to import separate parts of the Swiper if you are using the bundled build of Swiper. So, just try the same code without import statements and Swiper.use statement.

Also, don’t forget that in the default initialization, it might be helpful to enqueue the Swiper style file to have a default appearance.

If you want to use only the required parts of Swiper, you should include the source file in your source files, not just enqueueing the already built file that is located in the Generatepress.