40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import path from "node:path";
|
|
|
|
import { defineConfig } from "vite";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
import vueDevTools from "vite-plugin-vue-devtools";
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
tailwindcss(),
|
|
vue(),
|
|
vueJsx(),
|
|
vueDevTools(),
|
|
AutoImport({
|
|
imports: ["vue", "vue-router", "@vueuse/core"],
|
|
include: [
|
|
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
|
/\.vue$/,
|
|
/\.vue\?vue/, // .vue
|
|
],
|
|
dts: "src/types/auto-imports.d.ts", // specify the dts file path
|
|
// 解决eslint报错问题
|
|
eslintrc: {
|
|
// 这里先设置成true然后npm run dev 运行之后会生成 .eslintrc-auto-import.json 文件之后,在改为false
|
|
enabled: true,
|
|
filepath: "./.eslintrc-auto-import.json", // 生成的文件路径
|
|
globalsPropValue: true,
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
});
|