2022-07-16 04:18:17 +00:00
|
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
|
|
import path from 'path';
|
|
|
|
|
2023-11-18 04:13:36 +00:00
|
|
|
const upstream = {
|
|
|
|
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:3001/',
|
|
|
|
secure: true,
|
|
|
|
changeOrigin: true,
|
|
|
|
logLevel: 'debug',
|
|
|
|
ws: true,
|
|
|
|
};
|
|
|
|
|
2022-07-16 04:18:17 +00:00
|
|
|
/** @type {import('vite').UserConfig} */
|
|
|
|
const config = {
|
2023-07-01 04:50:47 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'xmlhttprequest-ssl': './node_modules/engine.io-client/lib/xmlhttprequest.js',
|
|
|
|
'@api': path.resolve('./src/api'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
// connect to a remote backend during web-only development
|
|
|
|
proxy: {
|
2023-11-18 04:13:36 +00:00
|
|
|
'/api': upstream,
|
|
|
|
'/.well-known/immich': upstream,
|
|
|
|
'/custom.css': upstream,
|
2023-07-01 04:50:47 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [sveltekit()],
|
2023-10-07 10:49:34 +00:00
|
|
|
optimizeDeps: {
|
2023-11-07 04:02:46 +00:00
|
|
|
entries: ['src/**/*.{svelte,ts,html}'],
|
2023-10-07 10:49:34 +00:00
|
|
|
},
|
2022-07-16 04:18:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|