|
@@ -1,7 +1,8 @@
|
|
|
import { defineConfig } from "vite";
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
-import ViteComponents from "unplugin-vue-components/vite";
|
|
|
+import Components from "unplugin-vue-components/vite";
|
|
|
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
|
|
|
+import AutoImport from "unplugin-auto-import/vite";
|
|
|
|
|
|
const SERVER_URL = "https://192.168.10.39";
|
|
|
const path = require("path");
|
|
@@ -12,10 +13,28 @@ export default defineConfig({
|
|
|
vue({
|
|
|
reactivityTransform: true,
|
|
|
}),
|
|
|
- ViteComponents({
|
|
|
+ Components({
|
|
|
resolvers: [NaiveUiResolver()],
|
|
|
dts: "src/types/components.d.ts",
|
|
|
}),
|
|
|
+ AutoImport({
|
|
|
+ // targets to transform
|
|
|
+ include: [
|
|
|
+ /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
|
|
+ /\.vue$/,
|
|
|
+ /\.vue\?vue/, // .vue
|
|
|
+ ],
|
|
|
+ resolvers: [(name) => name === "logger" && "@/utils/logger"],
|
|
|
+ dts: "src/types/auto-imports.d.ts",
|
|
|
+
|
|
|
+ // Generate corresponding .eslintrc-auto-import.json file.
|
|
|
+ // eslint globals Docs - https://eslint.org/docs/user-guide/configuring/language-options#specifying-globals
|
|
|
+ eslintrc: {
|
|
|
+ enabled: true, // Default `false`
|
|
|
+ filepath: "./.eslintrc-auto-import.json", // Default `./.eslintrc-auto-import.json`
|
|
|
+ globalsPropValue: true, // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
|
|
|
+ },
|
|
|
+ }),
|
|
|
],
|
|
|
server: {
|
|
|
port: 3000,
|