Can not use Vite to build UXP project

Hi
I am trying to use Vite instead of Webpack as project builder and got stucked.
It seems that UXP runtime does not support Native ESM, which is the default output of Vite

<script type="module" crossorigin src="./assets/index.xxxx.js"></script>

UXP does not load js with type module, but Vite does not support “text/javascript” then…

So is there any work arounds I can try? Please guide me.

Thanks for help.