open-webui/vite.config.ts

31 lines
835 B
TypeScript
Raw Normal View History

2023-10-09 06:38:42 +08:00
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
2024-05-17 14:25:55 +08:00
// /** @type {import('vite').Plugin} */
// const viteServerConfig = {
// name: 'log-request-middleware',
// configureServer(server) {
// server.middlewares.use((req, res, next) => {
// res.setHeader('Access-Control-Allow-Origin', '*');
// res.setHeader('Access-Control-Allow-Methods', 'GET');
// res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
// res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
// next();
// });
// }
// };
2024-05-17 11:49:28 +08:00
2023-10-09 06:38:42 +08:00
export default defineConfig({
2024-05-17 14:25:55 +08:00
plugins: [sveltekit()],
2024-02-22 09:10:27 +08:00
define: {
2024-05-23 03:22:38 +08:00
APP_VERSION: JSON.stringify(process.env.npm_package_version),
2024-05-26 15:49:30 +08:00
APP_BUILD_HASH: JSON.stringify(process.env.APP_BUILD_HASH || 'dev-build')
},
build: {
sourcemap: true
},
worker: {
format: 'es'
2024-02-22 09:10:27 +08:00
}
2023-10-09 06:38:42 +08:00
});