email-unlimit/frontend/vite.config.js

47 lines
1.0 KiB
JavaScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
import { fileURLToPath, URL } from 'node:url'
export default defineConfig({
plugins: [
vue(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Email Unlimit',
short_name: 'EmailUnlimit',
description: 'Your Exclusive, Unlimited, and Private Temporary Email',
theme_color: '#000000',
icons: [
{
src: 'icons/icon.svg',
sizes: 'any',
type: 'image/svg+xml',
},
],
},
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
proxy: process.env.NODE_ENV === 'production' ? {} : {
'/api': {
target: 'http://localhost:5182',
changeOrigin: true,
},
'/ws': {
target: 'ws://localhost:5182',
ws: true,
},
}
},
define: {
'process.env': process.env
}
})