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

Expose Node resolver's main fields on config #1951

Closed
intrnl opened this issue Feb 9, 2021 · 0 comments
Closed

Expose Node resolver's main fields on config #1951

intrnl opened this issue Feb 9, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@intrnl
Copy link
Contributor

intrnl commented Feb 9, 2021

Is your feature request related to a problem? Please describe.
Svelte expects using the svelte field in package.json for component libraries

Describe the solution you'd like
Expose mainFields in config, so that plugins are able to use it too. Perhaps it would be best if the entire resolver config is exposed?

Describe alternatives you've considered
User importing component libraries by path instead of relying on the fields on package.json

<script>
  import { Router } from 'svelte-router/lib/index.js';
</script>

Additional context

  • Are there any notes about how config.createResolver is supposed to work? I know it's internal, but I tried this and it seemed to match just about anything.
    resolver = config.createResolver({
      extensions: [],
      mainFields: ['svelte'],
    });
@yyx990803 yyx990803 added the enhancement New feature or request label Feb 9, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants