请问在vite项目中要使用less,应该如何配置?
实际运行时候报错:
报错:
[plugin:vite:import-analysis] Failed to resolve import "./index.less" from "src/components/group.tsx". Does the file exist?
我的vite配置文件如下:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
css: {
preprocessorOptions: {
less: {
}
}
}
})
看这报错是
src/components/group.tsx
里引用了./index.less
,同级目录下没有index.less
文件啊