fix: apply Docker 24 network workaround and smoke tests to production deploy #64

Merged
jimmy merged 18 commits from dev into main 2026-05-17 23:34:02 +08:00
Showing only changes of commit b092ab4583 - Show all commits
+25
View File
@@ -1,6 +1,31 @@
import { defineConfig } from 'vitest/config';
import { svelte } from '@sveltejs/vite-plugin-svelte';
const sveltePlugin = svelte({
hot: !process.env.VITEST ? {
preserveLocalState: true
} : false,
compilerOptions: {
dev: true
}
});
// Vitest 3 bundles its own Vite which may not expose `server.config.server`,
// causing the Svelte HMR plugin's configureServer to crash. Wrap it safely.
if (process.env.VITEST) {
const plugins = Array.isArray(sveltePlugin) ? sveltePlugin : [sveltePlugin];
for (const p of plugins) {
if (p.configureServer) {
const orig = p.configureServer;
p.configureServer = function(server) {
try { return orig.call(this, server); } catch (e) {
if (!(e instanceof TypeError)) throw e;
}
};
}
}
}
export default defineConfig({
plugins: [
svelte({