Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore unresolvable entry paths #60

Open
2 tasks
muratgozel opened this issue Apr 9, 2024 · 2 comments
Open
2 tasks

Ignore unresolvable entry paths #60

muratgozel opened this issue Apr 9, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@muratgozel
Copy link
Contributor

Problem

for the following exports:

  "exports": {
    "./modules/dayjs.js": {
      "import": {
        "types": "./dist/modules/dayjs.d.ts",
        "default": "./dist/modules/dayjs.js"
      }
    },
    "./svelte/store/device.js": {
      "import": {
        "types": "./dist/svelte/store/device.d.ts",
        "default": "./dist/svelte/store/device.js"
      }
    },
    "./Banner.svelte": {
      "types": "./dist/svelte/components/elements/LoadingBar.svelte.d.ts",
      "svelte": "./dist/svelte/components/elements/LoadingBar.svelte"
    },
  },

the lib is trying to read .svelte files too which is not recognized in node env:

Error: Could not find matching source file for export path "./dist/svelte/components/elements/Banner.svelte"

Expected behavior

i package svelte files with a different bundler (@sveltejs/package) therefore i would expect an option to ignore some files in exports.

Minimal reproduction URL

https://stackblitz.com/edit/vitejs-vite-kw52rd?file=package.json

Version

v2.0.2

Node.js version

v20.9

Package manager

npm

Operating system

macOS

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
@muratgozel muratgozel added the bug Something isn't working label Apr 9, 2024
@privatenumber privatenumber added enhancement New feature or request and removed bug Something isn't working labels Apr 9, 2024
@privatenumber privatenumber changed the title doesn't ignore the paths it didn't recognize Ignore unresolvable entry paths Apr 9, 2024
@privatenumber
Copy link
Owner

This is currently behaving expectedly so it's not a bug.

In regards to this feature request, it's hard to draw the line as to when an unresolvable path should be ignored because what if none of the paths are resolvable? Surely, that should error?

Or what if there's an export path (amongst a few) that should be resolved and built, but is missing (e.g. maybe forgot to add file to git), and the build unexpectedly passes because it gets ignored?

@muratgozel
Copy link
Contributor Author

muratgozel commented Apr 10, 2024

i meant ignore natively not by configuring, node for example isnt able to resolve .svelte files so pkgroll should ignore them instead of raising an error.

pkgroll have a complete control on exports property, which is good but also bad for other kind of pkgroll-like libraries that is willing to use exports just like pkgroll in the same project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants