if a class include a method that has same name in a present, this plugin will try to inject import statement into this file.
This is ok in common because we only want to import it when we installed it as project deps, but plugin will inject import statement into other repo in monorepo without the dep, and will cause error "dep not found".
In the reproduction, run npm run build, vite will exit with error. If rename inject to inject2, build can be done.
Describe the bug
if a class include a method that has same name in a present, this plugin will try to inject import statement into this file.
This is ok in common because we only want to import it when we installed it as project deps, but plugin will inject import statement into other repo in monorepo without the dep, and will cause error "dep not found".
In the reproduction, run
npm run build
, vite will exit with error. If renameinject
toinject2
, build can be done.Reproduction
https://stackblitz.com/edit/vitejs-vite-tdqwze?file=src%2Fmain.ts&view=editor
System Info
Not provided
Used Package Manager
npm
Validations