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

56 lines
1.4 KiB
JavaScript
Raw Normal View History

import { enhancedImages } from '@sveltejs/enhanced-img';
import { sveltekit } from '@sveltejs/kit/vite';
import { svelteTesting } from '@testing-library/svelte/vite';
import path from 'node:path';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
const upstream = {
2024-10-09 22:01:52 +02:00
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:2283/',
secure: true,
changeOrigin: true,
logLevel: 'info',
ws: true,
};
export default defineConfig({
resolve: {
alias: {
'xmlhttprequest-ssl': './node_modules/engine.io-client/lib/xmlhttprequest.js',
// eslint-disable-next-line unicorn/prefer-module
'@test-data': path.resolve(__dirname, './src/test-data'),
},
},
server: {
// connect to a remote backend during web-only development
proxy: {
'/api': upstream,
'/.well-known/immich': upstream,
'/custom.css': upstream,
},
},
plugins: [
sveltekit(),
process.env.BUILD_STATS === 'true'
? visualizer({
emitFile: true,
filename: 'stats.html',
})
: undefined,
enhancedImages(),
svelteTesting(),
],
optimizeDeps: {
2023-11-07 06:02:46 +02:00
entries: ['src/**/*.{svelte,ts,html}'],
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}'],
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test-data/setup.ts'],
sequence: {
hooks: 'list',
},
},
});