53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import vue from '@vitejs/plugin-vue'
|
|||
|
|
import { defineConfig } from 'vite'
|
||
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
||
|
|
|
||
|
|
// The API the dev server proxies `/api` to. Defaults to the Dockerised API on
|
||
|
|
// the host; the compose `web` service overrides it to the internal address.
|
||
|
|
const proxyTarget = process.env.VITE_PROXY_TARGET ?? 'http://localhost:8080'
|
||
|
|
|
||
|
|
// https://vite.dev/config/
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [
|
||
|
|
vue(),
|
||
|
|
VitePWA({
|
||
|
|
registerType: 'autoUpdate',
|
||
|
|
includeAssets: ['favicon.svg', 'apple-touch-icon.png'],
|
||
|
|
manifest: {
|
||
|
|
name: 'Todo List',
|
||
|
|
short_name: 'Todo',
|
||
|
|
description: 'A simple todo list.',
|
||
|
|
theme_color: '#4f46e5',
|
||
|
|
background_color: '#ffffff',
|
||
|
|
display: 'standalone',
|
||
|
|
start_url: '/',
|
||
|
|
icons: [
|
||
|
|
{ src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' },
|
||
|
|
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
|
||
|
|
{
|
||
|
|
src: 'pwa-maskable-512x512.png',
|
||
|
|
sizes: '512x512',
|
||
|
|
type: 'image/png',
|
||
|
|
purpose: 'maskable',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
devOptions: {
|
||
|
|
// Let the service worker run under `npm run dev` too.
|
||
|
|
enabled: true,
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
],
|
||
|
|
server: {
|
||
|
|
host: true,
|
||
|
|
port: 5173,
|
||
|
|
strictPort: true,
|
||
|
|
proxy: {
|
||
|
|
'/api': {
|
||
|
|
target: proxyTarget,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
})
|