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
Describe the bug
Rollup and Vite disagree on the precise semantics of the
skipSelfoption tothis.resolve().The Rollup docs say:
And that is the behavior we observe when using
vite preview.But in
vite dev,skipSelfcauses a plugin to be skipped during all recursive calls tothis.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 devthe app will print "found second".If you instead run
npm run build && npm run preview, the app will print "found first".System Info
Used Package Manager
npm
Logs
No response
Validations