-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
61 lines (60 loc) · 1.64 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {NaiveUiResolver} from 'unplugin-vue-components/resolvers'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import * as path from 'path';
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3000,
host: "0.0.0.0",
hmr: true,
},
plugins: [
vue(),
AutoImport({
eslintrc: {
enabled: true
},
imports: [
'vue',
'vue-router',
{
'naive-ui': [
'useDialog',
'useMessage',
'useNotification',
'useLoadingBar'
]
}
],
dts: "src/auto-import.d.ts", // 生成 `auto-import.d.ts` 全局声明
}),
Components({
resolvers: [NaiveUiResolver()]
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
"@pages": path.resolve(__dirname, "src/pages"),
"@components": path.resolve(__dirname, "src/components"),
"@layout": path.resolve(__dirname, "src/layout"),
"@hooks":path.resolve(__dirname, "src/hooks"),
"@api": path.resolve(__dirname, "src/api"),
"@utils": path.resolve(__dirname, "src/utils"),
"@store": path.resolve(__dirname, "src/store"),
"@assets": path.resolve(__dirname, "src/assets"),
"@i18n": path.resolve(__dirname, "src/locales"),
},
extensions: ['.js', '.ts', '.vue','.mjs','.jsx','.tsx','.json'],
},
css: {
postcss: {
plugins: [tailwindcss, autoprefixer]
}
}
})