Skip to content

Vite ignores resolve.mainFields, if ssr is false #8659

Closed
@sheremet-va

Description

Describe the bug

When transforming files without ssr flag Vite resolves package path to module entry point in package.json, even if resolve.mainFields is empty.

This doesn't happen, if we transform files with ssr: true. Not sure if this is a bug, or this options is intended to work differently between web and ssr.

Reproduction

https://stackblitz.com/edit/node-gslx3n?file=vite.config.ts,package.json,Comp.vue,vite-repro.mjs

System Info

Any

Used Package Manager

npm

Logs

No response

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    p3-downstream-blockerBlocking the downstream ecosystem to work properly (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions