Update vite

This commit is contained in:
wvffle 2022-07-21 19:36:08 +00:00 committed by Georg Krause
commit 2323cf70d7
7 changed files with 173 additions and 201 deletions

View file

@ -1,4 +1,4 @@
import type { HmrOptions } from 'vite'
// import type { HmrOptions } from 'vite'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
@ -7,18 +7,6 @@ import { resolve } from 'path'
const port = +(process.env.VUE_PORT ?? 8080)
const hmr = {
port: process.env.HMR_PORT || (process.env.FUNKWHALE_PROTOCOL === 'https' ? 443 : port),
protocol: process.env.HMR_PROTOCOL || (process.env.FUNKWHALE_PROTOCOL === 'https' ? 'wss' : 'ws')
} as HmrOptions
if (process.env.GITPOD_WORKSPACE_URL) {
hmr.host = process.env.GITPOD_WORKSPACE_URL.replace('https://', `${process.env.HMR_PORT ?? process.env.VUE_PORT ?? 4000}-`)
hmr.clientPort = 443
hmr.protocol = 'wss'
delete hmr.port
}
// https://vitejs.dev/config/
export default defineConfig(() => ({
envPrefix: 'VUE_',
@ -48,8 +36,7 @@ export default defineConfig(() => ({
})
],
server: {
port,
hmr: process.env.DISABLE_HMR ? false : hmr
port
},
resolve: {
alias: {