Skip to content

fix: point package.json entry fields at the ESM-only build - #1847

Merged
mlmoravek merged 1 commit into
oruga-ui:developfrom
Mittalnew:fix/package-entry-esm
Nov 17, 2026
Merged

mlmoravek merged 1 commit into
oruga-ui:developfrom
Mittalnew:fix/package-entry-esm

Conversation

@Mittalnew

Copy link
Copy Markdown
Contributor

Fixes #1846

Proposed Changes

  • Updated packages/oruga/package.json and packages/examples/package.json so main, unpkg, and jsdelivr point to the ESM build at ./dist/index.js instead of the removed ./dist/index.umd.cjs.
  • Replaced the stale exports["."].require entry with "default": "./dist/index.js", so require() on modern Node (require(esm)) resolves to the ESM build instead of a missing file.

Verification

  • After npm run build:lib and npm run build:examples on Node v26.3.1, dist/ contains index.js, index.js.map, and types/ (examples also index.css). There is no index.umd.cjs.
  • npm pack --dry-run: every referenced entry file is in the tarball.
  • npx publint: All good! for both @oruga-ui/oruga-next and @oruga-ui/examples.
  • npx @arethetypeswrong/cli --pack: reports the expected "CJS resolves to ESM" warning for an ESM-only package. Other attw findings on ./volar and ./globals come from those type-only export maps, which this PR does not change.
  • Runtime check from the issue:
    • import('@oruga-ui/oruga-next') works (136 exports, including createOruga).
    • require('@oruga-ui/oruga-next') works on Node 26.
    • require.resolve('@oruga-ui/oruga-next') now returns dist/index.js.

Fixes oruga-ui#1846

PR oruga-ui#1597 dropped the CJS/UMD build, but main, unpkg, jsdelivr, and
exports.require still pointed at the removed dist/index.umd.cjs file.
Point those fields at dist/index.js and replace the stale require
condition with default so Node's require(esm) resolves correctly.
@netlify

netlify Bot commented Nov 16, 2026

Copy link
Copy Markdown

👷 Deploy request for oruga-documentation-preview pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 61d592c

@mlmoravek mlmoravek added the bug Something isn't working label Nov 16, 2026
@mlmoravek
mlmoravek merged commit 5441684 into oruga-ui:develop Nov 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package.json still points main, unpkg, jsdelivr, and exports.require to removed dist/index.umd.cjs

2 participants