vite-plugin-vue icon indicating copy to clipboard operation
vite-plugin-vue copied to clipboard

HMR is extremely slow if typescript file has a import statement of vue

Open ahas opened this issue 1 year ago • 0 comments

Related plugins

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

ahas avatar Jan 29 '24 04:01 ahas