|
|
|
|
@ -4,7 +4,7 @@ import tailwindcss from '@tailwindcss/vite';
|
|
|
|
|
import { svelteTesting } from '@testing-library/svelte/vite';
|
|
|
|
|
import path from 'node:path';
|
|
|
|
|
import { visualizer } from 'rollup-plugin-visualizer';
|
|
|
|
|
import { defineConfig, type UserConfig } from 'vite';
|
|
|
|
|
import { defineConfig, type ProxyOptions, type UserConfig } from 'vite';
|
|
|
|
|
|
|
|
|
|
const upstream = {
|
|
|
|
|
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:2283/',
|
|
|
|
|
@ -14,6 +14,12 @@ const upstream = {
|
|
|
|
|
ws: true,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const proxy: Record<string, string | ProxyOptions> = {
|
|
|
|
|
'/api': upstream,
|
|
|
|
|
'/.well-known/immich': upstream,
|
|
|
|
|
'/custom.css': upstream,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
build: {
|
|
|
|
|
target: 'es2022',
|
|
|
|
|
@ -28,13 +34,12 @@ export default defineConfig({
|
|
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
// connect to a remote backend during web-only development
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': upstream,
|
|
|
|
|
'/.well-known/immich': upstream,
|
|
|
|
|
'/custom.css': upstream,
|
|
|
|
|
},
|
|
|
|
|
proxy,
|
|
|
|
|
allowedHosts: true,
|
|
|
|
|
},
|
|
|
|
|
preview: {
|
|
|
|
|
proxy,
|
|
|
|
|
},
|
|
|
|
|
plugins: [
|
|
|
|
|
enhancedImages(),
|
|
|
|
|
tailwindcss(),
|
|
|
|
|
|