lasthourcloud/apps/ui/vite.config.js
2022-08-11 08:18:17 +00:00

26 lines
752 B
JavaScript

import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
export default {
plugins: [sveltekit()],
define: {
'GITPOD_WORKSPACE_URL': JSON.stringify(process.env.GITPOD_WORKSPACE_URL)
},
server: {
host: '0.0.0.0',
port: 3000,
hmr: process.env.GITPOD_WORKSPACE_URL
? {
// Due to port fowarding, we have to replace
// 'https' with the forwarded port, as this
// is the URI created by Gitpod.
host: process.env.GITPOD_WORKSPACE_URL.replace("https://", "3000-"),
protocol: "wss",
clientPort: 443
}
: true,
fs: {
allow: ['./src/lib/locales/']
}
},
}