twbs / twbs/bootstrap

JavaScript libraries can also provide an IIFE build.

Open
#42,662 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature js v6 v6-revisit
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Proposal

JavaScript libraries can also provide an IIFE build.

I noticed the following statement in the Bootstrap v6 documentation:

Bootstrap’s JavaScript is now ESM-only. We no longer ship UMD bundles. All dist files (bootstrap.js, bootstrap.bundle.js, and their minified versions) are native ES modules. The plugin APIs themselves are unchanged—only how you load and reference them is different.

I understand that Bootstrap v6 is embracing the modern JavaScript ecosystem and that UMD bundles have been removed by design. However, would it be possible to continue providing an IIFE build as an optional distribution?

For example, bootstrap.js could remain the default ESM build, while an additional file such as bootstrap.iife.js or bootstrap.browser.js could be provided for users who prefer loading Bootstrap directly in the browser without modules or a bundler.

From what I understand, this would only require adding an additional build configuration, allowing users to choose the distribution format that best fits their use case while keeping ESM as the primary and recommended format.

Motivation and context

I also noticed that jQuery v4 promotes ESM as the primary format in its README, while still providing multiple distribution formats for users to choose from. Perhaps Bootstrap could take a similar approach by offering an additional IIFE build alongside the ESM distribution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Bootstrap v6's current ESM distribution and the build configuration that produces the mentioned dist files. Determine the scope and design for an optional IIFE output, including how it should be named and validated alongside the existing distributions; the issue does not identify specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.