Skip to content

Fix/exports field package.json#382

Open
dkpark10 wants to merge 2 commits intomarpple:mainfrom
dkpark10:fix/exports-field-package.json
Open

Fix/exports field package.json#382
dkpark10 wants to merge 2 commits intomarpple:mainfrom
dkpark10:fix/exports-field-package.json

Conversation

@dkpark10
Copy link

@dkpark10 dkpark10 commented Feb 5, 2026

First of all, thank you for creating such an awesome library — I’ve been using it and really enjoying it.
While trying to import only specific functions for better tree-shaking, I noticed an issue with subpath imports.

Problem

스크린샷 2026-02-05 오후 9 41 52

https://www.npmjs.com/package/@fxts/core?activeTab=code

// package.json
"exports" : {
    "./map": {
      "types": "./dist/types/map.d.ts",
      "import": "./dist/esm/map.js",
      "require": "./dist/cjs/map.js"
    },
}

Importing modules via the paths defined in the exports field fails at runtime.
Although package.json is configured to allow partial imports via subpaths
the actual modules cannot be resolved as intended.

Cause

The subpath patterns under Lazy/* and _internal/* do not match the
actual output structure produced by the build.
As a result, the paths exposed via exports point to non-existent files.

Solution

Update the exports entries for Lazy/* and _internal/* to align with the
actual built file paths.

This change ensures that subpath imports work as intended and does not alter
any runtime behavior beyond fixing module resolution.

Test

I tested this using the built dist/package.json after the build.
The "Cannot find module" error does not occur.

스크린샷 2026-02-05 오후 9 37 08

I also verified that the existing import style still works:

import { filter, map, pipe, range, reduce, take } from "@fxts/core";

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