Skip to content

Improve optimizeDeps.include heuristics to ensure popular cjs packages to be automatically optimized #610

@hi-ogawa

Description

@hi-ogawa

swr needs to be optimzeDeps (cf. wakujs/waku#1493), but this is because use-sync-external-store package is cjs only https://publint.dev/[email protected]. Probably there's a way to just catch this dep at least and automatically add it to optimizeDeps.include: ["... > use-sync-external-store"] via vitefu package traversal.


This is tedious than I thought. Since use-sync-external-store has many entry points, we need to optimize each of them https://publint.dev/[email protected]. I guess at this point, we can just target swr?


It doesn't look like vitefu allows customizing optimizeDeps.include detection though https://github.com/svitejs/vitefu/blob/d8d82fa121e3b2215ba437107093c77bde51b63b/src/index.js#L245.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions