vitejs / vite-plugin-vue

Vite Vue Plugins
MIT License
504 stars 155 forks source link

Vue SSR playground scoped style not replaced when HRM #314

Open yooouuri opened 11 months ago

yooouuri commented 11 months ago

Related plugins

Describe the bug

The <style> in App.vue is not scoped.

image

After making the style tag scoped. The old "unscoped" style tag is not replaced.

image

Reproduction

https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue

Steps to reproduce

git clone git@github.com:vitejs/vite-plugin-vue.git
cd vite-plugin-vue
pnpm install && pnpm build
cd playground/ssr-vue
pnpm dev

System Info

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 174.59 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
    pnpm: 8.11.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Safari: 17.2
  npmPackages:
    @vitejs/plugin-vue: workspace:* => 5.0.0-beta.1 
    @vitejs/plugin-vue-jsx: workspace:* => 3.1.0 
    @vitejs/test-dep-import-type: link:dep-import-type => 0.0.0 
    @vitejs/test-example-external-component: file:example-external-component => 0.0.0

Used Package Manager

pnpm

Logs

No response

Validations

yooouuri commented 11 months ago

non scoped > scoped, not removing the style by HRM.

scoped > non scoped, the scoped style tag is removed by HRM.