Skip to content

Add svelte exports field to package json when running package command #1959

@dummdidumm

Description

@dummdidumm

Describe the problem

SvelteKit currently has a heuristic in place which tells Vite which packages are Svelte packages (for noExternal stuff) by looking up the package.json content and seeing if there's a svelte property.

The svelte-kit package command does not currently set this field.

Describe the proposed solution

Use the same logic that is used for the main entry to produce a svelte entry.

Alternatives considered

A workaround for now is for users to specify this field in their package.json themselves as it's copied over as of lately.

Importance

would make my life easier

Additional Information

The svelte key is likely more of a historical thing at this point, and deserves some more thought regarding the new developments, but for now the quick fix is to just add this field

Metadata

Metadata

Assignees

No one assigned

    Labels

    p1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.pkg:svelte-packageIssues related to svelte-package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions