-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
fix: auto-import does not work when using @vitejs/plugin-vue
alone
#1412
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine can't test myself right now though.
@wxt-dev/auto-icons
@wxt-dev/i18n
@wxt-dev/module-solid
@wxt-dev/module-react
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/storage
@wxt-dev/unocss
wxt
commit: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1412 +/- ##
==========================================
- Coverage 81.22% 81.11% -0.11%
==========================================
Files 128 128
Lines 6296 6271 -25
Branches 1073 1066 -7
==========================================
- Hits 5114 5087 -27
- Misses 1167 1169 +2
Partials 15 15 ☔ View full report in Codecov by Sentry. |
Hmm, interesting. I swear I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, seems to work. Will merge and release!
Released in v0.19.27 |
close #1356
wxt uses its own unimport vite plugin instead of the official vite plugin, which causes the auto-import in the vue file to fail (instead of using
@wxt-dev/module-vue
, it uses@vitejs/plugin-vue
directly)The problem was fixed after applying this patch at https://github.com/aiktb/vue-browser-test.git, so I can be sure that this is the problem.
This should also close unjs/unimport#419 as this is not a unimport bug. cc @aklinker1
By comparing the source code of WXT and unimport, I found the problem. The vite plugin implemented by WXT lacks the following key code:
https://github.com/unjs/unimport/blob/6265894d07500d3ce0e24b247bdbb12e37a559d8/src/unplugin.ts#L48
https://vite.dev/guide/using-plugins#enforcing-plugin-ordering
It is indeed caused by the execution order of the vite plugin.