|
|
@ -1,6 +1,7 @@
|
|
|
|
import {defineConfig, loadEnv} from 'vite'
|
|
|
|
import {defineConfig, loadEnv} from 'vite'
|
|
|
|
import path from 'path'
|
|
|
|
import path from 'path'
|
|
|
|
import createVitePlugins from './vite/plugins'
|
|
|
|
import createVitePlugins from './vite/plugins'
|
|
|
|
|
|
|
|
import basicSsl from '@vitejs/plugin-basic-ssl'
|
|
|
|
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig(({mode, command}) => {
|
|
|
|
export default defineConfig(({mode, command}) => {
|
|
|
@ -11,7 +12,7 @@ export default defineConfig(({mode, command}) => {
|
|
|
|
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
|
|
|
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
|
|
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
|
|
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
|
|
|
base: VITE_APP_ENV === 'production' ? '/' : '/',
|
|
|
|
base: VITE_APP_ENV === 'production' ? '/' : '/',
|
|
|
|
plugins: createVitePlugins(env, command === 'build'),
|
|
|
|
plugins: [createVitePlugins(env, command === 'build'),basicSsl()],
|
|
|
|
resolve: {
|
|
|
|
resolve: {
|
|
|
|
// https://cn.vitejs.dev/config/#resolve-alias
|
|
|
|
// https://cn.vitejs.dev/config/#resolve-alias
|
|
|
|
alias: {
|
|
|
|
alias: {
|
|
|
@ -27,12 +28,14 @@ export default defineConfig(({mode, command}) => {
|
|
|
|
server: {
|
|
|
|
server: {
|
|
|
|
port: 80,
|
|
|
|
port: 80,
|
|
|
|
host: true,
|
|
|
|
host: true,
|
|
|
|
|
|
|
|
https:true,
|
|
|
|
open: true,
|
|
|
|
open: true,
|
|
|
|
proxy: {
|
|
|
|
proxy: {
|
|
|
|
// https://cn.vitejs.dev/config/#server-proxy
|
|
|
|
|
|
|
|
'/dev-api': {
|
|
|
|
'/dev-api': {
|
|
|
|
|
|
|
|
target: 'https://ticptest.tercelo.com/dev-api',
|
|
|
|
|
|
|
|
// target: 'http://47.94.93.46/dev-api',
|
|
|
|
// target: 'http://10.11.41.249:8080',
|
|
|
|
// target: 'http://10.11.41.249:8080',
|
|
|
|
target: 'http://localhost:8080',
|
|
|
|
// target: 'http://localhost:8080',
|
|
|
|
changeOrigin: true,
|
|
|
|
changeOrigin: true,
|
|
|
|
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
|
|
|
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
|
|
|
}
|
|
|
|
}
|
|
|
|