vant搭建
This commit is contained in:
43
Yi.Vue3.x.Vant/vite.config.ts
Normal file
43
Yi.Vue3.x.Vant/vite.config.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import path from 'path'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { VantResolver } from 'unplugin-vue-components/resolvers';
|
||||
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue(), Components({
|
||||
resolvers: [VantResolver()],
|
||||
}),],
|
||||
resolve: {
|
||||
// https://cn.vitejs.dev/config/#resolve-alias
|
||||
alias: {
|
||||
// 设置路径
|
||||
'~': path.resolve(__dirname, './'),
|
||||
// 设置别名
|
||||
'@': path.resolve(__dirname, './src')
|
||||
}
|
||||
},
|
||||
server: {
|
||||
port: 17000,
|
||||
host: true,
|
||||
open: true,
|
||||
// proxy: {
|
||||
// // https://cn.vitejs.dev/config/#server-proxy
|
||||
// '/dev-api': {
|
||||
// target: VITE_APP_BASE_URL,
|
||||
// changeOrigin: true,
|
||||
// rewrite: (p) => p.replace(/^\/dev-api/, ''),
|
||||
// },
|
||||
|
||||
// '/dev-ws': {
|
||||
// target: VITE_APP_BASE_URL,
|
||||
// changeOrigin: true,
|
||||
// rewrite: (p) => p.replace(/^\/dev-ws/, ''),
|
||||
// ws: true
|
||||
// }
|
||||
|
||||
// }
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user