提交 77b13272 authored 作者: 王鹏飞's avatar 王鹏飞

feat: 更新 Vite 配置,调整生产环境和学校模式的基础路径,优化插件配置

上级 e535338e
......@@ -4,41 +4,34 @@ import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// import checker from 'vite-plugin-checker'
import AutoImport from 'unplugin-auto-import/vite'
import mkcert from 'vite-plugin-mkcert'
export default defineConfig(({ mode }) => ({
base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/center-resource/' : '/',
base: mode === 'school' ? '/' : 'https://webapp-pub.ezijing.com/website/prod/center-resource/',
plugins: [
vue(),
AutoImport({
imports: ['vue', 'vue-router', '@vueuse/core'],
dts: true,
eslintrc: { enabled: true }
eslintrc: { enabled: true },
}),
mkcert()
// checker({ vueTsc: true, eslint: { lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } })
mkcert(),
],
server: {
open: true,
host: 'dev.ezijing.com',
https: {
key: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.key')),
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem')),
},
proxy: {
'/api/qbs': {
target: 'https://question-api.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/qbs/, '')
'/api': 'https://resource-center.ezijing.com',
},
'/api': 'https://resource-center.ezijing.com'
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
}))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论