Fix browser export interop by routing bundlers to CJS-typed UMD artifact#4444
Open
Copilot wants to merge 2 commits into
Open
Fix browser export interop by routing bundlers to CJS-typed UMD artifact#4444Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix less.js packaging issue for bundlers
Fix browser export interop by routing bundlers to CJS-typed UMD artifact
Jun 10, 2026
matthew-dean
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since
lessis"type": "module", bundlers resolving the"browser"export todist/less.jscan interpret the UMD file as ESM and lose default-import interop. This updates the browser export target to a CJS-typed path while preserving existing UMD artifacts.Export map alignment for browser bundlers
exports["."].browsernow points to./dist/less.cjsinstead of./dist/less.js../dist/less.cjs.Build output update (no format rewrite)
dist/less.cjsfile with the same UMD output shape asdist/less.js.dist/less.jsanddist/less.min.jsremain unchanged as published artifacts.Contract test update
./dist/less.cjsand that the file exists.{ "exports": { ".": { "browser": "./dist/less.cjs", "import": "./lib/less-node/index.js", "require": "./dist/less-node.cjs" } } }