Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skipSelf behavior differs from rollup #13852

Closed
7 tasks done
ef4 opened this issue Jul 15, 2023 · 1 comment · Fixed by #18903
Closed
7 tasks done

skipSelf behavior differs from rollup #13852

ef4 opened this issue Jul 15, 2023 · 1 comment · Fixed by #18903
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) rollup plugin compat

Comments

@ef4
Copy link

ef4 commented Jul 15, 2023

Describe the bug

Rollup and Vite disagree on the precise semantics of the skipSelf option to this.resolve().

The Rollup docs say:

If you pass skipSelf: true, then the resolveId hook of the plugin from which this.resolve is called will be skipped when resolving. When other plugins themselves also call this.resolve in their resolveId hooks with the exact same source and importer while handling the original this.resolve call, then the resolveId hook of the original plugin will be skipped for those calls as well.

And that is the behavior we observe when using vite preview.

But in vite dev, skipSelf causes a plugin to be skipped during all recursive calls to this.resolve(), even when the source and importer are different.

Reproduction

https://stackblitz.com/edit/vitejs-vite-ftyzvj?file=vite.config.js

Steps to reproduce

In the Stackblitz reproduction, if you npm run dev the app will print "found second".

If you instead run npm run build && npm run preview, the app will print "found first".

System Info

Demonstrated on stackblitz using all the defaults provided by your blueprint.

Used Package Manager

npm

Logs

No response

Validations

@stackblitz
Copy link

stackblitz bot commented Jul 15, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red sapphi-red added rollup plugin compat p3-minor-bug An edge case that only affects very specific usage (priority) labels Jul 16, 2023
@sapphi-red sapphi-red mentioned this issue Sep 30, 2023
13 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) rollup plugin compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants