evanw / evanw/esbuild

[Feature] UMD bundle support

Open
#507 19 comments 86 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

[UMD](https://github.com/umdjs/umd) is used by many libraries to support legacy module systems. Migrating to esbuild is difficult when relying on this format.

There are some workarounds but they have major downsides:
1. Post-process the esbuild IIFE output to add the UMD wrapper if you don't have any external dependencies: Makes sourcemap difficult to deal with and makes builds slower. (#482) would simplify this workaround and solve the source map issue but still not allow external dependencies.
2. Use rollup/webpack's UMD support with esbuild transformers (instead of babel): Doesn't benefit from esbuild's ultra fast dependency resolution and bundling.

Willing to give this a go myself if there is interest to include this feature.

Contributor guide

No contributing guide indexed for this repository

Research direction

No file, test, or entry point is named in the issue. Start by tracing esbuild's existing output-format handling and reviewing UMD requirements alongside the listed workarounds; done means esbuild can emit UMD bundles, including with external dependencies, without the cited source-map and performance drawbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.