2024-06-13 10:32:17 +01:00
|
|
|
import { sveltekit } from "@sveltejs/kit/vite";
|
2024-07-02 19:16:03 +01:00
|
|
|
import { defineConfig, searchForWorkspaceRoot } from "vite";
|
2024-06-13 10:32:17 +01:00
|
|
|
|
2024-08-10 12:21:39 +01:00
|
|
|
import basicSSL from "@vitejs/plugin-basic-ssl";
|
|
|
|
|
2024-06-13 10:32:17 +01:00
|
|
|
export default defineConfig({
|
2024-07-02 19:16:03 +01:00
|
|
|
plugins: [
|
2024-08-10 12:21:39 +01:00
|
|
|
basicSSL(),
|
|
|
|
sveltekit(),
|
|
|
|
{
|
|
|
|
name: "isolation",
|
|
|
|
configureServer(server) {
|
|
|
|
server.middlewares.use((_req, res, next) => {
|
|
|
|
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
|
|
|
|
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
|
|
|
next();
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2024-07-02 19:16:03 +01:00
|
|
|
],
|
2024-07-04 23:15:15 +01:00
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
manualChunks: (id) => {
|
|
|
|
if (id.includes('/web/i18n')) {
|
|
|
|
const lang = id.split('/web/i18n/')?.[1].split('/')?.[0];
|
|
|
|
if (lang) {
|
|
|
|
return `i18n_${lang}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-07-02 19:16:03 +01:00
|
|
|
server: {
|
|
|
|
fs: {
|
|
|
|
allow: [
|
|
|
|
searchForWorkspaceRoot(process.cwd())
|
|
|
|
]
|
2024-08-10 12:21:39 +01:00
|
|
|
},
|
|
|
|
proxy: {}
|
|
|
|
},
|
|
|
|
optimizeDeps: {
|
|
|
|
exclude: ["@imput/ffmpeg.wasm"]
|
|
|
|
},
|
2024-06-13 10:32:17 +01:00
|
|
|
});
|