web_ppt / frontend /vite.config.ts
CatPtain's picture
Upload vite.config.ts
fa813f9 verified
raw
history blame contribute delete
944 Bytes
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/
export default defineConfig({
base: '',
plugins: [
vue(),
],
optimizeDeps: {
include: ['html2canvas']
},
build: {
rollupOptions: {
external: ['html2canvas']
}
},
server: {
host: '127.0.0.1',
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:7860', // 修改为后端实际运行的端口
changeOrigin: true,
}
}
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
additionalData: `
@use '@/assets/styles/variable.scss' as *;
@use '@/assets/styles/mixin.scss' as *;
`
},
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})