Skip to content

Commit 8a533d2

Browse files
author
Mike Nikles
committed
Configure HMR on Gitpod & localhost.
1 parent 675aab0 commit 8a533d2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.gitpod.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
tasks:
22
- init: npm install
3-
command: npm run dev
3+
command: |
4+
export HMR_HOST=`gp url 3000`
5+
npm run dev
46
57
ports:
68
- port: 3000

svelte.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ const config = {
1111
adapter: adapter(),
1212

1313
// hydrate the <div id="svelte"> element in src/app.html
14-
target: '#svelte'
14+
target: '#svelte',
15+
vite: {
16+
server: {
17+
hmr: {
18+
clientPort: process.env.HMR_HOST ? 443: 3000,
19+
host: process.env.HMR_HOST ? process.env.HMR_HOST.substring("https://".length) : "localhost"
20+
}
21+
}
22+
}
1523
}
1624
};
1725

0 commit comments

Comments
 (0)