1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-25 09:01:22 +02:00
immich/web/vite.config.js

48 lines
1.1 KiB
JavaScript
Raw Normal View History

import { sveltekit } from '@sveltejs/kit/vite';
import path from 'path';
const upstream = {
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:3001/',
secure: true,
changeOrigin: true,
logLevel: 'info',
ws: true,
};
/** @type {import('vite').UserConfig} */
const config = {
resolve: {
alias: {
'xmlhttprequest-ssl': './node_modules/engine.io-client/lib/xmlhttprequest.js',
'@test-data': path.resolve(__dirname, './src/test-data'),
'@api': path.resolve('./src/api'),
},
},
server: {
// connect to a remote backend during web-only development
proxy: {
'/api': upstream,
'/.well-known/immich': upstream,
'/custom.css': upstream,
},
},
plugins: [sveltekit()],
optimizeDeps: {
2023-11-07 06:02:46 +02:00
entries: ['src/**/*.{svelte,ts,html}'],
},
};
/** @type {import('vitest').UserConfig} */
const test = {
include: ['src/**/*.{test,spec}.{js,ts}'],
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test-data/setup.ts'],
sequence: {
hooks: 'list',
},
alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }],
};
export default { ...config, test };