bug描述:使用 element-plus 二次封装组件,使用 vitest 测试时报错,对于 element-plus 的 css 样式识别失败。
 报错内容: Unknown file extension “.css” for D:\demo\omniButton\node_modules.pnpm\registry.npmmirror.com+element-plus@2.2.9_vue@3.2.37\node_modules\element-plus\theme-chalk\el-button.css
 
 解决方案:
 在 vite.config.js 中配置:
test: {
    deps: {
      inline: ['element-plus']
    }
  },
 
重启生效,vitest 会 hmr,如果未生效,请重启
相关资料查询:
 https://stackoverflow.com/questions/75006674/vitest-with-element-plus-unplugin-unknown-extension-for-scss
 https://github.com/vitest-dev/vitest/issues/1388



















