feat: Gitpod ready code(almost)

This commit is contained in:
Andras Bacsai
2022-07-11 20:32:27 +00:00
parent 77ae070c98
commit 1c65df282e
3 changed files with 22 additions and 2 deletions

View File

@@ -3,7 +3,20 @@ 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: {
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/']
}