vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
834 stars 54 forks source link

HMR doesn't work when a `base` property is set in the Vite config #18

Closed nekusu closed 1 year ago

nekusu commented 1 year ago

Issue

When setting a base property in vite.config.ts other than the default, HMR does not reflect the changes. Vite logs [vite] hmr update (modified file), but there is no update at all.

Config example

import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';

export default defineConfig({
  base: '/test/',
  plugins: [react()],
});

Notes

This same scenario works as expected when using the babel-based plugin @vitejs/plugin-react.

ArnaudBarre commented 1 year ago

Thanks for the report!

This will be available in the next path probably next this week.