1
0
Fork 0
skiff-apps-main/calendar-web/app.html
2024-02-10 14:41:59 -06:00

45 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Skiff</title>
<script>
(() => {
if (
typeof process !== 'object' ||
(typeof process === 'object' && !process.env.START_HOT)
) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = './dist/style.css';
// HACK: Writing the script path should be done with webpack
document.getElementsByTagName('head')[0].appendChild(link);
}
})();
</script>
</head>
<body>
<div id="root"></div>
<script>
if (typeof process === 'object') {
const scripts = [];
if (process.env.START_HOT) {
// Dynamically insert the bundled app script in the renderer process
const port = process.env.PORT || 4100;
scripts.push(`http://localhost:${port}/dist/renderer.dev.js`);
} else {
scripts.push('./dist/renderer.prod.js');
}
if (scripts.length) {
document.write(
scripts
.map((script) => `<script defer src="${script}"><\/script>`)
.join('')
);
}
}
</script>
</body>
</html>