-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (43 loc) · 1.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/dev/main.ts"></script>
<script type="module">
const launchParam = import.meta.env.VITE_LAUNCH_QSPARAM;
let launchUrl = import.meta.env.VITE_LAUNCH_URL;
if (!launchUrl.endsWith('/')) {
launchUrl += '/';
}
const localUrl = new URL(import.meta.url);
let configEncoded = btoa(
JSON.stringify({
localUrl: localUrl.origin,
scripts: [
{
name: '@vite/client',
scriptType: 'module',
},
{
name: 'src/dev/main.ts',
scriptType: 'module',
},
],
stylesheets: [
{
name: 'src/dev/tokens.css',
},
],
}),
);
location.replace(
`${launchUrl}?${launchParam}=${encodeURIComponent(configEncoded)}`,
);
</script>
</body>
</html>