35 lines
773 B
JavaScript
35 lines
773 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
server: {
|
|
host: '0.0.0.0', // 监听所有网络接口
|
|
port: 5173, // 默认端口
|
|
strictPort: true, // 如果端口被占用则退出
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://36.103.203.89:6789',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
find: /^@dataview\/datav-vue3$/,
|
|
replacement: '@kjgl77/datav-vue3'
|
|
}
|
|
},
|
|
optimizeDeps: {
|
|
include: ['@kjgl77/datav-vue3']
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/assets/styles/main" as *;`
|
|
}
|
|
}
|
|
}
|
|
}) |