Skip to content

Automatically add svelte libraries to vite.optimizeDeps.exclude #125

@dominikg

Description

@dominikg

Describe the problem

dedupe does not work for optimized dependencies and this breaks stuff.

See
#124
vitejs/vite#3910
https://github.com/bluwy/vite-svelte-dedupe

Describe the proposed solution

To avoid this problem, automatically add svelte libraries to optimizeDeps.exclude.

Finding those libraries isn't bulletproof, the best you can do is check for the existance of a "svelte" field in it's package.json,

see https://github.com/sveltejs/kit/blob/69b92ec16ce92b86bc5a540daa8ddbd84ba400ef/packages/kit/src/core/utils.js#L85

Alternatives considered

keep the status quo and users have to apply it manually

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions