加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.js 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
rock 提交于 2024-11-17 11:42 . 支持设计表单
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import monacoEditorPlugin from 'vite-plugin-monaco-editor'
import {resolve} from 'path'
const pathSrc = resolve(__dirname, 'src')
export default defineConfig({
resolve: {
alias: {
'~/': `${pathSrc}/`,
'@/': `${pathSrc}/` ,
}
},
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8666',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
// ...
plugins: [
vue(),
// ...
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
monacoEditorPlugin({
languageWorkers:['editorWorkerService', 'json']
})
],
base: './'
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化