Skip to content

Add explicit ./en subpath export - #681

Open
markacola wants to merge 1 commit into
wanasit:masterfrom
markacola:add-en-exports
Open

markacola wants to merge 1 commit into
wanasit:masterfrom
markacola:add-en-exports

Conversation

@markacola

Copy link
Copy Markdown

Problem

Rollup-based bundlers (e.g. Vite 6 production builds) do not resolve the "./*" exports pattern for "chrono-node/en":

error during build:
[vite]: Rollup failed to resolve import "chrono-node/en" from "..."

Node's own resolver handles the pattern fine, so this only surfaces in bundler builds. Today the workaround is a pnpm patch that adds an explicit exports entry.

Fix

Add an explicit "./en" export pointing at the existing built files. No other changes.

Verified with a minimal Vite 6 app build: fails before, passes after.

Happy to add explicit entries for the other locales as well if you'd prefer a complete set.

Rollup-based bundlers (e.g. Vite production builds) do not resolve
the "./*" exports pattern for "chrono-node/en", so importing the
English-only locale fails to build without an explicit entry.

Add an explicit "./en" export so consumers can import just the
English locale (smaller bundle) from bundlers that only support
explicit subpath entries.

Verified: a Vite 6 production build importing "chrono-node/en"
fails to resolve before this change and succeeds after.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant