mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: use reverse proxy during local preview (#23184)
This commit is contained in:
parent
c4ff2ea6d5
commit
d9cddeb0f1
1 changed files with 11 additions and 6 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue