Skip to content

Warning 'The following packages did not export their package.json file...' in case of non-svelte packages #244

@telkamp

Description

@telkamp

Describe the problem

I'm always getting a warning message from vite:resolve when tslib is resolved:
[vite-plugin-svelte] The following packages did not export their package.json file so we could not check the "svelte" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.
- tslib
(see index.ts:205)
The message is caused when somewhere in src/utils/resolve.ts:resolveViaPackageJsonSvelte(..) the error ERR_PACKAGE_PATH_NOT_EXPORTED occurs.
Because tslib Is a third-party lib that does not use Svelte, it does not make sense to check the "svelte" field.

Describe the proposed solution

It would be nice to have an option to exclude some libs from being checked for the "svelte" field.

Alternatives considered

None

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageAwaiting triage by a project member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions