vite.defineConfig is not defined 原因是vite版本太低,没能从vite中解构出来,升级版本即可。
创建最新版本的vite项目
npm init @vitejs/app