-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHTML.js
23 lines (21 loc) · 813 Bytes
/
HTML.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export default ({title="", meta="", links="", content="", initialState={}, env={}, base_path="" }) => `
<html>
<head>
<meta charset="utf-8">
${title}
<meta name="viewport" content="width=device-width, initial-scale=1">
${meta}
${links}
<link href="${base_path}/static/app.css" rel=stylesheet>
</head>
<body>
<div id=app>${content}</div>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch&unknown=polyfill"></script>
<script>
window.__INITIAL_STATE__ = ${JSON.stringify(initialState)};
window.__APP_ENV_VARS__ = ${JSON.stringify(env)};
</script>
<script type=text/javascript src="${base_path}/static/app.js" charset=utf-8 async></script>
</body>
</html>
`;