vite-plugin-vue
vite-plugin-vue copied to clipboard
HMR is extremely slow if typescript file has a import statement of vue
Related plugins
-
[X] plugin-vue
-
[ ] plugin-vue-jsx
Describe the bug
HMR is extremely slow when I use the defineProps function with typescript by importing from the ouside of component. and the imported typescript file has the import statement of 'vue' (or other libraries in node_modules).
I guess that issue is coming from isEqualAst function.
Getting deep comparison for AST requires high costs. I think there is no need to check node_modules.
Reproduction
https://stackblitz.com/edit/nuxt-starter-npmbmm?file=app.vue
Steps to reproduce
import props interface from other typescript file in your custom component. then import vue or any huge library.
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (16) x64 Intel(R) Core(TM) i9-9900KF CPU @ 3.60GHz
Memory: 24.59 GB / 31.35 GB
Container: Yes
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.17.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.6.7 - /usr/local/bin/npm
pnpm: 8.15.0 - /mnt/c/Program Files/nodejs/pnpm
bun: 1.0.25 - ~/.bun/bin/bun
Used Package Manager
npm
Logs
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.