1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-28 09:33:27 +02:00
immich/web/vite.config.js
Ben McCann b273ea2ba4
chore: setup rollup-plugin-visualizer and remove lodash (#6974)
* chore: setup rollup-plugin-visualizer

* chore: remove lodash

* format

* remove lodash-es from build
2024-02-08 02:27:54 -05:00

52 lines
1.3 KiB
JavaScript

import { sveltekit } from '@sveltejs/kit/vite';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import path from 'node:path';
const upstream = {
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:3001/',
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'),
'@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(),
visualizer({
emitFile: true,
filename: 'stats.html',
}),
],
optimizeDeps: {
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',
},
alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }],
},
});