• Update all GitHub workflow files to use pnpm instead of npm • Replace npm commands with pnpm equivalents in devcontainer scripts • Remove package-lock.json files and update to use pnpm-lock.yaml • Consolidate node version references to use server/.nvmrc
70 lines
1.8 KiB
TypeScript
70 lines
1.8 KiB
TypeScript
import { enhancedImages } from '@sveltejs/enhanced-img';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
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 as defineViteConfig, mergeConfig } from 'vite';
|
|
import { defineConfig as defineVitestConfig } from 'vitest/config';
|
|
|
|
const upstream = {
|
|
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:2283/',
|
|
secure: true,
|
|
changeOrigin: true,
|
|
logLevel: 'info',
|
|
ws: true,
|
|
};
|
|
|
|
const viteConfig = defineViteConfig({
|
|
build: {
|
|
target: 'es2022',
|
|
},
|
|
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'),
|
|
// '@immich/ui': path.resolve(__dirname, '../../ui'),
|
|
},
|
|
},
|
|
server: {
|
|
// connect to a remote backend during web-only development
|
|
proxy: {
|
|
'/api': upstream,
|
|
'/.well-known/immich': upstream,
|
|
'/custom.css': upstream,
|
|
},
|
|
allowedHosts: true,
|
|
},
|
|
plugins: [
|
|
enhancedImages(),
|
|
tailwindcss(),
|
|
sveltekit(),
|
|
process.env.BUILD_STATS === 'true'
|
|
? visualizer({
|
|
emitFile: true,
|
|
filename: 'stats.html',
|
|
})
|
|
: undefined,
|
|
svelteTesting(),
|
|
],
|
|
optimizeDeps: {
|
|
entries: ['src/**/*.{svelte,ts,html}'],
|
|
},
|
|
});
|
|
|
|
const vitestConfig = defineVitestConfig({
|
|
test: {
|
|
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
globals: true,
|
|
environment: 'happy-dom',
|
|
setupFiles: ['./src/test-data/setup.ts'],
|
|
sequence: {
|
|
hooks: 'list',
|
|
},
|
|
},
|
|
});
|
|
|
|
export default mergeConfig(viteConfig, vitestConfig);
|