Skip to content

Swiper mjs bundles do not get inlined, but instead rely on relative path imports. #7922

@KonnorRogers

Description

@KonnorRogers

Check that this is really a bug

  • I confirm

Reproduction link

https://unpkg.com/browse/[email protected]/swiper-element-bundle.mjs

Bug description

I'm not sure if its a mismatched expectation, but when I see -bundle.mjs I assume that means all dependencies are inlined,including local files.

This is how the UMD bundled files work, but the .mjs files do not do this.

Why is this an issue? Well, in Rails importmaps v2 it will not download all files from a package when it downloads the package locally and expects the entrypoint to be fully bundled and to not have relative imports.

Related issue: rails/importmap-rails#235

Expected Behavior

-bundle.mjs should inline all files so its a single file with no imports.

Actual Behavior

-bundle.mjs makes relative import calls breaking any tool that expects the bundled file to be entirely self contained.

Swiper version

11.2.5

Platform/Target and Browser Versions

Browsers

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions